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
typescript
  • e

    elegant-window-55250

    12/13/2019, 3:25 PM
    Hello! I’m using
    k8s.apiextensions.CustomResource
    and need to get the
    status
    output from that API resource. How do I get that? I can see information from
    metadata
    and
    spec
    but I’m not able to get
    status
    . I do also see the status is available in Pulumi Console.
    r
    2 replies · 2 participants
  • h

    handsome-cat-98152

    12/16/2019, 2:47 PM
    When I have a custom Class, that includes Deployments, Services, etc.. How do I export it, so pulumi deploys it?
    w
    2 replies · 2 participants
  • c

    curved-pharmacist-41509

    12/16/2019, 10:29 PM
    Does Pulumi work if you split index.ts into multiple modules? I'm having issues with a lambda I have moved into another module and the modules it await import() internally are not included in the zip.
    w
    1 reply · 2 participants
  • e

    elegant-shampoo-65690

    12/17/2019, 3:15 PM
    Hi - I'm receiving this error when trying to preview deployment of aiven pg service:
    └─ pulumi:providers:aiven       default_1_1_0                     1 error
    Diagnostics:
    pulumi:providers:aiven (default_1_1_0):
    error: could not read plugin [/.pulumi/plugins/resource-aiven-v1.1.0/pulumi-resource-aiven] stdout: EOF
    pulumi:pulumi:Stack (gcloud-dev):
    panic: Failed to read service_user_config_schema.json: stat templates/service_user_config_schema.json: no such file or directory
    goroutine 1 [running]:
    <http://github.com/aiven/terraform-provider-aiven/aiven.readUserConfigJSONSchema(0x208fafa|github.com/aiven/terraform-provider-aiven/aiven.readUserConfigJSONSchema(0x208fafa>, 0x1f, 0x205720d)
    /home/travis/gopath/pkg/mod/github.com/pulumi/terraform-provider-aiven@v1.0.18-0.20191112055150-1b033b27c5e8/aiven/user_config.go:17 +0x313
    <http://github.com/aiven/terraform-provider-aiven/aiven.GetUserConfigSchema(0x205720d|github.com/aiven/terraform-provider-aiven/aiven.GetUserConfigSchema(0x205720d>, 0x7, 0x205bbc4)
    /home/travis/gopath/pkg/mod/github.com/pulumi/terraform-provider-aiven@v1.0.18-0.20191112055150-1b033b27c5e8/aiven/user_config.go:41 +0x1a0
    <http://github.com/aiven/terraform-provider-aiven/aiven.init()|github.com/aiven/terraform-provider-aiven/aiven.init()>
    /home/travis/gopath/pkg/mod/github.com/pulumi/terraform-provider-aiven@v1.0.18-0.20191112055150-1b033b27c5e8/aiven/resource_service.go:139 +0x318c
    💯 1
    w
    b
    +1
    13 replies · 4 participants
  • g

    gorgeous-animal-95046

    12/19/2019, 3:23 PM
    Hi I'm having some problems with
    interpolate
    and I can't figure out what I'm doing wrong. Here's my code: https://gist.github.com/zombor/43cd30735aa72bc02be4ef878aa073c6 I'm guessing this has to do with some kind of aysnc problem, but the docs on
    interpolate
    suggest this should "just work". Anyone know what I'm doing wrong? I would expect the output of
    foo
    on L25 to be either
    undefined
    or some kind of actual string.
    t
    9 replies · 2 participants
  • a

    acceptable-army-69872

    12/19/2019, 3:51 PM
    I'm using typescript, but I want to deploy a lambda written in python. It'd be rad to just use aws.cloudwatch.onSchedule, which i'm doing for some node code, but is there a way to do it with other languages?
    w
    2 replies · 2 participants
  • w

    worried-engineer-33884

    12/20/2019, 5:30 PM
    Is there a way to check the type of an output? e.g.
    typeof myStringOutput === "object"
    is there a way to test for pulumi.Output<string> in a guard or something?
    w
    2 replies · 2 participants
  • c

    chilly-crayon-57653

    12/20/2019, 8:30 PM
    set the channel topic: All TypeScript all the time! Noob friendly - there are no dumb questions. If your query is related to Output, the answer is generally to use apply. 🙂
  • p

    plain-night-8063

    01/03/2020, 3:52 PM
    Hello everyone! How can I create a few slightly different resources re-using an existing code as much as possible? For example, I need to create several Route53 records. However, a few of them are simple CNAMEs but others have failover policy. Is it possible to make the failover block dynamic? Thanks!
    w
    g
    5 replies · 3 participants
  • l

    limited-rainbow-51650

    01/04/2020, 12:15 PM
    In my stack, I’m importing an existing Gitlab group. I provided the group name in the
    import
    property and when running pulumi, I get a succesful import:
    =   ├─ gitlab:index:Group            cumundi                     imported
    But in this run, I had errors on wrong user id’s for group memberships. So I fixed the import IDs, ran
    preview
    and now I get this:
    +-  ├─ gitlab:index:Group            cumundi                     replace
    Why does it want to replace the Gitlab group? Is this a general Pulumi problem or a Gitlab provider problem? /cc @broad-dog-22463
  • l

    limited-rainbow-51650

    01/04/2020, 12:16 PM
    As I didn’t notice the
    replace
    state, I unfortunately executed
    up
    and the provider has dropped my Gitlab group with some manually created repositories in it. All lost… 😞
  • b

    broad-dog-22463

    01/04/2020, 1:48 PM
    Oh no!!! Can you open an issue in the repo?
    l
    w
    19 replies · 3 participants
  • f

    flaky-father-99093

    01/07/2020, 1:28 AM
    hey friends - if I have a secret that I want to write to a file, for example as input to cloud-init - how do I do that? I get an error that says I should use
    apply
    ... but that doesn't seem to actually let me wind up with a string 🙂
    g
    s
    8 replies · 3 participants
  • s

    stocky-island-3676

    01/08/2020, 4:04 PM
    I get the error
    import * as gcp from '@pulumi/gcp'
        ^^^^^^
    
        SyntaxError: Cannot use import statement outside a module
    from a
    dependency
    saved in Github repo. What am I missing?
    b
    14 replies · 2 participants
  • l

    limited-rainbow-51650

    01/09/2020, 2:49 PM
    When I create a custom
    pulumi.ComponentResource
    subclass, how can I define the
    opts
    so I have the same VSCode IntelliSense as for the default Pulumi libs. Example could be handy. 😉
    b
    c
    +1
    12 replies · 4 participants
  • a

    acceptable-army-69872

    01/10/2020, 6:36 PM
    I'm trying to use one instance's privateIp in the user data of another instance. I tried doing something like
    function getIp (server: aws.ec2.Instance) {
      return pulumi.all([server.privateIp]).apply(([privateIp]) => {
                          return pulumi.interpolate`${privateIp}`;
                      });
    }
    to get the IP, but it still gives me the calling toString on an output error instead of the value. Thoughts on how to do this?
    g
    s
    9 replies · 3 participants
  • h

    handsome-truck-95168

    01/13/2020, 10:45 PM
    I'm trying to use the
    URL
    class from node (in a lambda, if it makes a difference). But neither
    import { URL} from "url"
    nor
    require("url")
    works. Here is my
    package.json
    , what am I missing:
    {
        "name": "deploy",
        "devDependencies": {
            "@types/lodash": "^4.14.144",
            "@types/mime": "^2.0.1",
            "@types/moment": "^2.13.0",
            "@types/node": "^10.17.13"
        },
        "dependencies": {
            "@Pulumi Team/aws": "^1.0.0",
            "@Pulumi Team/awsx": "^0.18.10",
            "@Pulumi Team/pulumi": "^1.0.0",
            "aws-sdk": "^2.602.0",
            "lodash": "^4.17.14",
            "mime": "^2.4.0"
        }
    }
  • a

    ambitious-ram-5811

    01/13/2020, 10:49 PM
    url
    is a builtin module to node
  • a

    ambitious-ram-5811

    01/13/2020, 10:50 PM
    Try
    import * as URL from 'url'
    h
    9 replies · 2 participants
  • a

    astonishing-cartoon-37000

    01/14/2020, 10:21 PM
    Think I found an issue in
    @pulumi/datadog
    specifically
    SyntheticsTest
    class. Thread for more explaination.
    g
    7 replies · 2 participants
  • h

    handsome-cat-98152

    01/15/2020, 12:04 PM
    What is the proper way of dealing with (runtime) Errors in Pulumi? Right now I'm just throwing an Error, is there a more suited best practice?
    a
    a
    4 replies · 3 participants
  • p

    plain-eye-9759

    01/16/2020, 10:37 AM
    Hi everyone How do I pass parameters to an ARM template deployment? I tried passing the filename but I was getting this
    Error Expanding the parameters_body for Azure RM Template Deployment
    I have also tried passing the parameters directly with no success. Please help!
    const deployment = new azure.core.TemplateDeployment(name, {
         resourceGroupName: args.resourceGroupName,
         name,
         templateBody: pulumi.output(template).apply(JSON.stringify),
         // parametersBody: "params.json",
         // parametersBody: {
         //    "certContent": {
         //        "reference": {
         //             "keyVault": {
         //                 "id": "/id-of-the-keyvault"
         //              },
         //              "secretName": "SecretName"
         //          }
         //     }
         // },
          deploymentMode: "Incremental",
    }, { parent: this });
    1 reply · 1 participant
  • a

    adamant-postman-86832

    01/16/2020, 4:42 PM
    any ideas how to convert a pulumi.input (for example a kubeconfigraw) to a string?
  • a

    adamant-postman-86832

    01/16/2020, 4:46 PM
    sorry, I mean a pulumi.output
    a
    w
    2 replies · 3 participants
  • f

    future-megabyte-14556

    01/22/2020, 10:05 AM
    How do we use apply properly to get strings for outputs? Struggling to work out what I'm missing here. Trying to get the connection URL from the RDS postgres output.
    export const db = new aws.rds.Instance(`${config.PROJECT_NAME}-postgres`, {
      engine: "postgres",
      instanceClass: "db.t2.small",
      allocatedStorage: 20,
      dbSubnetGroupName: dbSubnets.id,
      vpcSecurityGroupIds: [cluster.clusterSecurityGroup.id],
      name: config.POSTGRES_DB_NAME,
      username: config.POSTGRES_USERNAME,
      password: config.POSTGRES_PASSWORD,
      skipFinalSnapshot: true,
      publiclyAccessible: true
    });
    
    const username = db.username.apply(un => `${un}`);
    const password = db.password.apply(pw => `${pw}`);
    const address = db.address.apply(addr => `${addr}`);
    const port = db.port.apply(port => `${port}`);
    const name = db.name.apply(name => `${name}`);
    
    const connectionUrl = `postgres://${username}:${password}@${address}:${port}/${name}`;
    
    // Create a secret from the DB connection
    export const dbConn = new k8s.core.v1.Secret(
      "postgres-db-conn",
      {
        data: {
          dbConnectionUrl: Buffer.from(connectionUrl).toString("base64")
        }
      },
      { provider: cluster.provider }
    );
    l
    b
    5 replies · 3 participants
  • c

    cuddly-smartphone-89735

    01/22/2020, 3:33 PM
    Is it considered good practice to create resources within a class instead of just defining them top-level in a file? Would that be a special kind of class (inherit from something?) or just a plain regular typescript class?
    t
    2 replies · 2 participants
  • w

    worried-engineer-33884

    01/22/2020, 6:31 PM
    How does
    aws.Provider
    have a
    region
    output, but TS throws:
    2339: Property 'region' does not exist on type 'Provider'.
    a
    1 reply · 2 participants
  • w

    worried-engineer-33884

    01/22/2020, 8:24 PM
    I am having a problem using jest to write unit tests for a dynamic resource. when testing the outputs, e.g.:
    describe("my custom resource", () => {
        it("has outputs", function(done) {
            pulumi
                .all([myCustomResource.someOutput])
                .apply(([someOutput]) => {
                    try {
                        assert.equal(someOutput, "foobar");
                        done();
                    } catch (e) {
                        done(e);
                    }
                });
        });
    });
    I am seeing these errors:
    Error calling "Runtime.evaluate(global.__inflightFunctions.id0)": Uncaught
    
          at node_modules/@pulumi/pulumi/runtime/closure/v8_v11andHigher.js:123:23
          at fulfilled (node_modules/@pulumi/pulumi/runtime/closure/v8_v11andHigher.js:18:58)
    
        Error calling "Runtime.evaluate(global.__inflightFunctions.id1)": Uncaught
    
          at node_modules/@pulumi/pulumi/runtime/closure/v8_v11andHigher.js:123:23
          at fulfilled (node_modules/@pulumi/pulumi/runtime/closure/v8_v11andHigher.js:18:58)
    
        Error calling "Runtime.evaluate(global.__inflightFunctions.id2)": Uncaught
    
          at node_modules/@pulumi/pulumi/runtime/closure/v8_v11andHigher.js:123:23
          at fulfilled (node_modules/@pulumi/pulumi/runtime/closure/v8_v11andHigher.js:18:58)
    1 reply · 1 participant
  • f

    future-megabyte-14556

    01/26/2020, 9:03 AM
    Anybody else getting errors deleting EKS Node Security Groups?
    aws:ec2:SecurityGroup                  cluster-pulumi-test-nodeSecurityGroup         **deleting failed**   1 error
    Error deleting security group: DependencyViolation: resource sg-08f756b4c56c49dfc has a dependent object
        	status code: 400
    That dependent object is a network interface; if you delete that manually everything works. Getting this fairly consistently.
    w
    2 replies · 2 participants
  • n

    narrow-dinner-88865

    01/26/2020, 10:50 PM
    Hi all. I getting this error:
    TypeError: this.getData is not a function
            at new Vpc (C:\projects\infra\node_modules\@pulumi\ec2\vpc.ts:276:27)
            at Function.fromExistingIds (C:\projects\infra\node_modules\@pulumi\ec2\vpc.ts:367:16)
    trying to execute
    const vpc = awsx.ec2.Vpc.fromExistingIds("primary-vpc", { vpcId: "vpc-xxx" }, { provider: provider });
    package.json is:
    {
      "name": "aws-typescript",
      "devDependencies": {
        "@types/node": "^12.12.25"
      },
      "dependencies": {
        "@pulumi/aws": "1.18.0",
        "@pulumi/awsx": "0.19.0",
        "@pulumi/pulumi": "1.8.1"
      }
    }
    Could someone help with this?
    w
    6 replies · 2 participants
