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

    bored-jackal-93148

    12/10/2019, 11:04 PM
    I want to associate each of my vpcs external subnets with a nat gateway and make available a map of the subnet ids to gateways for use bny other components.
    vpc.publicSubnetIds.reduce((gateways, id) => {
          gateways[pulumi.interpolate`${id}`] = vpc.addNatGateway(
            `${config.release.name}-${name}-${id}-gateway`,
            { subnet: id },
            { parent: vpc }
          );
        }, {});
    Doesn’t work as output can’t be a key … any guidence
    c
    • 2
    • 5
  • h

    handsome-truck-95168

    12/10/2019, 11:42 PM
    Been running into an error that relates to Output values that are used to create additional resources (specifically, creating Route53 domain records to validate an SSL certificate
    r
    • 2
    • 5
  • b

    broad-finland-69602

    12/11/2019, 9:41 AM
    is it possible to access the final name of an aws resource from a crossguard policy? all the properties that are defined in resource policies or stack policies seem to be created before the final name is assigned <- I was wrong, they are available... leaving this here for future archeologists
    👍 4
  • b

    blue-portugal-12071

    12/11/2019, 4:39 PM
    I want to invoke
    pulumi up
    using another application, but I want that application to know about the success of the stack creation/deletion/etc. Possible?
    m
    • 2
    • 3
  • b

    blue-portugal-12071

    12/11/2019, 4:39 PM
    So essentially hiding pulumi behind an API endpoint.
  • b

    blue-portugal-12071

    12/11/2019, 4:40 PM
    Would this need to be done by means of using Pulumi Webhooks?
    r
    • 2
    • 1
  • c

    curved-doctor-83600

    12/11/2019, 5:37 PM
    Hey all, I'm receiving error messages, when I try to perform some rather simple changes of a yaml.ConfigFile. In my case, I am issuing two ClusterIssuers for cert-manager. One uses the acme staging servers, the other uses the acme prod servers. I had a bug in the prod server cluster issuer, it used the staging server. So I updated the prod ClusterIssuer to use the acme prod server and tried to deploy the change using "pulumi up". Pulumi correctly identifies the "spec" of the ClusterIssuer to be different. Nevertheless, when I let pulumi run the upgrade, I get an error message "the Kubernetes API server reported that "name-of-clusterissuer" failed to fully initialize or become live: the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml". Any ideas what's going on here? Updating from changed yaml files is and will be an important use case, since not every k8s resource will (and should) be part of pulumi sdk. Can someone shed some light on this please.
    r
    g
    p
    • 4
    • 11
  • h

    handsome-truck-95168

    12/11/2019, 8:18 PM
    When I use
    aws.route53.Record.get(...)
    to retrieve a record that doesn't exist (in which case I would create it), my
    pulumi up
    fails with an error message like:
    error: Preview failed: resource 'Z22LJ5YIATCQQQ_<http://consolex.dev.example.com|consolex.dev.example.com>_CNAME' does not exist
    Is there another way to see if a DNS record already exists? Do I need to use the AWS SDK (from Amazon)?
    r
    b
    m
    • 4
    • 8
  • b

    bored-jackal-93148

    12/11/2019, 9:29 PM
    I have a component I need to integrate that’s been delivered in an AWS SAM template. Any pointers on the easiest/best way to integrate that into an overall build?
    w
    • 2
    • 2
  • i

    incalculable-diamond-5088

    12/11/2019, 11:05 PM
    Getting
    Error: Error: spawnSync /bin/sh ENOBUFS
    when upgrading to latest prometheus operator helm chart. I remember I’ve seen this issue when the helm chart was big. Was it fixed, or is there a workaround? Node: v12.7.0 Pulumi: 1.6.0
    g
    • 2
    • 3
  • e

    elegant-dress-88912

    12/12/2019, 5:04 AM
    Hello! What is the best practice to create conditional resources and outputs? I need to create service account and export its private key if stack has option like
    createServiceAccount: true
  • e

    elegant-dress-88912

    12/12/2019, 5:10 AM
    basic approach with
    // somewhere in index.ts
    if (config.createServiceAccount) {
      const serviceAccount = new ...
      const serviceAccountKey = new ...
      export const serviceAccountPrivateKey = serviceAccountKey.PrivateKey
    }
    won't work, because 1. later I would need to access object props of, say, serviceAccount, but this variable scope is limited by
    if
    block 2. `export`'s seems to be not allowed in nested blocks in typescript
  • e

    elegant-dress-88912

    12/12/2019, 5:11 AM
    for the 1st issue, I use declaration
    let serviceAccount: type
    before
    if
    block, but not sure what to do with the 2nd
  • a

    ambitious-ram-5811

    12/12/2019, 5:13 AM
    Something like this should work:
    let serviceAccountPrivateKey: TypeOfThePrivateKeyType;
    
    if (config.createServiceAccount) { ... }
    
    export serviceAccountPrivateKey;
  • e

    elegant-dress-88912

    12/12/2019, 5:18 AM
    @ambitious-ram-5811 thanks, I was close 🙂
  • e

    elegant-dress-88912

    12/12/2019, 5:22 AM
    @ambitious-ram-5811 unfortunately, IDE complains about
    export
    after
    if
    saying 'variable is used before assignment'
  • e

    elegant-dress-88912

    12/12/2019, 5:22 AM
    I have
    let serviceAccountPrivateKey: pulumi.Output<string>
    before
    if
  • e

    elegant-dress-88912

    12/12/2019, 5:24 AM
    I guess I need some default assignment first (empty output)
  • b

    bored-jackal-93148

    12/12/2019, 5:24 AM
    declare
    let serviceAccountPrivateKey: pulumi.Output<string | undefined>
  • a

    ambitious-ram-5811

    12/12/2019, 5:24 AM
    let serviceAccountPrivateKey = default(ThatType)
  • b

    bored-jackal-93148

    12/12/2019, 5:25 AM
    or
    let serviceAccountPrivateKey: pulumi.Output<string> | undefined depending on where in the onion you are
  • a

    ambitious-ram-5811

    12/12/2019, 5:25 AM
    No, you actually have to set it
  • a

    ambitious-ram-5811

    12/12/2019, 5:25 AM
    It's not a type issue
  • b

    bored-jackal-93148

    12/12/2019, 5:26 AM
    if it has to be set then the above code wont work … andrew says is’t a conditional resource
  • b

    bored-jackal-93148

    12/12/2019, 5:27 AM
    if create …. ggive me the created … otherwise ???
  • b

    bored-jackal-93148

    12/12/2019, 5:27 AM
    undefined is as valid as default(foo)
  • b

    bored-jackal-93148

    12/12/2019, 5:28 AM
    you shouldn’t need assignment if you don’t need a value
  • e

    elegant-dress-88912

    12/12/2019, 5:28 AM
    @ambitious-ram-5811 not clear how do I create default instance of type pulumi.Output<string>
  • e

    elegant-dress-88912

    12/12/2019, 5:29 AM
    default(pulumi.Output<string>)
    looks invalid expr
  • a

    ambitious-ram-5811

    12/12/2019, 5:29 AM
    But when you say
    let foo: [anything you type here]
    , it doesn't actually assign it
Powered by Linen
Title
a

ambitious-ram-5811

12/12/2019, 5:29 AM
But when you say
let foo: [anything you type here]
, it doesn't actually assign it
View count: 1