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

    wooden-lighter-66320

    05/07/2020, 1:03 AM
    makes sense. The goal here is actually reducing abstraction, right now we're solving the cross-resource relationships issue with a dependency injection system that is more complex than is necessary for the problem. That's the motivation for looking for a minimal, clean, TypeScript (or basic JS) modular example
  • l

    limited-rainbow-51650

    05/07/2020, 9:09 PM
    Can I still use the
    chai
    test helper in a Pulumi unit test?
    network.name.apply((name) => {
                name.should.equal('empty_network')
            });
    results in my test passing, but still got this stack:
    (node:50206) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'should' of undefined
        at /Users/ringods/Projects/cumundi/libraries/packages/iac-gcp/test/network.spec.ts:60:18
        at /Users/ringods/Projects/cumundi/libraries/node_modules/@pulumi/pulumi/output.js:249:35
        at Generator.next (<anonymous>)
        at /Users/ringods/Projects/cumundi/libraries/node_modules/@pulumi/pulumi/output.js:21:71
        at new Promise (<anonymous>)
        at __awaiter (/Users/ringods/Projects/cumundi/libraries/node_modules/@pulumi/pulumi/output.js:17:12)
        at applyHelperAsync (/Users/ringods/Projects/cumundi/libraries/node_modules/@pulumi/pulumi/output.js:228:12)
        at /Users/ringods/Projects/cumundi/libraries/node_modules/@pulumi/pulumi/output.js:182:65
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    w
    • 2
    • 2
  • l

    little-cartoon-10569

    05/08/2020, 12:53 AM
    Gidday. I'm trying to get mocha+chai working with tests that are not in the same directory as the code/stack under test. I'm perpetually getting
    Error: Program run without the Pulumi engine available; re-run using the
    pulumi
    CLI
    I've tried
    pulumi login
    and I've copied Pulumi.yaml from the source directory (btw it's not documented anywhere that you have to do this in order to use the same project/stack in multiple places - all the docs assume you're creating a new project and stack every time).
    w
    • 2
    • 16
  • m

    many-dress-88879

    05/08/2020, 9:27 PM
    Hey There, when I try to deploy helm charts via pulumi, looks like pulumi convert chart to k8s ymls and deploy them inside the cluster, which works however i wont be able to use
    helm
    cli to see those deployed helm charts in the cluster afterward and potentially make adjustments with it
  • m

    many-dress-88879

    05/08/2020, 9:28 PM
    is it expected?
    w
    • 2
    • 1
  • m

    magnificent-accountant-19074

    05/11/2020, 9:57 AM
    Hello, I'm trying to create api gateway connected to lambda with alias , and here it says only allowed method is
    any
    but it looks like when api invokes lambda only allowed method is
    POST
    is that so? I'm getting error from AWS api Unable to put integration on 'ANY' for resource at path '/': Integrations of type 'AWS_PROXY' currently only supports Lambda function and Firehose stream invocations. here is my SO question https://stackoverflow.com/questions/61724909/pulumi-aws-proxy-currently-only-supports-lambda-function
    f
    • 2
    • 5
  • a

    acceptable-stone-35112

    05/11/2020, 2:16 PM
    My stack runs perfectly from local, but when running inside GitHub actions, gives TS compilation error from ts-node "error TS2339: Property 'name' does not exist on type 'Promise<GetZoneResult>'" Is it due to some difference in node version?
    b
    • 2
    • 26
  • l

    little-cartoon-10569

    05/11/2020, 10:44 PM
    I have an error in my use of TypeScript modules. Apologies for asking here, not sure where I should asking TypeScript questions... From my main index.ts (which imports and uses
    @pulumi/pulumi
    ), I'm calling a function exported from my own module in a different project (brought in using "references": [{ "path": "../mypath/project"}] in my tsconfig.json). That function calls
    pulumi.runtime.registerStackTransformation()
    . That call produces this error:
    Error: The root stack resource was referenced before it was initialized.
            at Object.registerStackTransformation (/app/pulumi/node_modules/@pulumi/pulumi/runtime/stack.js:211:15)
            at Object.registerAutoTags (/app/pulumi/autotag/autotag.ts:246:20)
            at Object.<anonymous> (/app/pulumi_stacks/vpc_poc/index.ts:25:11)
            at Module._compile (internal/modules/cjs/loader.js:1133:30)
            at Module.m._compile (/app/pulumi_stacks/vpc_poc/node_modules/@pulumi/pulumi/node_modules/ts-node/src/index.ts:439:23)
            at Module._extensions..js (internal/modules/cjs/loader.js:1153:10)
            at Object.require.extensions.<computed> [as .ts] (/app/pulumi_stacks/vpc_poc/node_modules/@pulumi/pulumi/node_modules/ts-node/src/index.ts:442:12)
            at Module.load (internal/modules/cjs/loader.js:977:32)
            at Function.Module._load (internal/modules/cjs/loader.js:877:14)
            at Module.require (internal/modules/cjs/loader.js:1019:19)
    The code is good: when I lift it out of my project/module and put it directly into index.ts it works fine. I'm guessing that this is a scoping issue. Question: how do I call Pulumi code from projects/modules that are outside my application's project? Should I be passing "pulumi" or "pulumi.runtime" from my main module into my referenced project?
    g
    • 2
    • 15
  • p

    prehistoric-account-60014

    05/12/2020, 6:04 PM
    I’m running into some issues when attempting to run
    pulumi up
    in CI.
    error: no resource plugin 'kubernetes' found in the workspace or on your $PATH
    I looked into existing GitHub issues but none of the solutions posted there seems to be working out.
    w
    • 2
    • 3
  • w

    wooden-lighter-66320

    05/13/2020, 10:23 PM
    Has anybody looked into figuring out ways to prevent Pulumi from including the entire node_modules directory when generating a lambda method? That seems pretty wasteful, the serialization of the method itself appears to work great but I'm seeing tons of unused code in our deploy bundles that doesn't feel like it needs to be there.
    f
    • 2
    • 4
  • w

    wooden-lighter-66320

    05/14/2020, 8:39 PM
    Follow-on question: If I have a lambda that needs to dispatch something to a queue, which is more idiomatic: - Depend on the TS module in which the queue resource is defined, and use the ID off of that queue resource object within my lambda; or, - somehow read the queue ID off of the active Pulumi stack? I know you can do inter-stack dependencies with stack outputs, but can you do intra-stack dependencies that way? Couldn't find docs
    f
    • 2
    • 3
  • l

    lively-oil-7382

    05/15/2020, 2:40 AM
    I am trying to registerAutoTags to aws resources and getting error while running unit tests (npm test). Error: The root stack resource was referenced before it was initialized. Any pointer on what might be causing this issue?
    l
    • 2
    • 15
  • p

    prehistoric-account-60014

    05/15/2020, 7:28 PM
    When using a relative path in
    pulumi.asset.FileArchive
    , what is the path provided relative to?
    g
    • 2
    • 1
  • f

    full-dress-10026

    05/18/2020, 8:19 PM
    Is there a recommended http client? I'm not very familiar with all the options.
  • c

    curved-ghost-20494

    05/19/2020, 12:57 AM
    Hello All 🙂
  • c

    curved-ghost-20494

    05/19/2020, 12:58 AM
    Does anyone know of any "tricks" to serialize third party code that Pulumi doesn't like. I'm thinking potentially compiling myself first via babel or parcel?
    error.sh
    f
    • 2
    • 7
  • c

    curved-ghost-20494

    05/19/2020, 2:49 AM
    I cannot get past needing to reference a method on a class from another method
    class Foo {
      bar () {
       return 'bar'
      }
      baz () {
       return this.bar()
      }
    }
    l
    f
    • 3
    • 2
  • c

    colossal-room-15708

    05/23/2020, 7:25 AM
    In which cases would I use
    require()
    and when
    requireSecret()
    ? From an end result point of view it seems identical. The secrets from the config are marked as
    [secret]
    no matter which one I use. However, I had issues working with
    requireSecret()
    now where it would complain that I'm not allowed to run
    toString
    on an output.
    const logAnalyticsWorkspacePrimarySharedKey = config.requireSecret('logAnalyticsWorkspacePrimarySharedKey').apply(s => s);
    This is later on used as
    protectedSettings: `{"workspaceKey": "${logAnalyticsWorkspacePrimarySharedKey}"}`,
    And that gives me the following:
    protectedSettings      : "\"{\\\"workspaceKey\\\": \\\"Calling [toString] on an [Output<T>] is not supported.\\n\\nTo get the value of an Output<T> as an Output<string> consider either:\\n1: o.apply(v => `prefix${v}suffix`)\\n2: pulumi.interpolate `prefix${v}suffix`\\n\\nSee <https://pulumi.io/help/outputs> for more details.\\nThis function may throw in a future version of @pulumi/pulumi.\\\"}\""
    f
    • 2
    • 2
  • s

    stocky-island-3676

    05/25/2020, 11:58 AM
    How can I suppress the stacktrace when I (intentionally) throw an error?
    l
    g
    • 3
    • 7
  • a

    ancient-megabyte-79588

    05/27/2020, 10:19 PM
    Good day Typescript peeps.. I'm having trouble doing an
    npm install @pulumi\pulumi
    .. I'm getting this error at the end of a long output
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! grpc@1.24.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the grpc@1.24.2 install script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\vigil\AppData\Roaming\npm-cache\_logs\2020-05-27T22_01_30_596Z-debug.log
    l
    • 2
    • 2
  • a

    ancient-megabyte-79588

    05/27/2020, 10:21 PM
    npm install -g @pulumi\pulumi
    works though
  • a

    ancient-megabyte-79588

    05/27/2020, 10:22 PM
    The problem seems to be with
    gyp
    or`node-pre-gyp` ..
  • b

    billowy-army-68599

    05/27/2020, 11:02 PM
    @ancient-megabyte-79588 what version is in your package.json? Never versions of pulumi no longer need that grpc package
  • a

    ancient-megabyte-79588

    05/28/2020, 12:23 AM
    "dependencies": {
            "@pulumi/azure": "^2.0.0",
            "@pulumi/azuread": "^1.8.0",
            "@pulumi/kubernetes": "^1.6.0",
            "@pulumi/pulumi": "^1.0.0"
        }
  • a

    ancient-megabyte-79588

    05/28/2020, 12:24 AM
    This project isn't that old.. I last touched it about a month ago... I'll update all of the packages and try again
  • a

    ancient-megabyte-79588

    05/28/2020, 12:26 AM
    @billowy-army-68599 That seemed to resolve my problem! Thanks!
  • a

    ancient-megabyte-79588

    05/28/2020, 12:26 AM
    Where do we find a list of the latest npm packages?
  • b

    billowy-army-68599

    05/28/2020, 12:37 AM
    this is your best bet https://www.npmjs.com/search?q=%40pulumi
    👍 1
  • v

    victorious-vase-44805

    05/28/2020, 8:56 AM
    Morning all, does anyone have any idea how to access the Nat IP of a newly created Google Compute instance?
    let instance = new gcp.compute.Instance(instanceName, {
        bootDisk: {
          initializeParams: {
            image: "projects/centos-cloud/global/images/centos-7-v20200521"
          }
        },
        machineType: "n1-standard-2",
        networkInterfaces: [
          {
            accessConfigs: [{
              networkTier: "STANDARD",
            }],
            network: "default",
          },
        ]
      }, { dependsOn: dependsOn })
    I unfortunately for the life of me can’t work out how to do it.
    g
    • 2
    • 2
  • s

    steep-angle-29984

    05/28/2020, 10:53 AM
    If I perform an
    apply()
    on an
    Output
    of a resource, shouldn't the callback only be called when the resource is created and the value is available when doing a
    pulumi preview
    ?
    b
    • 2
    • 3
Powered by Linen
Title
s

steep-angle-29984

05/28/2020, 10:53 AM
If I perform an
apply()
on an
Output
of a resource, shouldn't the callback only be called when the resource is created and the value is available when doing a
pulumi preview
?
b

bland-telephone-59986

05/28/2020, 10:57 AM
From the docs for apply function - “This function will only be called execution of a ‘pulumi up’ request. It will not run during ‘pulumi preview’ (as the values of resources are of course not known then). It is not available for functions that end up executing in the cloud during runtime. To get the value of the Output during cloud runtime execution, use get().”
👍 1
s

steep-angle-29984

05/28/2020, 11:04 AM
Ok thanks, so I must have been doing something wrong here. I'm creating a
k8s.core.v1.Service
resource and calling apply on it's
metadata.name
property, which is an
Output
. If I run
pulumi preview
the callback gets called with
undefined
as value. Am I understanding something wrong here?
Sorry, forget it. I misused deepmerge somewhere in between which caused my problem.
View count: 1