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
  • b

    bored-spoon-83710

    10/03/2022, 5:20 PM
    Hello, it seems that I’ve a deadlock in my Pulumi code and I’d like to know if there are ways to troubleshoot them because I can’t find them by reading the code?
    s
    a
    • 3
    • 9
  • s

    swift-machine-98066

    10/03/2022, 7:05 PM
    how are people storing Arns from StringOutput in a struct?
    b
    • 2
    • 25
  • p

    proud-machine-85126

    10/04/2022, 5:48 PM
    Is there an
    InvokeOption
    that lets me set a timeout when calling a data getter? Specifically I'm calling pulumi-openstack's
    compute.GetImageIds()
    and it doesn't timeout.
  • b

    brash-gigabyte-81569

    10/04/2022, 8:31 PM
    Hi, I was just trying to update https://github.com/pulumi/pulumi-eks to v0.42.0 and it doesn’t appear released. Is that intentional?
    b
    • 2
    • 8
  • r

    refined-pilot-45584

    10/05/2022, 9:17 AM
    Hey All, Random question does any one know if there is a way to call/use the Pulumi CLI directly within Go? For example if I wanted to run
    pulumi init
    or say
    pulumi up
    from within a Go program is there a way to do this? Without running say
    cmd.exec().output()
    . Thanks.
    q
    • 2
    • 2
  • e

    elegant-author-139

    10/05/2022, 4:55 PM
    Is it possible while using the go flavor of the automation API, to run pulumi programs in other languages such as typescript from a remote repo? I have go programs in a remote repo working fine, but I keep seeing the following error with TS programs
    error: It looks like the Pulumi SDK has not been installed. Have you run npm install or yarn install?
    I’ve tried doing a
    npm install @pulumi/pulumi -g
    which didn’t seem to help.
    b
    • 2
    • 2
  • d

    damp-continent-75299

    10/05/2022, 7:50 PM
    Is there a way to reference the created instance Id inside the IAM policy, I want user(s) the created instance only
    ec2Instance, err := ec2.NewInstance(ctx, ec2InstanceIdentifier, &ec2.InstanceArgs{
          Ami:                pulumi.String(AppInstanceId),
          InstanceType:       pulumi.String("t3.micro"),
        })
    
         policy, err := json.Marshal(map[string]interface{}{
          "Version": "2012-10-17",
          "Statement": []map[string]interface{}{
            {
              "Action": []string{
                "ec2:Describe*",
              },
              "Effect":   "Allow",
              "Resource": "*",
            },
          },
        })
        if err != nil {
          return err
        }
    
        _, err = iam.NewUserPolicy(ctx, envIdentifier, &iam.UserPolicyArgs{
          User: awsIamUser.Name,
          Policy: pulumi.Sprintf(string(policy)),
        })
        if err != nil {
          return err
        }
    b
    • 2
    • 3
  • b

    brash-gigabyte-81569

    10/07/2022, 4:19 PM
    In the pulumi-eks component, I saw that the NodeGroupV2 was added so that we can use Launch Templates and remove the cfn stack that was being used. I am not seeing a way to tell the cluster to make use of the nodegroupv2, is that in the works?
    b
    • 2
    • 4
  • h

    hundreds-tailor-52000

    10/17/2022, 8:55 AM
    Hi guys, I have a question regarding elasticsearch and kibana. Is there any possibility to provision elasticsearch_kibana_object in Pulumi? Quick search did not show result. So I’ll be very grateful for your help.
    b
    • 2
    • 13
  • b

    bulky-agent-73210

    10/17/2022, 3:42 PM
    Hey all, I’ve recently upgraded to Golang 1.19 and I have a custom native provider that I add to Pulumi environment PATH variable so it registers the plugin. Since upgrade, my Pulumi commands are failing with
    exec format error
    for this custom provider. Any ideas why that might be happening?
    b
    • 2
    • 3
  • c

    crooked-student-89656

    10/17/2022, 9:09 PM
    hello i am very new to pulumi and also go, is there someone that could possibly provide some help with creating private and public subnets in go?
    b
    s
    f
    • 4
    • 11
  • m

    most-mouse-38002

    10/18/2022, 11:03 AM
    Updating pulumi-azure-native from v1.66.0 to v1.81.0 and all the comments/docs in the dependencies are now gone. I believe they are still visible in git, so was i wrong in setting
    go 1.19
    in go.mod and doing
    go get -u
    ?
  • j

    jolly-church-88521

    10/18/2022, 3:48 PM
    What’s the best way to convert
    foo.Arn
    (pulumi.StringOutput) to
    string
    ? I’m kind of lost here and I cannot find any working example 😕 I’m trying to make it work with
    foo.Arn.ApplyT(func(arn string) string { … }
    but somehow it’s not working for me.
    b
    • 2
    • 13
  • c

    crooked-student-89656

    10/18/2022, 4:54 PM
    could someone show me the proper use for ec2.GetSubnet()? I'm seeing the arguments i need to input but pulumi.IDInput isnt allowing me to put the vpc id
    b
    • 2
    • 4
  • s

    swift-machine-98066

    10/18/2022, 6:04 PM
    does anyone know how to get the current account number ?
  • s

    swift-machine-98066

    10/18/2022, 6:04 PM
    it seems in v5 aws.GetAccountId() function isn't there anymore
  • h

    hundreds-tailor-52000

    10/18/2022, 7:52 PM
    Hi folks, Does anyone have hands on experience with Pulumi tfbridge? Faced with issue while making tfgen. Got an error : github.com/hashicorp/terraform-plugin-sdk@v1.13.1/internal/configs/configload/loader_snapshot.go:52:30: cannot use fs (variable of type snapshotFS) as type afero.Fs in argument to configs.NewParser: snapshotFS does not implement afero.Fs (missing Chown method) Indeed there is no implementation of specified method.
  • g

    gifted-fall-44000

    10/19/2022, 5:32 PM
    @here Has anyone written a transformation like this within golang? I'm having a heck of a time figuring it out. I need to transform the args to the underlying calls because the partitions are different on aws GovCloud for this security policies. I submitted and had accepted a PR to solve the underlying issue, but it's not released yet and I'd really like to get my test within Govcloud completed so I can work on some efforts in paralell while I wait for the plugin to be updated. https://github.com/pulumi/pulumi-eks/issues/570#issuecomment-829343861 ref: https://github.com/pulumi/pulumi-eks/pull/788 < This will remove the need for the transformation, but generally I will find another case where I have to transform again while getting this POC on govCloud working
    b
    • 2
    • 6
  • s

    swift-machine-98066

    10/21/2022, 7:04 PM
    does anyone dynamically make subnets from a cidr using the number of available availability zones?
    b
    • 2
    • 11
  • m

    most-portugal-2672

    10/22/2022, 1:58 PM
    Hello Everyone, I'm looking to create something like this using Pulumi Azure Native. I may be wrong but it appears there may be a type missing. The C# version works: C# Version
    var systemSubscription = new AzureNative.EventGrid.SystemTopicEventSubscription("subscription-level-events", new AzureNative.EventGrid.SystemTopicEventSubscriptionArgs
            {
                Destination = new AzureNative.EventGrid.Inputs.ServiceBusQueueEventSubscriptionDestinationArgs
                {
                    EndpointType = "ServiceBusQueue",
                    ResourceId = queue.Id,
                },
                SystemTopicName = systemTopic.Name,
                ResourceGroupName = resourceGroup.Name
            });
    but in Go, there doesn't seem to be a struct for
    ServiceBusQueueEventSubscriptionDestinationArgs
    and I'm unable to specify the "ServiceBusQueue" endpoint type and queue ID. Go Version:
    systemSubscription, err := eventgrid.NewSystemTopicEventSubscription(ctx, "subscription-level-events", &eventgrid.SystemTopicEventSubscriptionArgs{
    		Destination:       &eventgrid.ServiceBusQueueEventSubscriptionDestinationArgs{  // <-- missing type ?
    
    		},
    		SystemTopicName:   systemTopic.Name,
    		ResourceGroupName: resourceGroup.Name,
    		},
    	)
    Any pointers in the right direction would be appreciated. Thank you !
    • 1
    • 1
  • g

    gentle-knife-93855

    11/02/2022, 3:42 AM
    Hello, I have trouble passing Output of one resource as an input to another. I have created a Vpc in AWS using
    kong_vpc, err := ec2.NewVpc(ctx, "kong-network", &ec2.VpcArgs{
    			CidrBlock: pulumi.String("10.0.0.0/16"),
    		})
    		if err != nil {
    			return err
    		}
    I am trying to fetch the VPC ID to pass it as an input for the subnet using
    VpcId := kong_vpc.Id.ApplyT(func(vpc_id string) string {
    			return vpc_id
    		}).(pulumi.StringOutput)
    But Pulumi throws the following error -
    ./main.go:17:21: kong_vpc.Id undefined (type *ec2.Vpc has no field or method Id)
    The <https:/www.pulumi.com/registry/packages/aws/api-docs/ec2/vpc/#id_go|docs> mentions that
    Id
    is an Output of VPC
    b
    s
    • 3
    • 8
  • p

    prehistoric-sandwich-7272

    11/03/2022, 1:03 PM
    Hello, I have a problem with
    crd2pulumi
    - I have generated from the following crd - https://github.com/argoproj/argo-helm/blob/main/charts/argo-rollouts/templates/crds/rollout-crd.yaml a pulumi package using the above command, and I got errors in the pulumiTypes.go file! When I am running pulumi up, I get the following error message:
    argoRollout/argoproj/v1alpha1/pulumiTypes.go:1842:6: RolloutSpecStrategyBluegreenPostpromotionanalysisArgs redeclared in this block
    argoRollout/argoproj/v1alpha1/pulumiTypes.go:1674:6: other declaration of RolloutSpecStrategyBluegreenPostpromotionanalysisArgs
    argoRollout/argoproj/v1alpha1/pulumiTypes.go:1917:98: v.Name undefined (type RolloutSpecStrategyBluegreenPostpromotionanalysisArgs has no field or method Name)
    .
    .
    .
    argoRollout/argoproj/v1alpha1/pulumiTypes.go:2798:98: too many errors
    I am taking from this that the
    crd2pulumi
    couldn’t create the package from the crd correctly. Is there any way around this?
    b
    l
    • 3
    • 19
  • c

    crooked-student-89656

    11/03/2022, 7:06 PM
    I’m struggling to find a proper tutorial on this and maybe someone could either explain it or point me in the right direction, but how do I store pulumi state on an already existing s3 bucket?
    b
    • 2
    • 3
  • g

    gray-fountain-32432

    11/04/2022, 5:20 PM
    Hi Guys, I am struggling to add route to an existing route table in pulumi-aws. I want to use func ec2.GetRouteTable. but I am not sure how to convert vpc.DefaultRouteTableId (created by vpc,default route table) to pulumi.IDInput. I want to create a VPC then add route to its default route table the full scenario is 1. create ec2 instance 2. create vpc 3. create igw 4. link igw to vpc 5. add default route in vpc main route table, point to route table
    func GetRouteTable(ctx *pulumi.Context,
    	name string, id pulumi.IDInput, state *RouteTableState, opts ...pulumi.ResourceOption) (*RouteTable, error) {
    	var resource RouteTable
    	err := ctx.ReadResource("aws:ec2/routeTable:RouteTable", name, id, state, &resource, opts...)
    	if err != nil {
    		return nil, err
    	}
    	return &resource, nil
    }
    • 1
    • 1
  • a

    abundant-agency-55117

    11/04/2022, 7:05 PM
    Does anyone have a simple working example of golang pulumi code that uses the [NS1 provider's NewRecord function](https://www.pulumi.com/registry/packages/ns1/api-docs/record/#create) that they would be willing to share? - I searched and was not able to find one. I can't quite wrap my head around how to construct the Answers and Filters inputs
    b
    • 2
    • 2
  • s

    swift-machine-98066

    11/04/2022, 10:00 PM
    does anyone know how to assocate a loggroup with a kms key after its created? I"m not seeing any functions around it
  • g

    gray-fountain-32432

    11/10/2022, 6:16 AM
    Hi Guys, Has anyone tried to start a aws serverless msk cluster? I found it is very hard to get the endpoints(getbrokernodes will not return the nodes). could you share some light?
    brokerNodes, err := msk.GetBrokerNodes(ctx, &msk.GetBrokerNodesArgs{
    		ClusterArn: cluster.Arn.ElementType().String(),
    	}, nil)
    f
    • 2
    • 3
  • j

    jolly-church-88521

    11/10/2022, 4:17 PM
    Hi - any idea how to force pulumi to depends on the EKS cluster when creating https://www.pulumi.com/registry/packages/aws-iam/api-docs/eksrole/ ? I already tried things like:
    }, pulumi.DependsOn([]pulumi.Resource{e.Cluster}))
    but somehow it doesn’t work. Any hit? 😞
    b
    g
    • 3
    • 17
  • c

    crooked-student-89656

    11/11/2022, 7:49 PM
    I’m following the tutorial from the website https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/kubernetes-go-helm-wordpress/ and I am continuously getting the error panic: interface conversion: interface {} is nil, not *v1.Service goroutine 78 [running]: main.main.func1.1({0x0?, 0x0?}) /Users/kurt/Documents/Programming/quickstart/main.go:36 +0x78 reflect.Value.call({0x1069b2920?, 0x10729ac88?, 0x1400013b108?}, {0x10606abd4, 0x4}, {0x14000980888, 0x1, 0x0?}) /opt/homebrew/Cellar/go/1.19.1/libexec/src/reflect/value.go:584 +0x688 reflect.Value.Call({0x1069b2920?, 0x10729ac88?, 0x10?}, {0x14000980888?, 0x14000400201?, 0x5000a?}) /opt/homebrew/Cellar/go/1.19.1/libexec/src/reflect/value.go:368 +0x90 github.com/pulumi/pulumi/sdk/v3/go/pulumi.makeContextful.func1({0x14000980870?, 0x4?, 0x4?}) /Users/kurt/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.43.1/go/pulumi/types.go:384 +0x58 reflect.Value.call({0x140000f2ae0?, 0x14000130de0?, 0x13?}, {0x10606abd4, 0x4}, {0x14000197f98, 0x2, 0x2?}) /opt/homebrew/Cellar/go/1.19.1/libexec/src/reflect/value.go:584 +0x688 reflect.Value.Call({0x140000f2ae0?, 0x14000130de0?, 0x140000760a0?}, {0x14000460798?, 0x0?, 0x0?}) /opt/homebrew/Cellar/go/1.19.1/libexec/src/reflect/value.go:368 +0x90 github.com/pulumi/pulumi/sdk/v3/go/pulumi.(*OutputState).ApplyTWithContext.func1() /Users/kurt/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.43.1/go/pulumi/types.go:505 +0x2a8 created by github.com/pulumi/pulumi/sdk/v3/go/pulumi.(*OutputState).ApplyTWithContext /Users/kurt/go/pkg/mod/github.com/pulumi/pulumi/sdk/v3@v3.43.1/go/pulumi/types.go:493 +0x380
    f
    • 2
    • 2
  • a

    aloof-tiger-61862

    11/13/2022, 1:37 PM
    hey! I am pretty new to Pulumi and im trying to create a SecurityGroup using golang, I can across a problem im sure you could help me figure out, one of the
    NetworkSecurityGroupArgs
    is
    SecurityRules
    which accepts
    SecurityRuleTypeArrayInput
    and Im not sure how to use it correctly (or at all). lets say I have
    []network.SecurityRule{}
    how do I make it of type
    SecurityRuleTypeArrayInput
    a
    b
    • 3
    • 2
Powered by Linen
Title
a

aloof-tiger-61862

11/13/2022, 1:37 PM
hey! I am pretty new to Pulumi and im trying to create a SecurityGroup using golang, I can across a problem im sure you could help me figure out, one of the
NetworkSecurityGroupArgs
is
SecurityRules
which accepts
SecurityRuleTypeArrayInput
and Im not sure how to use it correctly (or at all). lets say I have
[]network.SecurityRule{}
how do I make it of type
SecurityRuleTypeArrayInput
a

aloof-easter-15696

11/13/2022, 5:56 PM
I think you can use pulumi.tostringarray there
b

billowy-army-68599

11/13/2022, 7:35 PM
it would be
SecurityGroupRuleArray{
   SecurityGroupRule{}
}
View count: 3