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

    clever-plumber-29709

    07/17/2020, 8:29 PM
    Hey guys, checking the docs, i saw some python examples have an extra
    ;
    i.e: https://www.pulumi.com/docs/reference/pkg/github/branchprotection/ (and i think lots of others are the same) Checking on the source (https://github.com/pulumi/docs/blob/d1d22789dad6609d4a7336a9d41568a14a5064be/content/docs/reference/pkg/github/branchprotection.md) seems like this are generated by a bot? I was going to try and open PR fixing this, but not sure if is a problem in the automation somewhere, of if I should open the PR
    m
    • 2
    • 2
  • f

    famous-garage-15683

    07/17/2020, 10:25 PM
    I'm trying
    const vpc = new awsx.ec2.Vpc("custom");
    from the docs, but it doesn't work
  • f

    famous-garage-15683

    07/17/2020, 10:25 PM
    index.ts(5,13): error TS2554: Expected 2-3 arguments, but got 1.
  • f

    famous-garage-15683

    07/17/2020, 10:39 PM
    I got past it by passing a second
    {}
    arg, but it seems like a bug
    l
    • 2
    • 2
  • r

    rich-breakfast-87724

    07/18/2020, 12:18 AM
    I'm trying to set a "onPut" event trigger for a bucket using python, but I couldn't find any method like the one for Nodejs, also I've looked in the docs but couldn't find this info. Does someone know how to accomplish this? (I'm looking at this example)
    f
    g
    • 3
    • 6
  • b

    billowy-laptop-45963

    07/18/2020, 12:21 AM
    Is there an equivalent to terraforms template_cloudinit_config?
    b
    • 2
    • 3
  • s

    silly-train-98536

    07/18/2020, 3:54 AM
    hi, was trying out pulumi today. curious to know where does pulumi maintain the current state of a given project/stack?
    b
    • 2
    • 5
  • a

    acceptable-stone-35112

    07/18/2020, 8:56 AM
    when using 3rd party npm inside lambda that doesn't have typings via require("") it's not recognized as dependency in serialized lambda function. Is that expected behavior? Should I generate typings for such modules or add them explicitly as lambda layer?
  • t

    thousands-train-20124

    07/18/2020, 12:05 PM
    Just a suggestion, if you use pulumi.interpolate in a string concatenation operation along with a normal string it produces undesired result and can be very hard to debug like the image below. The documentation is not clear enough and for someone like me who is new to pulumi it can become a real pain. So pulumi.interpolate should either throw an error is used in the incorrect way or the documentation should have a note mentioning this very clearly. I hope I have not missed any part of the documentation.
    b
    • 2
    • 3
  • t

    thousands-train-20124

    07/18/2020, 12:06 PM
  • a

    acceptable-stone-35112

    07/18/2020, 4:15 PM
    on every stack update my CloudFront distribution gets updated. [diff: ~defaultCacheBehavior] appears on every pulumi run without changing any code
    defaultCacheBehavior.js
    b
    • 2
    • 16
  • r

    rich-breakfast-87724

    07/19/2020, 11:19 PM
    Should I always use "pulumi.concat()" when using string resources gotten from the cloud? For example, if I get a bucket name from SSM and want to create a bucket with that name:
    const aws = require("@pulumi/aws");
    
    const pictures_bucket_name: String = aws.ssm.getParameter("pictures_bucket")
    
    const pictures_bucket = new aws.s3.Bucket(pictures_bucket_name+"_resource", {
        bucket: pictures_bucket_name
    })
    So, in the 'name' parameter of the bucket should I use 'pulumi.concat(pictures_bucket_name, "_resource")' or just that native string concatenation is ok? Update: I think I got it, but if someone could provide a validation to way I'm saying I would appreciate: Output objects HAS to be used when I retrieve resources from the cloud and they might be automatically created by some method that returns Output objects of a given resource or I might have to wrap values by hand in an Output object (using
    pulumi.output()
    ), but there are two main moments in which I will use these values wrapped by an Output object: "deploy-time" and runtime. If I want to manipulate the value wrapped by the Output object during deploy-time, when things may not be yet defined and values may not exist yet, then I must use a Promise-like approach with
    Output<T>.apply(f: T -> G)
    and all resource-method parameters will accept this transformed Output as a valid argument. Or, in some cases (like native Pulumi classes) I may skip the
    apply()
    step and just retrieve the expected value with
    Output<T>.some_attribute
    . If I want to use the value wrapped by the Output object during runtime, then I must call the
    Output<T>.get()
    method to retrieve the actual
    Object<T>
    . Sorry if the question is not well formulated or seems like lack of effort in finding documentation, I've read a lot of it but I'm missing use cases and examples.
    👍 2
  • r

    rich-engineer-35554

    07/20/2020, 3:33 AM
    just out of curiosity, has Pulumi grown any better support for bare metal deployment? amusingly when I Google "pulumi bare metal" the first result is my Hacker News comment on the initial release lamenting the lack of bare metal support 🙂
  • r

    rich-breakfast-87724

    07/20/2020, 6:00 AM
    Guys, I'm using typescript to build a simple bucket with a trigger on it, that calls a "magic lambda" and puts a thumbnail in another bucket, but every time the lambda fails and the output in the CloudWatch logs show this error:
    {
      "errorType": "Runtime.ImportModuleError",
      "errorMessage": "Error: Cannot find module '@pulumi/aws/s3/index.js'\nRequire stack:\n- /var/task/__index.js\n- /var/runtime/UserFunction.js\n- /var/runtime/index.js",
      "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module '@pulumi/aws/s3/index.js'",
        "Require stack:",
        "- /var/task/__index.js",
        "- /var/runtime/UserFunction.js",
        "- /var/runtime/index.js",
        "    at _loadUserApp (/var/runtime/UserFunction.js:100:13)",
        "    at Object.module.exports.load (/var/runtime/UserFunction.js:140:17)",
        "    at Object.<anonymous> (/var/runtime/index.js:43:30)",
        "    at Module._compile (internal/modules/cjs/loader.js:1133:30)",
        "    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1153:10)",
        "    at Module.load (internal/modules/cjs/loader.js:977:32)",
        "    at Function.Module._load (internal/modules/cjs/loader.js:877:14)",
        "    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)",
        "    at internal/main/run_main_module.js:18:47"
      ]
    }
    The code is the one in the snippet.
    bucket_snippet_txt.ts
    • 1
    • 1
  • b

    big-ability-1913

    07/20/2020, 7:56 AM
    I tried to import current users on azuread to pulumi, but it not working well. Please let me know how to import existing user using userPrinciaplName.
  • r

    refined-teacher-35628

    07/20/2020, 8:28 AM
    Any suggestion please https://pulumi-community.slack.com/archives/CRH5ENVDX/p1595139362435200
  • s

    stocky-lion-56153

    07/20/2020, 10:25 AM
    Hi, does anyone have any tips for locking down the permissions needed for a Pulumi program? At the moment I get it working in a dev environment using a role that had broad permissions and then iterate on a new user or role with limited permissions in dev and then production. It’s a slow and painful process that I would like to optimise. I’m AWS but I guess the same problem comes up all clouds.
    c
    • 2
    • 6
  • w

    wooden-branch-26004

    07/20/2020, 11:59 AM
    Hello! Azure question. I want to attach ACR repository to a new AKS cluster. I can do that via
    cli
    using
    --attach-acr <acr_name>
    (ex.
    az aks ... create --attach-acr <acr_name>
    ) . How can I do the same via Pulumi? I haven't found anything related to it in
    KubernetesCluster
    or
    KubernetesClusterArgs
    . Thanks!
  • i

    incalculable-engineer-92975

    07/20/2020, 2:47 PM
    any way to get clearer output for diffs? we'd love for something much more user-readable and comprehensible for reviewers and auditors to look through
    b
    w
    • 3
    • 6
  • v

    victorious-gigabyte-4729

    07/20/2020, 7:31 PM
    Is there a reason to not run a 
    pulumi refresh
     before a
    pulumi up
    ?
    m
    c
    h
    • 4
    • 5
  • g

    gray-jewelry-3360

    07/20/2020, 8:07 PM
    Hi Team, I'm having issues while pulumi up with the auto generated requirements.txt file, can you please provide solution for this: pulumi😛ulumi:Stack (Pulumi-latest-dev):     error: an unhandled error occurred: Program exited with non-zero exit code: 3221225781 Installing dependencies... error: installing dependencies via `pip install -r requirements.txt`: exit status 3221225781
    b
    • 2
    • 14
  • q

    quiet-wolf-18467

    07/20/2020, 8:26 PM
    Can we get a channel for the Packet provider? 😀
  • d

    dazzling-analyst-17846

    07/20/2020, 10:34 PM
    Hi guys, hope everyone is doing well. I'm having stack ls issues while running pulumi (v2.1.6) on windows and using local login (pulumi login --local). Behavior seems to be pretty similar to the one described on this bug: https://github.com/pulumi/pulumi/pull/4094. Is that fix already integrated into 2.1.6? Or should I run a different version. Or what kind of workaround do you suggest?
    • 1
    • 1
  • w

    wooden-branch-26004

    07/21/2020, 9:40 AM
    Is there a way to output cli commands which Pulumi sends to a given cloud provider? I want to see which commands are issued to Azure when I do
    pulumi up
    . Thanks!
    w
    • 2
    • 2
  • a

    acceptable-church-17686

    07/21/2020, 9:42 AM
    Hi all - I am looking to get started and evaluate Pulumi for a new project. I do not have competency in any of the supported languages and would like to use Rust as my language of choice. While it's straight forward enough to generate code from the protobuf definitions for the sdk, what is unclear to me is how to go about applying this to my cloud provider of choice (GCP). Is it possible to generate something like pulumi-gcp for Rust? Any pointers/suggestions on how to go about doing this? Many thanks in advance! Alex
    w
    • 2
    • 4
  • c

    calm-pizza-15027

    07/21/2020, 7:11 PM
    Has anyone been able to attach a service account as volume on gcp kub
    export const secertKub = new k8s.core.v1.Secret("k8ssecert",{data:{
      "key.json": serviceAccountKey.privateKey,
    }, metadata:{name:"runtimekey"},apiVersion: "v1", kind:"Secret" },{provider:clusterProvider})
    
    
    
    
    
    const deployment = new k8s.apps.v1.Deployment(name_c,
        {
            metadata: {
                namespace: namespaceName,
                labels: appLabels,
            },
            spec: {
                replicas: 1,
                selector: { matchLabels: appLabels },
                template: {
                    metadata: {
                      
                        labels: appLabels,
                    },
                    spec: {   
                        volumes:[{name:"runtimekey",secret: {secretName:secertKub.metadata.name}}],
                        serviceAccountName:serviceAccountName,
                        containers: [
                            {
                              env:[{name:"GOOGLE_APPLICATION_CREDENTIALS",value:myProject.projectId},{name:"GOOGLE_CLOUD_PROJECT",value:myProject.projectId},{name:"ENVIRONMENT_TYPE",value:"LOCAL_DEVELOPMENT"}],
                                name: "my-app",
                                image:  dockerCfServices.imageName,
                                ports: [{ name: "http", containerPort: 8080 }],
                                volumeMounts:[{
                                  name:"runtimekey",
                                  mountPath: "/var/secrets/google"
                                }],
                                
                            },
                        ],
                    },
                },
            },
        },
        {
            provider: clusterProvider,
        },
    );
    b
    g
    c
    • 4
    • 11
  • c

    calm-pizza-15027

    07/21/2020, 7:12 PM
    If anyone could help me i am willing to pay!
  • c

    cool-egg-852

    07/21/2020, 9:01 PM
    Not being able to use
    Output
    as part of a resource name is starting to become extremely irritating. Are there no plans to make this possible? Using a StackReference, I have an array of resources (in this case GKE clusters). I need to loop over this and create resources for each one. But I can’t use anything from this because I can’t use an
    Output<string>
    as a
    string
    .
    f
    g
    • 3
    • 19
  • b

    bright-restaurant-97414

    07/21/2020, 9:49 PM
    When you run
    make build
    in a Pulumi integration project does it do something weird to your local box. I was attempting to update a terraform provider in the new relic pulumi project and yarn linked the temp module. After reverting that and deleting that project I am seeing these weird errors still.
    (⎈ |aws-eks-dev:fieldju-dev) /Users/fieldju/dev/armory-io/pulumi-newrelic-infrastructure (master)
    $ p up
    Previewing update (prod):
         Type                          Name                                Plan     Info
         pulumi:pulumi:Stack           plumi-newrelic-infrastructure-prod           
         └─ pulumi:providers:newrelic  default_3_0_1                                1 error
     
    Diagnostics:
      pulumi:providers:newrelic (default_3_0_1):
        error: rpc error: code = Unknown desc = could not validate provider configuration: 1 error occurred:
            * Internal validation of the provider failed! This is always a bug
        with the provider itself, and not a user issue. Please report
        this bug:
        
        1 error occurred:
            * resource newrelic_nrql_alert_condition: ConflictsWith: critical configuration block reference (term.0) can only be used with TypeList and MaxItems: 1 configuration blocks
    but my project still works in CI but somehow I hosed my laptop 🤔 deleting my go path fixed it, the pulumi bin uses go sources on your path?
  • h

    helpful-processor-86468

    07/22/2020, 1:02 PM
    Is it normal that pulumi executes my code twice? FIrst time to show me what has changed and second when I approve changes.
    m
    b
    +2
    • 5
    • 9
