https://pulumi.com logo
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
  • v

    victorious-xylophone-55816

    09/15/2020, 1:31 AM
    If I already have most of the configuration values needed for Pulumi stacks in
    .staging.env
    ,
    .production.env
    files, is there anything wrong with loading them using
    dotenv
    or something instead of duplicating those values in my
    Pulumi.staging.yaml
    etc files?
    l
    • 2
    • 4
  • v

    victorious-xylophone-55816

    09/15/2020, 1:37 AM
    type StackEnvironment = "staging" | "production"
    const stack = pulumi.getStack() as StackEnvironment
    
    loadDotenv({
      path: path.join(__dirname, `../.${stack}.env`)
    })
  • a

    ancient-dentist-35597

    09/15/2020, 7:39 AM
    Hello šŸ‘‹ I'm wondering if there's a way to suppress deletes on
    pulumi up
    . We have a pulumi stack that deploys an app service on azure, however recently I've found that on update it removes some
    appSettings
    that we enter manually through Azure. we had the stack working fine and the settings weren’t being deleted for about 6 months with multiple pushes a day, then suddenly it started removing the settings (within the last week or so). I've even set the specific version of pulumi in the github actions that we originally used and it's still happening. So is there any way to make sure that pulumi doesn't delete settings? Thanks! šŸ™
    b
    l
    • 3
    • 4
  • s

    steep-angle-29984

    09/15/2020, 10:41 AM
    Has anyone written a dynamic ResourceProvider for executing an ansible playbook which does more than just calling the ansible-playbook command? I'm thinking of inventory generation and advanced diff handling by not only checking input differences but also checking differences to the live system.
    🧐 1
  • v

    victorious-xylophone-55816

    09/15/2020, 2:12 PM
    Is there a trick to getting Pulumi to be idempotent? I have an existing Route53 domain, but code that tries to create and attach the domain to stuff. When running it, I get:
    aws:route53:Record (certificate-record):
        error: [ERR]: Error building changeset: InvalidChangeBatch: [Tried to create resource record set [name='_d7342dc96b265c66ab8427198a513284.xxxx.com.', type='CNAME'] but it already exists]
    Similarly, trying to put this
    if/else
    in a custom
    ComponentResource
    for ACM certificates, makes it attempt to delete the certificate instead of not doing anything:
    const existingCertificate = pulumi.output( aws.acm.getCertificate({ domain: parentDomain }, { async: true }) )
    
    if (existingCertificate) {
      this.arn = existingCertificate.arn
    } else {
      const certificate = new aws.acm.Certificate(
      // rest of code
    Is there a way to properly guarding all of your resources with "Try to look this up already and don't create it if it exists, just return the identifier"?
    s
    i
    l
    • 4
    • 7
  • i

    incalculable-dream-27508

    09/15/2020, 4:51 PM
    I don't know how specific to python this question is, but here goes: I'm creating several nodes belonging to two classes of machines on separate OpenStack clusters (currently two machines each on two clusters) with
    REGIONS = {
        'ams': openstack.Provider("ams", cloud="cnos_ams"),
        'lati': openstack.Provider("lati", cloud="cnos_lati")
    }
    and then for each of the two categories of machines creating them, and putting the objects in dictionaries like:
    INSTANCES_API = {
        # pylint: disable=line-too-long
        f'webadm-{i + 1}.otp.{dc}.local': openstack.compute.Instance(
            f'webadm-{i + 1}.otp.{dc}.local',
            flavor_name=FLAVOR_DB,
    ...
            security_groups=SECGROUPS_API,
            __opts__=pulumi.ResourceOptions(provider=REGIONS[dc]))
        for i in range(COUNT_API) for dc in REGIONS
    }
    and similar with
    INSTANCES_LEAF
    and then for convenience also create a new dictionary with all of them
    INSTANCES = {**INSTANCES_API, **INSTANCES_LEAF}
    Then I'm trying to get information about the machines, ideally a dictionary of
    "hostname": "access_ip_v4"
    to be able to use that later to generate names (since unique are required) and contents of security groups. But so far all my attempts at that have failed. My two most recent attempts are:
    for srv in INSTANCES:
        exported[INSTANCES[srv].name.apply] = INSTANCES[srv].access_ip_v4.apply
    and
    for srv in INSTANCES:
        exported.update(
            pulumi.Output.all(INSTANCES[srv].name,
                              INSTANCES[srv].access_ip_v4).apply(
                                  lambda args: json.dumps([{
                                      args[0]: args[1]
                                  }])))
    pulumi preview error
    • 1
    • 4
  • c

    cold-car-67614

    09/15/2020, 5:24 PM
    Hello, I filed a github issue here: https://github.com/pulumi/pulumi/issues/5366 Has anyone else gotten exceptions thrown that generally lack context on where the issue could be coming from?
  • i

    incalculable-dream-27508

    09/15/2020, 5:25 PM
    @cold-car-67614 yeah, check my message just above yours ;)
  • i

    incalculable-dream-27508

    09/15/2020, 5:25 PM
    Ah, no, it does say. At some points in my experimentation in didn't.
    c
    • 2
    • 3
  • a

    astonishing-quill-88807

    09/15/2020, 5:26 PM
    I have definitely seen that being the case and have posted some questions in the Python channel. I ultimately ended up figuring things out, but yeah, the stack traces are often unhelpful.
  • c

    cold-car-67614

    09/15/2020, 5:28 PM
    I've definitely seen it before, but generally I'll just revert whatever changes I had made and slowly add stuff back to figure out where it came from. In this case though all I did was upgrade Pulumi/plugins and I'm getting this exception.
  • c

    cold-car-67614

    09/15/2020, 5:29 PM
    Going to have upgrade trauma after this šŸ˜ž
  • l

    loud-egg-62954

    09/15/2020, 5:57 PM
    Hey folks--I'm getting an API disabled error and I can't really determine the cause. I think pulumi might be pointed at the wrong GCP project
  • l

    loud-egg-62954

    09/15/2020, 5:57 PM
    I updated the GCP project in the gcloud CLI--does it not pick it up from there?
  • l

    loud-egg-62954

    09/15/2020, 5:59 PM
    Ah, never mind. I was looking for pulumi config set gcp:project
  • l

    loud-egg-62954

    09/15/2020, 5:59 PM
    Awesome work folks, loving it
  • b

    billowy-kangaroo-51688

    09/15/2020, 6:11 PM
    What could be the reason that
    dynamodb.name.get()
    is not being captured in my Lambdas?
  • m

    many-psychiatrist-74327

    09/15/2020, 6:13 PM
    šŸ‘‹ hello! has anyone experienced very high latency when using the extension libraries (
    awsx
    ,
    eks
    ) in TS?
    I am bringing up a kubernetes cluster and a few services running in it. I first implemented in Python to learn the framework. Then I re-implemented in TS because there are better libraries. However the latency is very different: Python, 17 seconds:
    $ time pulumi preview
    Previewing update (dev)
    
    View Live: (redacted)
    
         Type                          Name                            Plan
         pulumi:pulumi:Stack           kubernetes-dev
         (redacted)
    
    Resources:
        - 4 to delete
        40 unchanged
    
    
    real	0m17.365s
    user	0m1.624s
    sys	0m2.881s
    TS, almost 2 minutes:
    $ time pulumi preview
    Previewing update (dev)
    
    View Live: (redacted)
    
         Type                 Name       Plan
         pulumi:pulumi:Stack  infra-dev
    
    Resources:
        70 unchanged
    
    
    real	1m37.499s
    user	0m0.998s
    sys	0m1.127s
    How can I find out where this latency is coming from?
    g
    w
    • 3
    • 8
  • b

    billowy-kangaroo-51688

    09/15/2020, 7:39 PM
    My last question was a bit uselessly short šŸ˜…
    new aws.lambda.CallbackFunction(
      "handler",
      {
        tags,
        memorySize: 128,
        role: lambdaRole,
        layers: [awsSdkLayer.arn],
        callback: (event: APIGatewayProxyEvent) => {
          return handlerFactory({
            tableName: db.name.get(), // db = result of `new aws.dynamodb.Table`
            // [..] more values not being captured
          })(event);
        },
      },
    );
    I’ve ā€œdownloaded deployment packageā€ & the actual name of the table is nowhere to be found, I also tried to define
    const tableName = db.name.get()
    before the
    return handlerFactory
    šŸ¤·ā€ā™‚ļø
    āœ… 1
    w
    • 2
    • 6
  • h

    handsome-actor-1155

    09/15/2020, 8:21 PM
    Hi all, just a quick question: I’m using Pulumi to create and upload images to AWS ECR via a Dockerfile and it works great. I’m just curious if there’s some configuration setting that can prevent Pulumi from invoking docker, building, and trying to push the image every time I run
    pulumi up
    or even
    pulumi preview
    . This would save quite a bit of time. Or is this something I would need to configure within the Dockerfile itself? Thanks!
    g
    • 2
    • 3
  • c

    chilly-garage-80867

    09/15/2020, 8:23 PM
    General best practices question
  • c

    chilly-garage-80867

    09/15/2020, 8:24 PM
    what should I include in a .gitignore if I am going to share a pulumi stack configuration
  • l

    loud-battery-37784

    09/15/2020, 8:25 PM
    @chilly-garage-80867 what language?
  • c

    chilly-garage-80867

    09/15/2020, 8:25 PM
    Python
  • b

    bitter-application-91815

    09/15/2020, 9:03 PM
    Hey there, just here on
    <https://github.com/pulumi/pulumi-aws/blob/master/sdk/go/aws/eks/nodeGroup.go#L314>
  • b

    bitter-application-91815

    09/15/2020, 9:03 PM
    it says,
    // Identifiers of EC2 Subnets to associate with the EKS Node Group. These subnets must have the following resource tag: `<http://kubernetes.io/cluster/CLUSTER_NAME|kubernetes.io/cluster/CLUSTER_NAME>` (where `CLUSTER_NAME` is replaced with the name of the EKS Cluster).`
  • b

    bitter-application-91815

    09/15/2020, 9:04 PM
    sure but what's the key on that tag, tags on ec2::subnet is a map, not an []string
    c
    • 2
    • 4
  • m

    millions-judge-24978

    09/15/2020, 9:15 PM
    If I am creating a pulumi program in typescript, and would like to instantiate an
    aws.lambda.Function
    using go code, is there a way to automate the
    go build
    as part of the pulumi program running? I see this:
    Using Pulumi’s Asset and Archive classes, we can fetch code from anywhere – in-memory, on disk, or even over the network. Pulumi will detect changes in the contents of these assets and archives so that when you run pulumi up, diffs will be detected and updated.
    It seems to me though that would be missing the necessary
    go build
    though
    s
    • 2
    • 4
  • f

    fast-magician-55948

    09/15/2020, 9:18 PM
    How do you put several Google Cloud Functions in a Pulumi project? I've successfully created on Google Cloud Function, following the samples. Now I want to put in a second Google Cloud Function. Any samples?
  • f

    fast-magician-55948

    09/15/2020, 9:28 PM
    (I'm using Python)
Powered by Linen
Title
f

fast-magician-55948

09/15/2020, 9:28 PM
(I'm using Python)
View count: 1