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

    acceptable-printer-2467

    01/21/2021, 5:23 PM
    Hi all, I’m an avid pulumi user and we’ve been using it in my team for quite some time now..I’ve got a painful error thrown by the following code:
    const peNicIp = pulumi
      .all([resourceGroupName, privateEndpoint.networkInterfaces[0].id])
      .apply(async ([rgName, peNicId]) => {
        const nic = await azureng.network.latest.getNetworkInterface({
          resourceGroupName: rgName,
          networkInterfaceName: peNicId?.split('/').pop() || '',
        });
        return nic.ipConfigurations![0].privateIPAddress;
      })
      .apply(ip => {
        console.log({ ip });
        return ip!;
      });
    
    const ehPeRs = peNicIp.apply(
      ip =>
        new azureng.network.latest.RecordSet(rtti`eh-pe-rs`, {
          resourceGroupName,
          privateZoneName: ehPEZone.name,
          recordType: 'A',
          relativeRecordSetName: `name`,
          aRecords: [
            {
              ipv4Address: ip,
            },
          ],
        })
    );
    which throws the error:
    cannot check existence of resource '/subscriptions/subId/resourceGroups/resourceGroup/providers/Microsoft.Network/privateDnsZones/dnsZone/A/Calling%20%5BtoString%5D%20on%20an%20%5BOutput%3CT%3E%5D%20is%20not%20supported.%0A%0ATo%20get%20the%20value%20of%20an%20Output%3CT%3E%20as%20an%20Output%3Cstring%3E%20consider%20either%3A%0A1%3A%20o.apply%28v%20%3D%3E%20%60prefix%24%7Bv%7Dsuffix%60%29%0A2%3A%20pulumi.interpolate%20%60prefix%24%7Bv%7Dsuffix%60%0A%0ASee%20https%3A%2F%2Fpulumi.io%2Fhelp%2Foutputs%20for%20more%20details.%0AThis%20function%20may%20throw%20in%20a%20future%20version%20of%20%40pulumi%2Fpulumi..Calling%20%5BtoString%5D%20on%20an%20%5BOutput%3CT%3E%5D%20is%20not%20supported.%0A%0ATo%20get%20the%20value%20of%20an%20Output%3CT%3E%20as%20an%20Output%3Cstring%3E%20consider%20either%3A%0A1%3A%20o.apply%28v%20%3D%3E%20%60prefix%24%7Bv%7Dsuffix%60%29%0A2%3A%20pulumi.interpolate%20%60prefix%24%7Bv%7Dsuffix%60%0A%0ASee%20https%3A%2F%2Fpulumi.io%2Fhelp%2Foutputs%20for%20more%20details.%0AThis%20function%20may%20throw%20in%20a%20future%20version%20of%20%40pulumi%2Fpulumi.': status code 400, <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""<http://www.w3.org/TR/html4/strict.dtd>">
        <HTML><HEAD><TITLE>Bad Request</TITLE>
        <META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
        <BODY><h2>Bad Request - Invalid URL</h2>
        <hr><p>HTTP Error 400. The request URL is invalid.</p>
        </BODY></HTML>
    I’m unsure of if this is a bug as I’m clearly using
    apply
    in an attempt to retrieve the actual value of the output..any help would be appreciated 🙂
    b
    t
    • 3
    • 12
  • e

    early-egg-62309

    01/21/2021, 7:57 PM
    Very odd, I have followed the update instruction and seem to have re-downloaded the same version:
    warning: A new version of Pulumi is available. To upgrade from version '2.17.2' to '2.18.0', run
       > powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('<https://get.pulumi.com/install.ps1')>)"
    or visit <https://pulumi.com/docs/reference/install/> for manual instructions and release notes.
    PS> powershell -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('<https://get.pulumi.com/install.ps1')>)"
    Downloading <https://get.pulumi.com/releases/sdk/pulumi-v2.17.2-windows-x64.zip>
    
    PS> (Invoke-WebRequest -UseBasicParsing <https://www.pulumi.com/latest-version).Content.Trim()>
    2.17.2
    🤔
    g
    • 2
    • 1
  • b

    big-state-95297

    01/22/2021, 12:53 AM
    Hi - I'm new here. Have been following Pulumi for a while and quite excited about the direction. We are looking to use Pulumi at our startup, but concerned about lock-in, rough edges and missing functionality. If there's a Pulumi -> Terraform bridge (we know one exists in the opposite direction), it would make it a lot easier for us to start trying out Pulumi. Would appreciate if someone can point us to such a tool if it exists. Thanks!
    l
    b
    +2
    • 5
    • 14
  • s

    stale-autumn-24797

    01/22/2021, 10:53 AM
    Is there a workaround for bug #6164 (https://github.com/pulumi/pulumi/pull/6164)? We have a blocked deployment (error: could not deserialize deployment: malformed resource value: id must be a string). If there isn’t a work around, any ETA on releasing the fix?
    b
    m
    • 3
    • 8
  • f

    few-tent-80031

    01/22/2021, 4:04 PM
    Hi guys! I have just started to use Pulumi for deploying on AWS. So far, it's really good! I am using Python for writing the infrastructure. I just wanted to ask is there going to be a Java SDK any time soon?
    w
    • 2
    • 2
  • p

    proud-hair-78501

    01/22/2021, 4:34 PM
    If I have a ComponentResource and have specified a dependsOn, is there anything special I need to do to make sure the children get that dependsOn as well?
    w
    • 2
    • 8
  • p

    proud-hair-78501

    01/22/2021, 4:43 PM
    Bonus points if theres a hidden CLI command that shows you the dependency tree, since I’m having an absolute ball-ache getting this to behave properly
    d
    c
    • 3
    • 4
  • b

    bored-river-53178

    01/22/2021, 5:42 PM
    Already posted that in #kubernetes yesterday, but unfortunately received no answer, and since I've seen the same issue with other modules (namely, AWS security groups rules) will try to ask here. is there any way to improve previews for changes like this one?
  • b

    bored-river-53178

    01/22/2021, 5:42 PM
    one env var was added here, but the preview doesn't clearly show that is that a known problem? does any workaround exist for it?
    g
    • 2
    • 1
  • s

    swift-agency-29333

    01/22/2021, 5:45 PM
    @broad-dog-22463 How Can I avoid installation of AWS plugin installation every time I run Automation API?
  • p

    prehistoric-nail-50687

    01/22/2021, 7:19 PM
    Is it possible to implement a custom backend? is there any documentation about the steps or any other startingpoint?
    b
    • 2
    • 4
  • s

    shy-oxygen-8874

    01/22/2021, 8:15 PM
    Hi, I'm working on a demo to evaluate Pulumi for our AWS resources. I think I have it nearly working, but when I try to upload a docker image to ECR using awsx.ecs.Image.fromDockerBuild, I get an error that docker login has failed. It looks to me like the temporary credentials the awsx module gets from ECR may not be making it down into the docker module. All of the other resources in my project (including the automatically created ECR repo) look like they've successfully created themselves.
    b
    • 2
    • 16
  • c

    chilly-hairdresser-56259

    01/22/2021, 9:04 PM
    Is anyone else here managing a large application 200+ ECS Services with Pulumi? Im seeing deployment times ranging from 30 minutes to over an hour. I know there is really no magic to this, and there are outside limiting factors. Such as API Limits/Thorttling, the time between polls between when it started to create and when its actually created/updated/replaced.
    b
    b
    • 3
    • 8
  • g

    glamorous-helmet-50600

    01/22/2021, 9:43 PM
    Hey guys! I'm having issues when trying to create a Certificate (Azure.AppService.Certificate), I'm passing in what I think is needed and it just hangs for about 7minutes and then fails with a generic error message:
    error: Error creating/updating App Service Certificate "cert-identity-dev" (Resource Group "rg-test-dev244b9b58"): web.CertificatesClient#CreateOrUpdate: Failure responding to request: StatusCode=500 -- Original Error: autorest/azure: Service returned an error. Status=500 Code="" Message="An error has occurred."
    I'm quite new to Pulumi so any help would be appreciated.
    b
    • 2
    • 1
  • t

    tall-needle-56640

    01/22/2021, 9:43 PM
    Is there a tool to show dependencies between resources? Sometimes I'll do something like
    storageAccountName
    instead of
    storageAccount.Name
    and then there is a hidden race condition. I kind of thought the Pulumi Console did that, but I'm not seeing that now.
    b
    • 2
    • 5
  • m

    mammoth-honey-6147

    01/24/2021, 10:24 AM
    Newbie question here - what's the correct way to effectively bail out of a
    pulumi up
    if a conditional statement isn't met? For example, I have a variable the specifies the number of EC2 instances to be made - in my Pulumi code (go) I loop round this number to create N number of EC2 instances. However, I want these to be spread over an equal number of availability zones. ideally, I'd want to check if ec2instances > az's, bail.
    g
    • 2
    • 1
  • b

    bitter-bear-28592

    01/25/2021, 3:40 AM
    Hi everyone - have encountered the following issue when following the tutorial for Pulumi and Azure. I've uninstalled/re-installed both Pulumi and the Azure CLI and am stumped. (I've confirmed that
    pulumi-resource-azure.exe
    exists in the given folder) Thank you for your help!
  • p

    prehistoric-nail-50687

    01/25/2021, 11:31 AM
    Is it possible to implement a custom backend? is there any documentation about the steps or any other startingpoint? I’m not looking for help on how to use any of the other backend (S3, Azure Storage, …) but how to implement a new custom backend.
    b
    • 2
    • 2
  • d

    dry-football-2639

    01/25/2021, 4:20 PM
    Is it possible to increase the retry count on Custom Resource creation?
    authorizer.rules (iac:services:KubePrometheusStack$kubernetes:<http://monitoring.coreos.com/v1:PrometheusRule|monitoring.coreos.com/v1:PrometheusRule>)
    Retry #0; creation failed: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
    Retry #1; creation failed: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
    Retry #2; creation failed: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
    Retry #3; creation failed: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
    Retry #4; creation failed: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
    Retry #5; creation failed: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
     
    error: creation of resource cluster-services/authorizer.rules failed because the Kubernetes API server reported that the apiVersion for this resource does not exist. Verify that any required CRDs have been created: no matches for kind "PrometheusRule" in version "<http://monitoring.coreos.com/v1|monitoring.coreos.com/v1>"
  • c

    colossal-australia-65039

    01/25/2021, 7:14 PM
    edit: nevermind, found out how and posted as a comment in this thread for the pulumi postgres package, is there a way to set the database host, username, etc. through code WITHOUT having to use environment variables or pulumi.yml configs? For example with Typescript I tried
    import * as pg from "@pulumi/postgresql"
    
    pg.config.host = 'redacted'
    pg.config.username = 'redacted'
    pg.config.password = 'redacted'
    
    const serverRole = new pg.Role('redacted', {
        login: true,
        password: 'redacted',
        name: 'redacted',
    })
    but I'm getting the error
    error: Error initializing PostgreSQL client: error detecting capabilities: error PostgreSQL version: dial tcp :5432: connect: connection refused
    The same creds work when I export as an env var.
    • 1
    • 1
  • b

    big-potato-91793

    01/25/2021, 8:52 PM
    Quick question, I’m trying to replicate what your ec2 depoyment from terraform to pulumi. I was having a question about this property that we have inside terraform
    lifecycle {
        create_before_destroy = true
      }
    this is something I can do also in pulumi?
    l
    c
    • 3
    • 5
  • f

    faint-motherboard-95438

    01/26/2021, 12:42 AM
    Is there any way to debug this :
    Type                 Name              Plan     Info
         pulumi:pulumi:Stack  services-staging           1 error
     
    Diagnostics:
      pulumi:pulumi:Stack (services-staging):
        error: an unhandled error occurred: Program exited with non-zero exit code: -1
    on a
    pulumi up
    with no stack trace and no obvious way to understand the problem, appearing suddenly without any change to the codebase ? (TS flavor) Even tried to checkout some old commit ref, still happening..
    l
    b
    • 3
    • 18
  • q

    quiet-leather-94755

    01/26/2021, 5:21 AM
    Hi! 👋 I was a bit curious about
    Output.all()
    , is there any way to access the outputs one wants in the lambda by name, instead of index? It quickly gets confusing with a more substantial piece of code like this one:
    environment = Output.all(
        databases["airflow"].address,  # 0
        databases["airflow"].password, # 1
        databases["grafana"].address,  # 2
        databases["grafana"].password, # 3
        databases["redata"].address,   # 4
        databases["redata"].password,  # 5
        base_url,                      # 6
        sd_namespace.name,             # 7
    ).apply(
        lambda args: [
            # Airflow DB
            {"name": "AIRFLOW_CONN_METADATA_DB", "value": f"<postgres+psycopg2://airflow:{args[1]}@{args[0]}:5432/airflow>"},
            {"name": "AIRFLOW_VAR__METADATA_DB_SCHEMA", "value": "airflow"},
            # Airflow Config
            {"name": "AIRFLOW__CORE__LOAD_DEFAULT_CONNECTIONS", "value": "False"},
            {"name": "AIRFLOW__CORE__SQL_ALCHEMY_CONN", "value": f"<postgres+psycopg2://airflow:{args[1]}@{args[0]}:5432/airflow>"},
    ...
    As you can see, I've taken to labeling each output with its index just to not get too lost.. 😅
  • w

    white-pencil-38837

    01/26/2021, 9:47 AM
    Hi when running pulumi up i see the docker debug on each run, anyone know how i disable the output?
    pulumi:pulumi:Stack (xxxxxxx):
        #1 [internal] load build definition from Dockerfile
        #1 sha256:xxxxx
        #1 transferring dockerfile: 237B done
        #1 DONE 0.0s
        #2 [internal] load .dockerignore
        #2 sha256:xxxxx    #2 transferring context: 2B done
        #2 DONE 0.0s
    g
    • 2
    • 2
  • s

    straight-librarian-43739

    01/26/2021, 4:44 PM
    when using the
    awskms
    secrets provider, what format/encoding is the ciphertext stored in? I get something like
    "ciphertext": "v1:NRtBgOKsQ3V/dF57:LHwdjA….
    in my stack outputs which is not base64. (I want to decrypt it and get the plaintext)
    b
    • 2
    • 11
  • s

    silly-queen-76790

    01/26/2021, 5:02 PM
    Hello 🙂
    👋 2
  • i

    incalculable-evening-30668

    01/26/2021, 5:07 PM
    Hi, a warm hi from 🇨🇴
    👋 1
  • f

    flat-waitress-69282

    01/26/2021, 6:25 PM
    Hello everyone
    👋 3
  • b

    billowy-army-68599

    01/26/2021, 7:15 PM
    hello new users! feel free to ask in #workshops if you have questions about the earlier workshop!
  • j

    jolly-lifeguard-22556

    01/26/2021, 8:49 PM
    Curious if anyone here has any tips/advice for how they're managing multiple pulumi projects inside of monorepos with Typescript. I've run into a ton of dead-ends when it comes to using
    yarn workspaces
    (there are quite a few open GH issues about this). Are people here mostly just having separate repos for different projects? Or are you keeping a top level package.json/tsconfig.json and then having individual projects in different directories?
    l
    q
    • 3
    • 16
Powered by Linen
Title
j

jolly-lifeguard-22556

01/26/2021, 8:49 PM
Curious if anyone here has any tips/advice for how they're managing multiple pulumi projects inside of monorepos with Typescript. I've run into a ton of dead-ends when it comes to using
yarn workspaces
(there are quite a few open GH issues about this). Are people here mostly just having separate repos for different projects? Or are you keeping a top level package.json/tsconfig.json and then having individual projects in different directories?
l

little-cartoon-10569

01/26/2021, 8:50 PM
I'm doing that second option. Not using yarn though, just
cd
.
It's working great for me. Haven't had to think about it since I got it working 6+ months ago...
The only gotcha I have is that one of my projects has to have a symbolic link to the top-level packges.json. I can't remember why, it's there now and it works. I can figure it out in a few minutes, if it's of interest.
Figured it out. It's because that project compiles lambdas. I suppose I don't need to link to the top-level package.json, I could have a separate, smaller package.json in the Pulumi project directory.
Ah no, I couldn't, that would confuse npm. The current solution is good.
j

jolly-lifeguard-22556

01/26/2021, 9:10 PM
So does each project have its own tsconfig.json + package.json + node_modules in your setup?
(Thanks for the insight by the way)
l

little-cartoon-10569

01/26/2021, 9:16 PM
No, there's a single top-level package.json and tsconfig.json. I also have a single top-level tsconfig.test.json, because I use mocha and it doesn't handle the same TS module type.
I need a link from Pulumi project dirs to the top-level package.json if the Pulumi project builds functions for use by lambda or equivalent.
j

jolly-lifeguard-22556

01/26/2021, 9:18 PM
Got it. Thanks this is extremely helpful!
👍 1
q

quiet-gold-81036

01/27/2021, 7:19 AM
FWIW we're using nx.dev which perscribes a single top-level
package.json
but we cheated and added
pulumi
as a folder with its own
package.json
(haven't tried keeping it in the top-level
package.json
)
j

jolly-lifeguard-22556

01/27/2021, 12:34 PM
Thanks for the info @quiet-gold-81036. I'm a big fan of NX but haven't tried using it with Pulumi. Do you have multiple Pulumi projects inside your
pulumi
folder or is it just the one
q

quiet-gold-81036

01/27/2021, 12:50 PM
multiple pulumi projects
j

jolly-lifeguard-22556

01/27/2021, 12:59 PM
And they all share the same tsconfig and package.json similar to the setup that tenwit has?
q

quiet-gold-81036

01/27/2021, 1:58 PM
nope, separate tsconfigs. works like a charm
l

little-cartoon-10569

01/27/2021, 7:49 PM
Yea there's no particular reason to use one over the other. All the runtimes (mocha, node, Pulumi) search up the directory hierarchy until they find the files they need. They don't have to be in the same directory, and it seems to work in all combinations, with that one gotcha of compiling lambda code.
View count: 2