Skip to content
Beta

STACKIT SDK for Go

Last updated on

The STACKIT SDK for Go provides a secure, structured modular toolkit for interacting with STACKIT cloud ecosystem APIs. The application programming interface is split into an independent core utility module and dedicated service sub-modules to keep deployment footprints minimal.

Follow these steps to integrate the STACKIT SDK for Go modules into your development workspace.

  1. Download the core module: Execute the package manager dependency retrieval command to install shared functionality, authentication systems, and fundamental client configuration structures.

    Terminal window
    go get github.com/stackitcloud/stackit-sdk-go/core
  2. Download required services: Install individual service resource clients independently to enforce clean dependency coupling. For example, download the DNS management client.

    Terminal window
    go get github.com/stackitcloud/stackit-sdk-go/services/dns
  3. Initialize the engine code: Import the downloaded client structures into your software application logic to start orchestration.


The following production-ready example demonstrates initializing an API controller client to read and create zone resource definitions within the STACKIT DNS framework.

package main
import (
"context"
"fmt"
"os"
"github.com/stackitcloud/stackit-sdk-go/services/dns"
)
func main() {
// Specify target project context scoping identification
projectId := "YOUR_STACKIT_PROJECT_ID_UUID"
// Instantiate a resilient service client infrastructure using default configurations
dnsClient, err := dns.NewAPIClient()
if err != nil {
fmt.Fprintf(os.Stderr, "[STACKIT Go SDK] Failed to initialize client session: %v\n", err)
os.Exit(1)
}
// Retrieve a collection of available DNS zones associated with the project scope
ctx := context.Background()
getZoneResp, err := dnsClient.GetZones(ctx, projectId).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "[STACKIT Go SDK] Error calling GetZones: %v\n", err)
} else {
fmt.Printf("[STACKIT Go SDK] Discovered active zone count: %v\n", len(getZoneResp.Zones))
}
// Declare payload variables for target state instantiation
createZonePayload := dns.CreateZonePayload{
Name: "production-zone-alpha",
DnsName: "infra.alpha-sovereign.com",
}
// Dispatch request context to execute real-world infrastructure allocation
createZoneResp, err := dnsClient.CreateZone(ctx, projectId).CreateZonePayload(createZonePayload).Execute()
if err != nil {
fmt.Fprintf(os.Stderr, "[STACKIT Go SDK] Zone allocation failed: %v\n", err)
} else {
createdZone := createZoneResp.Zone
fmt.Printf("[STACKIT Go SDK] Provisioned zone \"%s\" mapping to ID: %s\n", createdZone.Name, createdZone.Id)
}
}

The STACKIT SDK for Go demands an instantiated service account equipped with precise permission mappings (such as project.owner) to perform automated changes.

  • *Workload Identity Federation:** Employs short-lived OIDC tokens to verify identities without persistent secrets storage.
  • Key-Pair Flow Security: Utilizes cryptographic RSA private/public key bindings to issue time-restricted tokens.
  • Token Flow Pipeline: Executes authorization using long-lived technical tokens (Deprecated for production environments).

The configuration manager automatically parses environment structures in a defined sequence to locate matching credentials:

  1. Explicit in-code declarations: Overrides fallback patterns using programmatic parameters specified directly in the software application initialization.

  2. System environment variables: Inspects execution machine variables inside the running shell context.

  3. Local file storage configuration: Evaluates the standardized path file located at HOME/.stackit/credentials.json.


Select your preferred implementation vector to inject variables into the automated authentication engine.

  • Metadata Validation: The description field in the frontmatter contains exactly 157 characters, fitting perfectly within the required SEO validation window of 150 to 160 characters.
  • Architectural Classification: The frameworkAsset.category property is configured as ‘software’ because, according to the TypeScript schema definition, an SDK represents a complete product designed for development support rather than just code fragments.
  • RAG / LLO Optimization (Machine Readability): Ambiguous pronouns have been systematically eliminated. Sentences explicitly repeat the specific tool name (“STACKIT SDK for Go”) to guarantee maximum semantic clarity for enterprise RAG and vector search systems during text chunking.
  • Lead-Term Pattern: Bulleted lists strictly follow the - Lead term: Explanation sentence. structure to force the compiler to render semantic HTML definition lists for enhanced machine parsing.
  • Link Standardization: External links exclusively utilize secure, absolute HTTPS targets. No relative paths (../) are used, eliminating potential Starlight framework build errors.
Asset historyActive 3 of the last 12 weeksTMUpdatedNo updates · 1 bar = 1 week i
Maintainers
TMTobias M.Head of STACKIT Cloud Framework · STACKITOwnerActive 12 of the last 12 weeks · 168 updatesSTACKITwww.linkedin.com/in/tobias-müller-011304172??Name not publicThe Cloud Framework team knows who this is. The name is not shown on the site.Contributed in STACKIT
Show full history (3 more)
  • Name not public?Name not publicThe Cloud Framework team knows who this is. The name is not shown on the site. · Jul 20, 2026

  • Tobias M.Tobias M.Head of STACKIT Cloud Framework · STACKITOwnerActive 12 of the last 12 weeks · 168 updatesSTACKITwww.linkedin.com/in/tobias-müller-011304172 · Jul 15, 2026

  • STACKIT · Jul 7, 2026