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

    hallowed-author-21638

    03/09/2021, 12:58 PM
    Hey all I'm trying to compile and run a static Go binary though it's exiting with error
    error: program failed: missing project name
    the project name is defined in Pulumi.yaml correct? I'm mostly trying to step through my code atm to understand my output values a bit better
    g
    s
    • 3
    • 6
  • s

    sticky-bear-14421

    03/10/2021, 1:43 PM
    When running
    pulumi up
    against the aws api the credentials are taken from my environment, which is perfectly fine. Now I have to switch into a different iam role in my code to manage different resources. In terraform I know how to define an aliased second or third aws provider to manage resources. Im looking for an example on how to do this using pulumi. Do you know of any examples that does this without splitting the code into two different projects?
    l
    • 2
    • 6
  • a

    average-plastic-1763

    03/16/2021, 2:31 PM
    Hi all, I'm trying to update plugin versions for a go based pulumi program, but when updating the plugin dependencies and building the go binary, then executing
    pulumi preview
    , it still goes to download the older versions of the plugins that were used for the stack before. Is there anything else I need to do to update the stack to use the newer plugin versions?
    l
    • 2
    • 2
  • b

    big-state-95297

    03/18/2021, 4:51 PM
    Hi there - Can someone from the Pulumi team take a look at https://github.com/pulumi/pulumi-eks/issues/537? I'm happy to contribute a patch if we can establish this is a bug and get some guidance on the fix.
    m
    • 2
    • 1
  • h

    hallowed-author-21638

    03/19/2021, 5:20 PM
    Hey there, Does anyone have an example of using a digitalocean firewall from the droplet IDs created right before it? I'm having a hard time lifting my IDs output from droplet creation tf2pulumi crashes
  • w

    white-balloon-205

    03/21/2021, 5:43 AM
    We've heard a lot of feedback on the large binary sizes (and slow build times and high memory requirements for build) for typical Pulumi Go programs. We have done a deep dive on the design patterns in our SDK that lead to the large size, and identified a few key things we can do to decrease the size - see https://github.com/pulumi/pulumi/issues/6591 if you are interested in the gory details. As a result of this analysis, there is one fairly small change we could make which would have a dramatic impact on binary sizes, reducing typical binary sizes by 70-80%. That is to remove the
    Apply<TypeName>
    methods, encouraging use of
    ApplyT
    directly instead (the former is a light syntactic sugar over the latter). This would be a breaking change (though with a fairly mechanical change to update code to continue working the same), and we would expect to make it in the upcoming 3.0 release if we decide to take this change. See https://github.com/pulumi/pulumi/issues/6592 for details. We would love any feedback/input from this group on the idea of making this change. Please take a look at the issue and provide any input you have there!
    👌 5
    c
    w
    • 3
    • 3
  • a

    adorable-alligator-23779

    03/22/2021, 3:23 PM
    Hey all. i’m trying to make a small CLI that will deploy to k8s using pulumi. i keep getting
    error: no resource plugin 'kubernetes' found in the workspace or on your $PATH
    any ideas?
  • a

    adorable-alligator-23779

    03/22/2021, 3:24 PM
    im trying to use the automixzation api described here: The Pulumi Automation API - The Next Quantum Leap in IaC | Pulumi and code from Deploy Kubernetes and Applications with Go | Pulumi
  • a

    adorable-alligator-23779

    03/22/2021, 3:24 PM
    i use `auto.NewStackInlineSource`and feed it with a pulumi.RunFunc where i do all the pulumi “magic”
  • a

    adorable-alligator-23779

    03/22/2021, 3:32 PM
    Plugin is installed btw:
    pulumi plugin ls
    NAME        KIND      VERSION  SIZE    INSTALLED       LAST USED
    aws         resource  3.26.1   260 MB  5 days ago      5 days ago
    kubernetes  resource  2.8.3    67 MB   10 minutes ago  10 minutes ago
  • a

    adorable-alligator-23779

    03/22/2021, 3:49 PM
    code here: https://play.golang.org/p/7W_wD62qf2j
    l
    • 2
    • 6
  • m

    microscopic-agent-70604

    03/23/2021, 11:50 AM
    Hi. I've updated pulumi-aws go module to the latest version and got an error and I do not understand where to dig. As I understood, terraform aws provider was updated and now we can use some additional parameters in the provider, but we do not create AWS provider explicitly in the code. It is created automatically and is used as a default.
    error: program failed: 1 error occurred:
            * rpc error: code = Unknown desc = invocation of aws:ec2/getVpc:getVpc returned an error: could not validate provider configuration: 9 errors occurred:
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
            * Invalid or unknown key
        exit status 1
    Could anybody please give a hint where to go?
    ✅ 1
    👍 1
    g
    • 2
    • 5
  • b

    bored-car-38257

    03/23/2021, 4:08 PM
    Hi Am trying to Dockerize
    pulumi golang
    project …. ended up getting this error ..
    go build <http://github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/compute|github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/compute>: /usr/local/go/pkg/tool/linux_amd64/compile: signal: killed
    My machine is a mac — and the image am trying to build is as below
    FROM golang:1.16.2-alpine3.13
    
    ENV PATH=$PATH:/root/.pulumi/bin
    
    RUN apk update && \
        apk add --no-cache bash curl libc6-compat && \
        curl -fsSL <https://get.pulumi.com> | sh
    After this i copy the project and run
    pulumi
    commands — login is successful to gcs state .
    g
    b
    • 3
    • 14
  • w

    wide-crayon-4093

    03/27/2021, 8:57 AM
    are there any good options for generating
    .htpasswd
    credential secrets from golang runtime? tricky part is it's not deterministic and hash is always different
    c
    • 2
    • 2
  • e

    eager-branch-34449

    03/27/2021, 3:37 PM
    Hey, quick question, how do I get a
    pulumi.String
    from a
    pulumi.StringOutput
    ? (get the value of
    pulumi.StringOutput
    which is private) I’m trying to put together a policy statement with functions and the
    pulumi.StringOutput
    is giving me a headache.
    c
    • 2
    • 2
  • q

    quiet-lock-69596

    03/28/2021, 2:56 PM
    Hey, I’m quite new to Go and Pulumi. So this is prolly a quite easy question. I’ve been looking into both https://github.com/pulumi/automation-api-examples/blob/main/go/local_program/fargate/main.go and https://www.pulumi.com/docs/reference/pkg/aws/ecs/taskdefinition/#inputs and https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html but I seem to fail miserable anyhow. I’m trying to apply some environment variables and secrets to my container. But I end up getting the following error:
    error: aws:ecs/taskDefinition:TaskDefinition resource 'api-task' has a problem: ECS Task Definition container_definitions is invalid: Error decoding JSON: json: cannot unmarshal number into Go struct field KeyValuePair.Environment.Value of type string. Examine values at 'TaskDefinition.ContainerDefinitions'.
    So to my understanding is that my type conversion is wrong in some way. Can anybody maybe point me in the right direction or to some example covering how to add the variables. Snippet of my code:
    tmpContainerDef, err := json.Marshal([]map[string]interface{}{
    			{
    				"name":      pulumi.Sprintf("%q", image.ImageName),
    				"image":     pulumi.Sprintf("%q", image),
    				"cpu":       256,
    				"memory":    512,
    				"portMappings": []map[string]interface{}{
    					{
    						"containerPort": 8888,
    					},
    				},
    				"environment": []map[string]interface{}{
    					{
    						"name": "APP_ENV",
    						"value": "prod",
    					},
    					{
    						"name": "API_PORT",
    						"value": 8888,
    					},
    					{
    						"name": "DB_DRIVER",
    						"value": "postgres",
    					},
    					{
    						"name": "DB_HOST",
    						"value": pulumi.Sprintf("%q", dbCluster.Endpoint),
    					},
    					{
    						"name": "DB_NAME",
    						"value": pulumi.Sprintf("%q", dbCluster.DatabaseName),
    					},
    					{
    						"name": "DB_USER",
    						"value": pulumi.Sprintf("%q", dbCluster.MasterUsername),
    					},
    					{
    						"name": "DB_PORT",
    						"value": pulumi.Sprintf("%d", dbCluster.Port),
    					},
    				},
    				"secret": []map[string]interface{}{
    					{
    						"name": "API_SECRET",
    						"valueFrom": pulumi.Sprintf("%q", apiSecret.Arn),
    					},
    					{
    						"name": "DB_PASSWORD",
    						"valueFrom": pulumi.Sprintf("%q", dbSecret.Arn),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    b
    • 2
    • 4
  • s

    steep-florist-33509

    03/29/2021, 6:28 PM
    Hey, I have this block to get the IP address of the loadbalancer:
    loadBalancerIP := chart.GetResource("extensions/v1beta1/Ingress", "server", "default").
    	ApplyT(func(input interface{}) pulumi.StringOutput {
    		ingress := input.(*v1beta1.Ingress)
    		return ingress.Status.LoadBalancer().Ingress().Index(<http://pulumi.Int|pulumi.Int>(0)).Ip().Elem()
    	})
    
    ctx.Export("loadBalancerIP", loadBalancerIP)
    The IP shows as expected from the
    Export
    but I want to use the IP in a DNS record:
    _, err = dns.NewRecordSet(ctx, "serverRecordSet", &dns.RecordSetArgs{
      Rrdatas: pulumi.StringArray{loadBalancerIP},
      [snip]
    loadBalancerIP is of type
    pulumi.Output
    , not
    pulumi.StringOutput
    so it isn’t accepted. Anybody have a hint on how I can handle the conversion?
    ✅ 1
    b
    w
    g
    • 4
    • 5
  • m

    microscopic-agent-70604

    04/03/2021, 7:17 PM
    Hello. We install EKS cluster. Then install flux and then install ingress-controller with custom resources of flux. Then in the pulumi code we need dependency on the created ingress controller service to • Wait for it to be created • Get its Loadbalancer hostname. Waiting is not a problem but getting of the LB hostname is. Options that we have: • Create applier function and get k8s service directly from k8s with golang k8s libs. But unfortunately this applier doesn't wait for the created resources or anything and starts execution during pulumi preview and it fails because it can't find it. • Use native pulumi GetService https://pkg.go.dev/github.com/pulumi/pulumi-kubernetes/sdk/v2/go/kubernetes/core/v1#GetService. But it fails on preview step as well. It just can't find it. Earlier we used getting hostname from chart resources like this
    func GetIngressNginxServiceStatus(ingressControllerChartResources pulumi.Output) pulumi.Output {
    	ingressServiceStatus := ingressControllerChartResources.ApplyT(func(arg interface{}) corev1.ServiceStatusPtrOutput {
    
    		x := arg.(map[string]pulumi.Resource)
    		return x["v1/Service::ingress-nginx/ingress-nginx-controller"].(*corev1.Service).Status
    	})
    	return ingressServiceStatus
    }
    But currently we use flux for our initial deployment and want to use it for ingress-controller as well. So the question. How to make GetService or applier wait for other resources and do not be executed on pulumi preview? Earlier I used ctx.DryRun() to exclude some stuff from the preview, but here this hostname is used in other further code and I can't just miss this code
    if !ctx.DryRun() {...}
  • s

    sticky-bear-14421

    04/12/2021, 7:33 AM
    Good morning, Im having trouble parsing an item from the config:
    pulumi config set adminRole "foobar"
    My code has a string variable defined I will load the value into ..
    var adminRole string
    conf := config.New(ctx, "")
    conf.RequireObject("adminRole", &adminRole)
    But, running pulumi up fails with an error I fail to understand:
    panic: fatal: A failure has occurred: unable to unmarshall required configuration variable 'my_project:adminRole'; invalid character 'o' in literal false (expecting 'a')
    l
    • 2
    • 5
  • w

    wide-crayon-4093

    04/13/2021, 9:00 AM
    is it possible to pull the k8s secret data from pulumi? i couldn't find any examples for how I can do Apply manipulation and get map[string]string from StringMapOutput. e.g I created a secret with type
    "<http://kubernetes.io/service-account-token|kubernetes.io/service-account-token>"
    , and now want to grab the certificate and token
    w
    • 2
    • 2
  • r

    ripe-shampoo-80285

    04/14/2021, 11:34 PM
    Hi has any body here used the pulumi-eks to create eks cluster. I am trying to run the following example code failed.
  • r

    ripe-shampoo-80285

    04/14/2021, 11:35 PM
    Untitled
  • r

    ripe-shampoo-80285

    04/14/2021, 11:35 PM
    Untitled
  • r

    ripe-shampoo-80285

    04/14/2021, 11:36 PM
    It complains about " no resource plugin 'eks-v0.23.0' found in the workspace"
  • r

    ripe-shampoo-80285

    04/14/2021, 11:49 PM
    I found out the answer. It looks like I need to have nodejs installed.
  • r

    ripe-shampoo-80285

    04/14/2021, 11:50 PM
    Still not happy with the following error
  • r

    ripe-shampoo-80285

    04/14/2021, 11:50 PM
    Untitled
  • r

    ripe-shampoo-80285

    04/14/2021, 11:52 PM
    What does the error actually mean?
    b
    • 2
    • 2
  • r

    ripe-shampoo-80285

    04/14/2021, 11:52 PM
    Error: providerCredentialOpts and AWS config setting aws:profile must be set together: Error: providerCredentialOpts and AWS config setting aws:profile must be set together
  • r

    ripe-shampoo-80285

    04/15/2021, 2:34 AM
    Anybody know if we can use pulumi-eks to create eks cluster with both node-group and fargate profile support?
Powered by Linen
Title
r

ripe-shampoo-80285

04/15/2021, 2:34 AM
Anybody know if we can use pulumi-eks to create eks cluster with both node-group and fargate profile support?
View count: 3