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
general
  • f

    fancy-spoon-7206

    07/05/2022, 3:06 PM
    The stack state json looks like this
    "outputs": {
                            "privateSubnets": [
                                "subnet-0ef90f8900aa4e533",
                                "subnet-06e84b274ae517d39",
                                "subnet-01465b8f34f6490ee"
                            ],
                            "publicSubnets": [
                                "subnet-0c914a9aaec54e2a7",
                                "subnet-0893e2cfd9de09404",
                                "subnet-0216f9627f4fb20ef"
                            ],
                            "vpcId": "vpc-0f0e8a3ca9c7c8b41"
                        },
    My intention is to count the number of private/public subnets. The data type of outputs is
    map[string]interface{}
    .
    for _, res := range stack.Deployment.Resources {
    		privateSubnets := res.Outputs["privateSubnets"].(interface{})
    		log.Infoln(privateSubnets.([]string))
        }
    I would like to understand the type assertion to read through the values in the interface. Below is the error I get
    --- FAIL: TestInfrastructure (319.75s)
    panic: interface conversion: interface {} is []interface {}, not []string [recovered]
            panic: interface conversion: interface {} is []interface {}, not []string
  • g

    gentle-advantage-80069

    07/05/2022, 3:33 PM
    HI team, I need some help with the below issue:
    ➜   pulumi stack init test --secrets-provider="<gcpkms://projects/****/locations/global/keyRings/********/cryptoKeys/*****>"
    Created stack 'test'
    error: secrets (code=PermissionDenied): rpc error: code = PermissionDenied desc = Permission 'cloudkms.cryptoKeyVersions.useToEncrypt' denied on resource 'projects/prj-83923-s-orbit-8935/locations/global/keyRings/*****/cryptoKeys/******' (or it may not exist).
    ➜
    I created the KMS ring and key manually in the console, and added my email in the permissions with KMS admin, and using the same email with gcloud auth on cmd line. ------------------ Not sure what is missing, but i really need some help here fixing this, thanks.
    p
    b
    • 3
    • 2
  • a

    adamant-father-26302

    07/05/2022, 4:41 PM
    Is it possible to create a postgresql provider from the output of a aws rdsInstance? im struggling with this:
    pgqlProvider := postgresql.Endpoint.ApplyT(func(x string) (*pgql.Provider, error) {
    			host := strings.Split(x, ":")[0]
    			port, err := strconv.Atoi(strings.Split(x, ":")[1])
    			if err != nil {
    				return nil, err
    			}
    			return pgql.NewProvider(ctx, "psql", &pgql.ProviderArgs{
    				Database:  kratosDbName,
    				Username:  dbUsername,
    				Password:  password.Result,
    				Superuser: pulumi.Bool(true),
    				Host:      pulumi.String(host),
    				Port:      <http://pulumi.Int|pulumi.Int>(port),
    			})
    		})
    because this produces a
    pulumi.Output
    which
    does not implement pulumi.ResourceOption (missing applyResourceOption method)
  • g

    gentle-advantage-80069

    07/05/2022, 4:53 PM
    Hi, did anyone worked on mongodb-atlas provider in pulumi ? If yes, can someone please help with a working example for mongodbatlas.EncryptionAtRest , with GCP KMS ? this is in Python.
  • c

    cool-flower-46371

    07/05/2022, 4:58 PM
    Good afternoon! I'm looking for some help setting up SECRETS in an AWS ECS Task definition using the form
    [ { name: "SECRET", valueFrom: "<resource-arn>" }]
    where
    resource-arn
    is the pulumi Output from an
    aws.ssm.Parameter
    that I defined earlier in the code.
  • c

    cool-flower-46371

    07/05/2022, 4:59 PM
    Because the ssm.Parameter's
    arn
    value is a Pulumi output, it's not known/resolvable at the time that I'm trying to set up my ECS task def. As I'm working in typescript, I'm used to working with promises - but I'm not sure how I should change the structure of my code to indicate to Pulumi that the
    arn
    is an Output that will need to be resolved and passed to
    valueFrom
    .
  • c

    cool-flower-46371

    07/05/2022, 5:00 PM
    I am guessing that it has something to do with the
    stack
    , but I honestly am not understanding the difference between
    getOutput
    ,
    requireOutput
    , and
    requireOutputValue
    .
  • c

    cool-flower-46371

    07/05/2022, 5:00 PM
    Or if those are even valid invocations at the point in the code that I'd have to use them.
  • c

    cool-flower-46371

    07/05/2022, 5:02 PM
    Looking at it again... even more confusingly, the typescript typings suggest that it should work.
  • c

    cool-flower-46371

    07/05/2022, 5:02 PM
  • c

    cool-flower-46371

    07/05/2022, 5:03 PM
    And yet, in the output of pulumi up, it says this:
    "valueFrom":"Calling [toJSON] on an [Output<T>] is not supported.\n\nTo get the value of an Output as a JSON value or JSON string consider either:\n    1: o.apply(v => v.toJSON())\n    2: o.apply(v => JSON.stringify(v))\n\nSee <https://pulumi.io/help/outputs> for more details.\nThis function may throw in a future version of @pulumi/pulumi."}
  • c

    cool-flower-46371

    07/05/2022, 5:03 PM
    (And I've tried both of those)
  • c

    cool-flower-46371

    07/05/2022, 5:30 PM
    Looking at it a little further, trying to actually log the value of the
    arn
    in an
    apply
    call, I'm seeing the account-id portion of the ARN is either being obfuscated or masked as * - is that what is actually being passed into AWS and if so, then it would make sense why I'm getting an error about invalid characters in my ARN.
  • c

    cool-flower-46371

    07/05/2022, 5:42 PM
    And as suspected, if I just hardcode the ARN, it works. Little but stuck on where to go debugging the Output from here.
    b
    • 2
    • 18
  • g

    gorgeous-car-25108

    07/05/2022, 6:29 PM
    Hi, can we have multiple python files in pulumi project? Instead of just one main.py?
    b
    • 2
    • 2
  • c

    cool-flower-46371

    07/05/2022, 9:04 PM
    https://github.com/pulumi/pulumi-aws/issues/2017 Is there currently a known workaround to this?
  • c

    cool-flower-46371

    07/05/2022, 9:04 PM
    Needing to update the value of an AWS SSM Parameter causes this error during pulumi up.
  • c

    cool-flower-46371

    07/05/2022, 9:07 PM
    Even if I somehow have to delete and recreate the stack? looking for anything that will work at this point.
    l
    • 2
    • 9
  • b

    blue-leather-96987

    07/05/2022, 10:36 PM
    Is there a way to rename the logical name of a resource? The one registered in Pulumi?
    b
    • 2
    • 2
  • q

    quick-wolf-8403

    07/05/2022, 11:38 PM
    Folks, I'm looking for a way to move an existing GCP service into being managed by Pulumi without having to delete the service and let Pulumi (re) create it. The stack thinks it needs to create a new service for prod. When I tried it out with dev and stage, I deleted the old service and let Pulumi create it anew. But I'd rather not do that in prod. Is there a way to let Pulumi know something already exists and it should just take over managing and updating it?
    f
    • 2
    • 11
  • r

    rapid-raincoat-36492

    07/06/2022, 2:25 AM
    Does using a self-hosted backend affect the concurrency of deploying resources? The stacks I have on app.pulumi.com seem to update all resources in parallel that can be, but my stacks with an S3 backend seem to only update one resource at a time. Is that expected?
    b
    • 2
    • 8
  • l

    late-nest-59850

    07/06/2022, 7:58 AM
    Is there any way to avoid the
    k8s.helm.v3.Chart
    resource recreating/updating resources every time, even though nothing has changed? Eg. the
    ALB-intgress-controller
    deployed using the
    Chart
    resource recreates the tls-secret every time and updates the
    ALB-webhooks
    when nothing has changed in the actual pulumi declaration of the resource
    w
    • 2
    • 1
  • g

    great-breakfast-61299

    07/06/2022, 9:07 AM
    Hello, I am using : https://www.pulumi.com/registry/packages/kubernetes-ingress-nginx/ but I can't find a way to associate a loadbalancer IP or LoadBalancer separate service. This one is always a new one generated while I was able to specify it in a loadBalancer service. Is there's a way to use it instead of ingress-controler creates its own ?
    r
    • 2
    • 1
  • g

    gentle-advantage-80069

    07/06/2022, 9:14 AM
    Hi Folks, did anyone worked on mongodb atlas provider ? I am looking for examples for end-to-end setup or any example that could help. Please let me know if anyone has done any work on mongodb atlas, as am finding it hard to write codes for lot of stuff, for eg the below. is to enable encryption at rest, but there is no proper example and am new to this so unable to understand, any help would be highly appreciated , thanks. https://www.pulumi.com/registry/packages/mongodbatlas/api-docs/encryptionatrest/
  • p

    powerful-art-87860

    07/06/2022, 9:23 AM
    👋 Hi everyone!
    👋🏻 1
    b
    • 2
    • 1
  • c

    cuddly-ice-6853

    07/06/2022, 3:43 PM
    I want to install Vector helm charts on my K8s pods, but I am not able to pass provider for my below code
    vector = Chart('vector', ChartOpts(
        fetch_opts={'repo': '<https://helm.vector.dev>'},
        chart='vector'
    ))
    How to pass provider in python?. I have a custom provider code
    custom_provider = Provider(
        "inflation_provider", kubeconfig=kube_config
    )
    b
    • 2
    • 2
  • b

    blue-leather-96987

    07/06/2022, 3:55 PM
    Has anyone had an issue with setting up configuration keys? I add a single config using
    pulumi config set
    and then I get mysterious errors liek this with random resources that have no changes:
    error: could not validate provider configuration: 1 error occurred:
            * Invalid or unknown key
    b
    • 2
    • 10
  • m

    magnificent-helicopter-3467

    07/06/2022, 5:18 PM
    Hi team, I’m wondering what registering resource outputs for a pulumi component does. It’s not too clear to me from documentation whether this is cosmetic or necessary for a pulumi component to be functional. If we have a
    ctx.RegisterResourceOutputs(<component>, resourceOutputsMap)
    at the end of our component’s constructor but before the return, will this call ensure that all values in
    resourceOutputsMap
    resolve before proceeding? I don’t see anything visual during
    pulumi preview
    in
    Outputs
    when adding this call (just the usual exports). Any help in understanding this method would be appreciated, as I’m debating whether or not I should call it.
    b
    • 2
    • 7
  • g

    gorgeous-car-25108

    07/06/2022, 8:14 PM
    Hi, is there a way we can reference resources from one pulumi project to another? For eg, i have a pulumi folder for GCP network, with dev and stage stack. Now i want to create another folder for compute engine and reference the respective env from network pulumi project, how can i achieve this? Any sort of help is highly appreciated! Thanks
    w
    c
    • 3
    • 3
  • c

    crooked-laptop-67565

    07/06/2022, 8:54 PM
    I consistently get errors like this when running
    pulumi up
    on an EKS cluster that Pulumi created. Any suggestions?
    Diagnostics:
      kubernetes:core/v1:Secret (db-secret):
        error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get "<https://21D11CA8C29669F0B6B22DE0B70E2570.gr7.us-east-2.eks.amazonaws.com/openapi/v2?timeout=32s>": dial tcp: lookup <http://21D11CA8C29669F0B6B22DE0B70E2570.gr7.us-east-2.eks.amazonaws.com|21D11CA8C29669F0B6B22DE0B70E2570.gr7.us-east-2.eks.amazonaws.com> on 100.95.0.251:53: no such host
    
      aws:ecr:Repository (craig-test-repo):
        error: error reading from server: EOF
    
      pulumi:pulumi:Stack (apps-dev):
        assertion failed [inst.has_value()]: failed to decode instruction: 0x0
        (StateRecovery.cpp:355 determine_state_recovery_action_forward_branches)
Powered by Linen
Title
c

crooked-laptop-67565

07/06/2022, 8:54 PM
I consistently get errors like this when running
pulumi up
on an EKS cluster that Pulumi created. Any suggestions?
Diagnostics:
  kubernetes:core/v1:Secret (db-secret):
    error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get "<https://21D11CA8C29669F0B6B22DE0B70E2570.gr7.us-east-2.eks.amazonaws.com/openapi/v2?timeout=32s>": dial tcp: lookup <http://21D11CA8C29669F0B6B22DE0B70E2570.gr7.us-east-2.eks.amazonaws.com|21D11CA8C29669F0B6B22DE0B70E2570.gr7.us-east-2.eks.amazonaws.com> on 100.95.0.251:53: no such host

  aws:ecr:Repository (craig-test-repo):
    error: error reading from server: EOF

  pulumi:pulumi:Stack (apps-dev):
    assertion failed [inst.has_value()]: failed to decode instruction: 0x0
    (StateRecovery.cpp:355 determine_state_recovery_action_forward_branches)
View count: 1