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

    ripe-shampoo-80285

    04/15/2021, 2:36 AM
    How I specify Fargate in ClusterArgs parameter in the eks.NewCluster func? is there any examples?
  • w

    wide-crayon-4093

    04/15/2021, 3:29 AM
    what's a good way to replace template placeholders in yaml that I want to use in
    yaml.NewConfigFile
    ?
  • w

    wide-crayon-4093

    04/15/2021, 3:29 AM
    I can't convert some crds to pulumi bindings or don't need it, but i want to provision in from pulumi. sometimes I duplicate yamls with stack prefix, but I want to find a better way
  • r

    ripe-shampoo-80285

    04/16/2021, 12:14 AM
    Can we use Golang to create a lambda function with inline handlers in other languages such as TypeScript or Python? Moreover, TypeScript has this capability. Can we do something similar in Golang?
    b
    w
    • 3
    • 4
  • r

    ripe-shampoo-80285

    04/16/2021, 12:14 AM
    Untitled
  • r

    ripe-shampoo-80285

    04/16/2021, 12:15 AM
    Here a lambda is created inline with TS, plus, we can setup a trigger on object creation on a bucket.
  • p

    polite-motherboard-78438

    04/18/2021, 10:01 PM
    Hello. I am trying to create a Network subnet with the Hetzner provider but I am having trouble passing an output from a resource as an input to another resource. I know I have to use Apply, but no idea how. Here is my code:
    network, err := hcloud.NewNetwork(ctx, "internal", &hcloud.NetworkArgs{
    		IpRange: pulumi.String("10.0.1.0/24"),
    	})
    	if err != nil {
    		return err
    	}
    
    	_, err = hcloud.NewNetworkSubnet(ctx, "default", &hcloud.NetworkSubnetArgs{
    		NetworkId:   network.ID(),
    		Type:        pulumi.String("cloud"),
    		NetworkZone: pulumi.String("eu-central"),
    		IpRange:     pulumi.String("10.0.1.0/24"),
    	})
    	if err != nil {
    		return err
    	}
    The NetworkID is of type
    pulumi.IntInput
    while the network.ID() returns a
    pulumi.IDOutput
    I need to pass the network.ID() as the
    NetworkId
    on the subnet. With this I get C`annot use 'network.ID()' (type IDOutput) as type pulumi.IntInput` I tried to do something like this, but I am getting into a mental loop and no ideia how to convert the value:
    NetworkId:   network.ID().ApplyInt(func(i pulumi.IDOutput) (pulumi.IntInput, error) {
    			return i // WHAT TO DO HERE
    		}),
    How can I get this working? If there is one thing I have trouble is this Apply stuff. Btw, this example is from the Hetzner provider documentation: https://www.pulumi.com/docs/reference/pkg/hcloud/servernetwork/ which means the documentation is wrong. I can make a PR, if someone kindly help me with this. Thank you!
  • s

    stocky-morning-21061

    04/20/2021, 7:02 AM
    Hi, I try to read exports from one established stack and try ot reuse it in another one. reading the exported output and reusing them worked well. On the next iteration I tried to shape a type around those output values by resolving the outputs, assign those to fields in the new type and return it as a pulumi.Output with the following snippet:
    func getBaseReferences(ctx *pulumi.Context) (pulumi.Output, error) {
    	fmt.Println("base stack output")
    	baseStack, err := pulumi.NewStackReference(ctx, "base", nil)
    	if err != nil {
    		return nil, err
    	}
    
    	vpcID := baseStack.GetStringOutput(pulumi.String("vpc"))
    	if err != nil {
    		return nil, err
    	}
    
    	publicSubnets := baseStack.GetOutput(pulumi.String("publicSubnets"))
    	if err != nil {
    		return nil, err
    	}
    
    	privateSubnets := baseStack.GetOutput(pulumi.String("privateSubnets"))
    	if err != nil {
    		return nil, err
    	}
    
      result := pulumi.All(vpcID, publicSubnets, privateSubnets).ApplyT(func(args []interface{}) (*Vpc, error) {
    		vpc := args[0].(string)
    		publicSubnets := args[1].([]interface{})
    		privateSubnets := args[2].([]interface{})
    		priv := convert(privateSubnets)
    		pub := convert(publicSubnets)
    
    		return &Vpc{VpcID: vpc, Subnets: Subnets{Public: pub, Private: priv}}, nil
    	})
    	return result, nil
    }
    The pulumi.All part does not seem to get invoked. What am I missing here?
  • k

    kind-airport-89906

    04/21/2021, 2:41 PM
    Crossposting here for extra visibilty
  • k

    kind-airport-89906

    04/21/2021, 8:29 PM
    How would I go about accessing the Name of an EKS cluster created with the EKS pulumi module? I’ve tried accessing it out of the
    cluster.Core.Cluster.Name
    and with
    cluster.EksCluster.Name
    and i keep getting errors like the following:
    ./main.go:94:38: cluster.EksCluster.Name undefined (type "<http://github.com/pulumi/pulumi-aws/sdk/v4/go/aws/eks|github.com/pulumi/pulumi-aws/sdk/v4/go/aws/eks>".ClusterOutput has no field or method Name)
  • b

    busy-soccer-65968

    04/21/2021, 10:35 PM
    is this not thread safe? https://github.com/pulumi/pulumi/blob/master/sdk/go/auto/stack.go#L467. I'm basically trying to delete a lot of stacks at once using goroutines. however when I run this in goroutines I get
    failed to destroy stack: code: 255
    , stdout: 
    , stderr: error: invalid character 'r' after top-level value
    the character is different, but the error is always the same
    • 1
    • 3
  • w

    wide-crayon-4093

    04/22/2021, 9:26 AM
    is it possible to map structured configs to a struct with
    pulumi.StringPtrInput
    etc values? https://www.pulumi.com/docs/intro/concepts/config/#structured-configuration i.e I want to bypass manual remapping of structured configs to pulumi provider ResourceArgs
  • w

    wide-crayon-4093

    04/22/2021, 9:28 AM
    e.g instead of
    type ConfigResource struct {
      section ConfigResourceSection
    }
    
    type ConfigResourceSection struct {
      field string
    }
    have
    type ConfigResource struct {
      section ConfigResourceSection // or SomeSpecArgs
    }
    
    type ConfigResourceSection struct {
      field pulumi.StringInput
    }
    b
    • 2
    • 2
  • r

    ripe-shampoo-80285

    05/03/2021, 8:20 PM
    I am trying to setup a BucketNotification to invoke a lambda on object creation. I am getting this error: error putting S3 Bucket Notification Configuration: InvalidArgument: Unable to validate the following destination configurations From what I have read so far, it could because the bucket doesn't have permission to invoke lambda. How do I give this permission via Pulumi golang. My bucket is imported from an existing bucket created outside of pulumi.
    • 1
    • 1
  • a

    acoustic-iron-92969

    05/07/2021, 6:02 PM
    hey folks - I'm trying to wrap
    pulumi.RunErr
    directly in my code instead of using the pulumi CLI, but I'm running into
    missing resource monitor RPC address
    . does anyone know where these default values are configured in the CLI?
    s
    • 2
    • 3
  • r

    ripe-shampoo-80285

    05/14/2021, 1:08 AM
    Hi, does anybody know how to create a VPC with both private and public subnets in Pulumi golang?
    b
    • 2
    • 2
  • r

    ripe-shampoo-80285

    05/14/2021, 1:09 AM
    In TypeScript this is how you do it:
  • r

    ripe-shampoo-80285

    05/14/2021, 1:09 AM
    Untitled
  • r

    ripe-shampoo-80285

    05/14/2021, 1:09 AM
    Not sure how to do this in Golang
  • r

    ripe-shampoo-80285

    05/15/2021, 5:58 PM
    Has any run into compatibility between pulumi golang aws sdk v4/pulumi v3 and pulumi-eks? The follow code snippte used to work fine, but it doesn't work any more after I upgraded the pulumi aws to v4 and pulumi to v3.
  • r

    ripe-shampoo-80285

    05/15/2021, 5:58 PM
    Untitled.txt
    b
    • 2
    • 8
  • r

    ripe-shampoo-80285

    05/17/2021, 2:45 AM
    undefined CFTypeLoggingConfig error
  • r

    ripe-shampoo-80285

    05/17/2021, 2:46 AM
    I got the above error while doing a pulumi preview. error: an unhandled error occurred: program exited with non-zero exit code: 2
  • r

    ripe-shampoo-80285

    05/17/2021, 2:48 AM
    Anybody had this issue? This happened when I was trying to create EKS cluster.
  • r

    ripe-shampoo-80285

    05/17/2021, 1:10 PM
    @billowy-army-68599 wondering if this is caused by missing some types (you mentioned earlier that some types are removed). Do we know which specific version those types are removed? Has anybody able to create EKS with golang pulumi-eks or pulumi-aws in v4@4.3.1?
  • r

    ripe-shampoo-80285

    05/17/2021, 5:24 PM
    I filed a pulumi ticket for the above problem. It is a blocking issue for us (unless we downgrade to pulumi 2.0). https://github.com/pulumi/pulumi/issues/7073
  • r

    ripe-shampoo-80285

    05/18/2021, 2:58 AM
    @billowy-army-68599 Thanks to Paul for fixing the above ticket. Now I am getting another error: pulumi😛roviders:eks (default): error: no resource plugin 'eks-v0.30.0' found in the workspace or on your $PATH, install the plugin using
    pulumi plugin install resource eks v0.30.0
    This is kind of strange, I never need to do this before. Any idea?
  • b

    billowy-army-68599

    05/18/2021, 3:00 AM
    pulumi plugin install eks v0.30.0
    should fix that
  • b

    billowy-army-68599

    05/18/2021, 3:00 AM
    it means your new version isn't installed
  • r

    ripe-shampoo-80285

    05/18/2021, 3:04 AM
    That did work for me because I don't have node/npm installed. I just installed node/npm, and retried and it indeed fixed the issue. Thanks @billowy-army-68599! Just curious, why I don't need to do that before for the old version?
Powered by Linen
Title
r

ripe-shampoo-80285

05/18/2021, 3:04 AM
That did work for me because I don't have node/npm installed. I just installed node/npm, and retried and it indeed fixed the issue. Thanks @billowy-army-68599! Just curious, why I don't need to do that before for the old version?
View count: 3