https://pulumi.com logo
Docs
Join the conversationJoin Slack
Channels
announcements
automation-api
aws
azure
blog-posts
built-with-pulumi
cloudengineering
cloudengineering-support
content-share
contribex
contribute
docs
dotnet
finops
general
getting-started
gitlab
golang
google-cloud
hackathon-03-19-2020
hacktoberfest
install
java
jobs
kubernetes
learn-pulumi-events
linen
localstack
multi-language-hackathon
office-hours
oracle-cloud-infrastructure
plugin-framework
pulumi-cdk
pulumi-crosscode
pulumi-deployments
pulumi-kubernetes-operator
pulumi-service
pulumiverse
python
registry
status
testingtesting123
testingtesting321
typescript
welcome
workshops
yaml
Powered by Linen
golang
  • c

    cuddly-dusk-95227

    09/01/2020, 9:29 AM
    I’m interested in how to create reusable packages for golang projects. Does anyone have any examples on what they think the best way to create higher-level abstractions? My gut feel is to create a type to define the inputs, and use a
    New()
    helper to take in providers and contexts.
    l
    • 2
    • 2
  • w

    white-midnight-53747

    09/02/2020, 10:00 AM
    Is anyone using VSCode / Remote Containers (on Windows) for their development e.g. - https://www.pulumi.com/blog/vscode-devcontainers/ If so, how have you configured docker to run. Trying to run the basic example tests (go test ./...) from this https://github.com/pulumi/pulumi-aws/tree/master/examples/webserver-go and the container times out continually. Any tips or anyone experiencing the same?
    l
    • 2
    • 5
  • l

    lemon-agent-27707

    09/02/2020, 3:55 PM
    Some exciting new Go capabilities: https://pulumi-community.slack.com/archives/CB36DSVSA/p1599060101037800
    🎉 1
    ⭐ 1
    🚀 2
  • m

    microscopic-xylophone-85966

    09/03/2020, 2:13 PM
    hello ppl, I have a question about AWS SDK trying to get aws account id, found following method:
    acc, err := iam.LookupAccountAlias(ctx)
            ctx.Export("account_id", pulumi.String(acc.Id))
    I expect numeric ID like here: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/caller_identity but I have the following
    account_id   : "2020-09-03 11:45:17.12209 +0000 UTC"
    Is it a bug or I should use other approaches?
    l
    b
    • 3
    • 2
  • i

    important-appointment-55126

    09/03/2020, 2:30 PM
    I’ve just been using https://godoc.org/github.com/pulumi/pulumi-aws/sdk/go/aws#GetCallerIdentity if i need to know the account id the provider is using
    ☝️ 1
  • m

    microscopic-xylophone-85966

    09/03/2020, 3:58 PM
    this works, thank you
  • c

    chilly-rainbow-79265

    09/04/2020, 3:24 PM
    I know pulumi cli has
    --target
    option. But is it possible to delete a targeted resource, like a specific VM, resource after some custom logic, form the program ? @important-appointment-55126
  • i

    important-appointment-55126

    09/04/2020, 3:26 PM
    you can just wrap the declaration in a normal Go
    if
    condition - if the resource is declared, Pulumi will ensure it exists.. if it isn’t declared but the condition evaluated to false, then Pulumi will remove it if it already exists in the same way it would if you deleted the resource from your program normally
    c
    l
    • 3
    • 16
  • o

    orange-electrician-25669

    09/07/2020, 6:35 PM
    Hi is any one here from pulumi dev team that can ask a Q ?
    b
    • 2
    • 2
  • g

    gifted-city-99717

    09/07/2020, 10:39 PM
    Hi, I’m trying to stand up a helm chart on EKS in go. I’ve seen examples in Python and Typescript referencing a Provider when creating a helm chart. I see a GetProvider() function on the created EKS cluster, but the dictionary
    providers
    is empty. Do I need to explicitly create a provider (eg: providers.NewProvider) ?
  • c

    chilly-rainbow-79265

    09/08/2020, 12:11 AM
    @important-appointment-55126 Is there any way to get the current azure subscription id for a context ?
    i
    • 2
    • 8
  • c

    chilly-rainbow-79265

    09/08/2020, 11:36 AM
    How to parse this tag from stack file
    demo:tags:
        Environment: Development
    type Tags struct {
    	Tags map[string]pulumi.String `yaml:"tags"`
    }
    ...
    cfg := config.New(ctx, "")
    var tags Tags 
    if err := cfg.GetObject("tags", &tags); err != nil {
    	return err
    }
    ...
    ...
    server, err := NewVMInstance(ctx, name, &VMInstanceArgs{
      Tags:  pulumi.StringMap(tags), // This part is throwing error 
      // cannot convert v.Tags (variable of type map[string]pulumi.String) to pulumi.StringMap
    })
    l
    • 2
    • 3
  • o

    orange-electrician-25669

    09/08/2020, 3:14 PM
    HI someone have an example how you create cloudwatch role that triger lambda function ????? its enigma 😞
  • o

    orange-electrician-25669

    09/08/2020, 3:15 PM
    i have an lambda func ...
  • o

    orange-electrician-25669

    09/08/2020, 3:15 PM
  • o

    orange-electrician-25669

    09/08/2020, 6:31 PM
    any one ?
    l
    • 2
    • 1
  • g

    gifted-city-99717

    09/08/2020, 8:43 PM
    Following up from before - about using golang SDK to stand up an EKS cluster with a helm chart (trying to run thanos).. I’ve added a provider, and set that in the helmv2.NewChart:
    resource.Chart, err = helmv2.NewChart(ctx, "thanos", helmv2.ChartArgs{
    		Namespace: pulumi.String("banzaicloud-stable"),
    		Chart:   pulumi.String("thanos"),
    		Version: pulumi.String("0.3.26"),
    		FetchArgs: helmv2.FetchArgs{
    			Repo: pulumi.String("<https://kubernetes-charts.banzaicloud.com>"),
    		},
    	}, pulumi.Parent(&resource), pulumi.Provider(eksProvider))
    	if err != nil {
    		return nil, err
    	}
    but am seeing:
    kubernetes:core:Service (banzaicloud-stable/thanos-bucket):
        error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: cluster "eks-cluster-fbf30f5" does not exist
    
      kubernetes:core:Service (banzaicloud-stable/thanos-sidecar-grpc):
        error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: cluster "eks-cluster-fbf30f5" does not exist
    
      kubernetes:core:Service (banzaicloud-stable/thanos-query-grpc):
        error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file: cluster "eks-cluster-fbf30f5" does not exist
  • g

    gifted-city-99717

    09/08/2020, 8:44 PM
    anyone run into this? - not the thanos specific stuff, but gettng EKS to run a chart?
    g
    • 2
    • 3
  • c

    chilly-rainbow-79265

    09/10/2020, 5:19 PM
    How to wait for a resource to get created and take the id. for example, 1. Create Resource Group, 2. Wait to get the ID 3. Update a variable
    b
    • 2
    • 1
  • c

    chilly-rainbow-79265

    09/17/2020, 12:15 AM
    Hi While using gihub actions (pulumi/action) container, Im getting error that
    error: no resource plugin 'azure' found in the workspace or on your $PATH
    . I saw @lemon-agent-27707 PR for fixing plugin acquisition for vendor, but the issue seems still the same. https://github.com/pulumi/pulumi/pull/5286 am I missing something here. I'm trying to build the azure-go-webserver example
  • s

    salmon-account-74572

    09/21/2020, 7:44 PM
    I apologize if I have the wrong terminology here, but is there an example of creating a new Kubernetes provider (or modifying an existing Kubernetes provider) so as to set the
    RenderYamlToDirectory
    property?
    b
    • 2
    • 2
  • s

    salmon-account-74572

    09/23/2020, 10:31 PM
    I have a question about StackReferences and type conversions in Go. I have an array of AWS subnet IDs that I am exporting (via
    ctx.Export("subnetIds", pulumi.StringArray("subnets"))
    in one stack. In another stack, I'd like to use a StackReference to pull that data out, but I'd like for it to just be a plain, ordinary array of strings so that I can iterate over it. Is there any way to do that?
    l
    c
    • 3
    • 3
  • c

    clever-byte-21551

    09/24/2020, 5:15 AM
    Why the
    ApplyX
    methods doesn’t return an error? What if I need to to some manipulation that can result in an error (e.g marshal a json)
    l
    • 2
    • 6
  • s

    salmon-account-74572

    09/24/2020, 10:09 PM
    I have what is probably a general Golang question (I'm a newbie). If I have a variable that defined as
    interface{}
    , how would I convert the value of that variable to a string?
    i
    • 2
    • 16
  • w

    wet-egg-6347

    09/28/2020, 8:06 PM
    how do i debug something like this? not much to go on...
    Diagnostics:
      pulumi:pulumi:Stack (bos-staging):
        error: an unhandled error occurred: program exited with non-zero exit code: 2
    
        panic: runtime error: invalid memory address or nil pointer dereference
        [signal SIGSEGV: segmentation violation code=0x1 addr=0x17 pc=0x10997a6]
        goroutine 754 [running]:
        reflect.(*rtype).Kind(...)
        	GOROOT/src/reflect/type.go:777
        reflect.convertOp(0x6efb760, 0x0, 0x109616d)
        	GOROOT/src/reflect/value.go:2423 +0x26
        reflect.Value.Convert(0x0, 0x0, 0x0, 0x8282080, 0x6efb760, 0x199, 0x11, 0x12)
        	GOROOT/src/reflect/value.go:2413 +0x8a
        <http://github.com/pulumi/pulumi/sdk/v2/go/pulumi.awaitInputs(0x822f700|github.com/pulumi/pulumi/sdk/v2/go/pulumi.awaitInputs(0x822f700>, 0xc0000400b8, 0x6ed4580, 0xc0000e55e0, 0x94, 0x6efb760, 0xc0004996b0, 0x199, 0x8280000, 0x0, ...)
        	external/com_github_pulumi_pulumi_sdk_v2/go/pulumi/types.go:700 +0x83f
        <http://github.com/pulumi/pulumi/sdk/v2/go/pulumi.awaitInputs(0x822f700|github.com/pulumi/pulumi/sdk/v2/go/pulumi.awaitInputs(0x822f700>, 0xc0000400b8, 0x6fd7780, 0xc0000e5580, 0x99, 0x6faf420, 0xc0000f9f20, 0x199, 0xc000040000, 0x0, ...)
        	external/com_github_pulumi_pulumi_sdk_v2/go/pulumi/types.go:646 +0xdbf
        <http://github.com/pulumi/pulumi/sdk/v2/go/pulumi.toOutputWithContext.func1(0x6fd7780|github.com/pulumi/pulumi/sdk/v2/go/pulumi.toOutputWithContext.func1(0x6fd7780>, 0xc0000e5580, 0x82465c0, 0xc0002e2700, 0x8282080, 0x6faf420, 0x822f700, 0xc0000400b8, 0x105b700)
        	external/com_github_pulumi_pulumi_sdk_v2/go/pulumi/types.go:738 +0x147
        created by <http://github.com/pulumi/pulumi/sdk/v2/go/pulumi.toOutputWithContext|github.com/pulumi/pulumi/sdk/v2/go/pulumi.toOutputWithContext>
        	external/com_github_pulumi_pulumi_sdk_v2/go/pulumi/types.go:730 +0x1e8
    l
    • 2
    • 8
  • b

    big-account-56668

    09/29/2020, 4:26 PM
    Hi, I'm just trying to start using Pulumi but are running into some issues. Using GCP and
    <http://github.com/pulumi/pulumi-gcp/sdk/v3@v3.25.0/go/gcp/compute|github.com/pulumi/pulumi-gcp/sdk/v3@v3.25.0/go/gcp/compute>
    creating a
    NewInstance
    and running
    pulumi up
    has my machine freeze up as the compilation step (snippet) hijacks all cores at 100% until finally failing with
    Diagnostics:
      pulumi:pulumi:Stack (project-stage):
        go build <http://github.com/pulumi/pulumi-gcp/sdk/v3/go/gcp/compute|github.com/pulumi/pulumi-gcp/sdk/v3/go/gcp/compute>: /usr/lib/go/pkg/tool/linux_amd64/compile: signal: killed
    
        error: an unhandled error occurred: program exited with non-zero exit code: 1
    I'm looking for any assistance in debugging this. I've successfully added two other resources and it's as I'm adding the compute instance to my stack that this happens. I'm not sure what is eventually killing off the compilation but I would assume it's some internal timeout in Pulumi. Happy to provide any additional info.
    Untitled
    l
    • 2
    • 8
  • r

    rich-exabyte-94739

    10/02/2020, 5:55 PM
    Hi all, I'm trying to setup an ALB with target groups and having trouble finding out where I specify my targets for a target group. I can define my TargetGroup just fine:
    frontEndTargetGroup, err := lb.NewTargetGroup(ctx, "foo-tg", &lb.TargetGroupArgs{
    			Name:       pulumi.String("foo-tg"),
    			Port:       <http://pulumi.Int|pulumi.Int>(80),
    			Protocol:   pulumi.String("HTTP"),
    			VpcId:      vpc.ID(),
    			TargetType: pulumi.String("ip"),
    			HealthCheck: &lb.TargetGroupHealthCheckArgs{
    				Enabled:            pulumi.Bool(true),
    				Path:               pulumi.String("/health"),
    				Protocol:           pulumi.String("HTTP"),
    				HealthyThreshold:   <http://pulumi.Int|pulumi.Int>(5),
    				UnhealthyThreshold: <http://pulumi.Int|pulumi.Int>(5),
    				Timeout:            <http://pulumi.Int|pulumi.Int>(5),
    			},
    		})
    		if err != nil {
    			return err
    		}
    I'm just not sure where to go after this. How do I add an IP address to this target group?
    w
    • 2
    • 4
  • b

    big-account-56668

    10/05/2020, 11:22 AM
    How am I supposed to handle a case where I need a resource attribute as a string? I've got a GCP project resource and want the default service account
    p := organizations.NewProject(ctx, "p", &organizations.ProjectArgs{
    			ProjectId:      pulumi.Sprintf("%s-%s", petName.ID(), ctx.Stack()),
    		})
    		sa, err := compute.GetDefaultServiceAccount(ctx, &compute.GetDefaultServiceAccountArgs{
    			Project: &p.Name, // Project is a *string
    		})
    but this clearly yields type error
    cannot use p.Name (variable of type pulumi.StringOutput) as *string value in struct literal
    . Reading docs I've not been able to find the way to achieve this using either apply, lifting or interpolation.
    l
    • 2
    • 4
  • r

    rich-exabyte-94739

    10/05/2020, 6:19 PM
    Hey all, Im in the process of messing around with a Pulumi configuration and doing a lot of setup & teardown. Occasionally I'll see the following error:
    docker:image:Image (service-dev1):
        error: Error saving credentials: error storing credentials - err: exit status 1, out: `error storing credentials - err: exit status 1, out: `The specified item already exists in the keychain.``
    The only way to get rid of the error is to
    pulumi up
    the stack but comment out all code related to the docker image and services, forcing a re-creation.
  • e

    elegant-dress-88912

    10/06/2020, 3:09 PM
    hey! Question: how do I create
    pulumi.MapInput
    ?
Powered by Linen
Title
e

elegant-dress-88912

10/06/2020, 3:09 PM
hey! Question: how do I create
pulumi.MapInput
?
View count: 3