Powered by Linen
Title
n

narrow-dinner-88865

01/26/2020, 10:50 PM
Hi all. I getting this error:
TypeError: this.getData is not a function
        at new Vpc (C:\projects\infra\node_modules\@pulumi\ec2\vpc.ts:276:27)
        at Function.fromExistingIds (C:\projects\infra\node_modules\@pulumi\ec2\vpc.ts:367:16)
trying to execute
const vpc = awsx.ec2.Vpc.fromExistingIds("primary-vpc", { vpcId: "vpc-xxx" }, { provider: provider });
package.json is:
{
  "name": "aws-typescript",
  "devDependencies": {
    "@types/node": "^12.12.25"
  },
  "dependencies": {
    "@pulumi/aws": "1.18.0",
    "@pulumi/awsx": "0.19.0",
    "@pulumi/pulumi": "1.8.1"
  }
}
Could someone help with this?
node version
v12.14.1
pulumi version
v1.9.0
The method works fine with package.json:
{
  "name": "aws-typescript",
  "devDependencies": {
    "@types/node": "^12.12.6"
  },
  "dependencies": {
    "@pulumi/aws": "^1.7.0",
    "@pulumi/awsx": "^0.18.13",
    "@pulumi/pulumi": "^1.4.1"
  }
}
But I need more recent versions to pass VPC to a Fargate service.
The latest stable version of awsx on which the methods works is
0.18.14
on
0.19.x
it doesn't work
w

white-balloon-205

01/26/2020, 11:52 PM
That sounds like a bug - the error message is related to something which did change in awsx 0.19.0. Could you open an issue and we’ll look into it?
n

narrow-dinner-88865

01/27/2020, 10:09 AM
Sure. https://github.com/pulumi/pulumi-awsx/issues/495
👍 1
View count: 1