Powered by Linen
Title
h

helpful-processor-86468

07/22/2020, 1:02 PM
Is it normal that pulumi executes my code twice? FIrst time to show me what has changed and second when I approve changes.
m

millions-furniture-75402

07/22/2020, 1:02 PM
yes, the first is a “preview”
you can explicitly preview with:
pulumi preview
you can also auto-approve preview and apply changes with
pulumi up -y
h

helpful-processor-86468

07/22/2020, 1:04 PM
So I have to make sure that everything in my code is idempotent? I have procedures in my code that can take quite a while and if I make them idempotent it will be twice the time.
b

better-actor-92669

07/22/2020, 1:27 PM
Yes. You can also issue
--skip-preview
s

stocky-lion-56153

07/22/2020, 1:27 PM
Yes, that’s the trade off. Pulumi allows you to develop infrastructure as code using proper programming languages instead of YAML (AWS cloudformation) or bespoke languages like HCL (terraform) but the downside is you have to be careful in your design
What are you doing that takes a long time?
l

lemon-agent-27707

07/22/2020, 3:11 PM
If you're doing complex orchestration, something like Runtime API might make sense: https://github.com/pulumi/pulumi/issues/3901 Would be great to hear more about your use case on that issue.
h

helpful-processor-86468

07/23/2020, 1:04 PM
So let's take as an example
google cloud function
. In order to deploy it, I have to zip it first. This zipping process can take some time if for example I have 10-20 functions in my service. And then I have to double that time, because pulumi executes twice.
My options are to just live with this or implement md5 hash checking of zip files.
View count: 1