hi, question anyone knows how to get stack informa...
# general
b
hi, question anyone knows how to get stack information in go using pulumi
b
What stack information? The current stack name?
b
yeah in the yaml config
how to reference it correctly from the code
b
ctx.GetStack
b
for example i use this
Copy code
import (
  "<http://github.com/pulumi/pulumi-azure-native/sdk/go/azure/resources|github.com/pulumi/pulumi-azure-native/sdk/go/azure/resources>"
  "<http://github.com/pulumi/pulumi-azure-native/sdk/go/azure/storage|github.com/pulumi/pulumi-azure-native/sdk/go/azure/storage>"
  "<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi|github.com/pulumi/pulumi/sdk/v3/go/pulumi>"
  "<http://github.com/pulumi/pulumi/sdk/v3/go/pulumi/config|github.com/pulumi/pulumi/sdk/v3/go/pulumi/config>"
)
my config looks like this
Copy code
config:
  azure-native:location: westeurope
  pulumi-azure-go:storage:
    EnableHttpsTrafficOnly: true
    kind: StorageV2
    sku: GRS
referencing the sku like this
Copy code
Name: pulumi.String(config.Get("sku")),
Copy code
config := config.New(ctx, "")
also referncing it like this doesn’t work properly
Copy code
Name: config.Get("sku"),
it gives me this error
Copy code
cannot use config.Get("sku") (value of type string) as pulumi.StringInput value in struct literal: string does not implement pulumi.StringInput (missing method ElementType)
b
@bumpy-byte-21437 this is structured config data, you need to retrieve it like this: https://www.pulumi.com/docs/intro/concepts/config/#structured-configuration
b
Aah thanks allot, will try that