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

    curved-summer-41191

    01/08/2021, 9:51 PM
    Has anyone seen an error like this with child resources? https://pulumi-community.slack.com/archives/CRFUR2DGB/p1610141616116000
  • p

    prehistoric-nail-50687

    01/11/2021, 4:03 PM
    How do I convert
    pulumi.Output<any>
    to
    pulumi.Output<string>
    when getting an output from a
    StackReference
    ?
    const infra = new pulumi.StackReference(`infra`);
    const dbUser = infra.getOutput("dbUser"); // is of type pulumi.Output<any> but should be pulumi.Output<string>
    do I really have to do this?:
    const dbUser = infra.getOutput("dbUser") as pulumi.Output<string>;
    b
    • 2
    • 3
  • b

    breezy-butcher-78604

    01/12/2021, 1:17 AM
    is there a recommended way to validate/infer the type of a stack output when referring to it from another stack? for example i have a VPC stack that outputs an array of subnet IDs that I grab with a stack reference like so:
    const stackRef = new pulumi.StackReference("vpc/dev");
    
    const subnetIds = stackRef.requireOutput("subnetIds");
    given the above,
    subnetIds
    will be of type
    Output<any>
    but I want to be able to loop over the values because I need to create a resource for each subnet. is creating the resources inside an
    apply()
    the only option? it seems weird not being able to directly access the values since stack outputs should always be known prior to a
    pulumi up
    or
    preview
    right?
    l
    • 2
    • 8
  • a

    adventurous-lighter-33507

    01/12/2021, 7:22 PM
    @here, i am trying to use the new relic pulumi provider in a docker container. it works fine in my host, but in the container it throws this error:
    ▼ pulumi preview
    Previewing update (dev) View Live: https://app.pulumi.com/adamstortz/pulumi-new-relic/dev/previews/593c311f-f632-4713-87ea-b0077b6e0801 Type Name Plan Info + pulumi😛ulumi:Stack pulumi-new-relic-dev create └─ pulumi😛roviders:newrelic default_3_9_0 1 error Diagnostics: pulumi😛roviders:newrelic (default_3_9_0): error: failed to load plugin /root/.pulumi/plugins/resource-newrelic-v3.9.0/pulumi-resource-newrelic: fork/exec /root/.pulumi/plugins/resource-newrelic-v3.9.0/pulumi-resource-newrelic: exec format error
    b
    • 2
    • 2
  • a

    adventurous-lighter-33507

    01/12/2021, 7:23 PM
    has anyone seen anything like this before?
  • q

    quiet-tomato-48326

    01/13/2021, 9:16 AM
    Quick question: where should I start looking if pulumi up exits part way through preview with exit code 255. No error message, it just exits
    c
    • 2
    • 5
  • q

    quiet-wolf-18467

    01/15/2021, 2:34 PM
    I’m working with some types generated by
    crd2pulumi
    and noticing that the
    apiVersion
    is defined as such:
    readonly apiVersion: pulumi.Output<"<http://cluster.x-k8s.io/v1alpha3|cluster.x-k8s.io/v1alpha3>" | undefined>;
    I’m struggling to use this with other resources, however it does work if I change the generated line to
    readonly apiVersion: pulumi.Output<"<http://cluster.x-k8s.io/v1alpha3|cluster.x-k8s.io/v1alpha3>"> | undefined;
  • q

    quiet-wolf-18467

    01/15/2021, 2:34 PM
    Is this a bug in crd2pulumi, or am I doing something wrong?
    • 1
    • 1
  • f

    future-hydrogen-91224

    01/15/2021, 8:42 PM
    Hi - new to Pulumi and trying out typescript and python examples. Had a question on pulumi new. It creates the node_modules in the same directory as project. Is there a way to install the node_modules where node installs and installs other modules? I understand it is part of .gitignore. Perhaps there is a way to call it so t lets node do the necessary installs wherever it needs to? Thanks for your help!
    g
    l
    • 3
    • 8
  • a

    adamant-translator-31969

    01/18/2021, 7:42 PM
    Hi! I imported a Vpc as part of another Custom Object A. I want to use this vpn (now a property of my object A) as input to other object. is it possible?
    l
    c
    • 3
    • 20
  • b

    bland-byte-34481

    01/20/2021, 7:55 PM
    Hello - i'm seeing the following when I add (and try to use) @pulumi/okta in my typescript project - the only resolve i've found is just removing the dependency entirely:
    error: Running program '/Users/simon/workspace/aws-typescript/sample-full-infrastructure' failed with an unhandled exception:
        TypeError: pulumi.runtime.registerResourceModule is not a function
            at Object.<anonymous> (/Users/simon/workspace/aws-typescript/node_modules/@pulumi/app/index.ts:75:16)
            at Module._compile (internal/modules/cjs/loader.js:999:30)
            at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
            at Module.load (internal/modules/cjs/loader.js:863:32)
            at Function.Module._load (internal/modules/cjs/loader.js:708:14)
            at Module.require (internal/modules/cjs/loader.js:887:19)
            at require (internal/modules/cjs/helpers.js:74:18)
            at Object.<anonymous> (/Users/simon/workspace/aws-typescript/node_modules/@pulumi/index.ts:13:1)
            at Module._compile (internal/modules/cjs/loader.js:999:30)
            at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    b
    • 2
    • 5
  • l

    little-cartoon-10569

    01/21/2021, 12:28 AM
    Are there any plans to update the built-in typescript support?
    b
    p
    • 3
    • 19
  • r

    rhythmic-fireman-45324

    01/21/2021, 3:44 AM
    Hi, #aws #typescript I am a serveless user and new to Pulumi. In serverless, plugins like sls-webpack and sls-bundle are encouraged to be used for optimizing and bundling lambda functions & dependencies. In Pulumi how should I handle it elegantly? Any best practice or plugins?
    b
    • 2
    • 7
  • r

    rhythmic-fireman-45324

    01/21/2021, 1:57 PM
    #aws #typescript Is there any reason for getRemainingTimeInMillis() to return string?
  • r

    rhythmic-fireman-45324

    01/21/2021, 1:58 PM
    In AWS doc it returns number.
  • a

    adamant-translator-31969

    01/22/2021, 8:29 PM
    Hi guys! I have a question... I want to migrate my existing vpc created with aws.ec2.vpc to awsx.ec2.vpc ... somebody could help me?
    b
    • 2
    • 8
  • p

    prehistoric-kite-30979

    01/24/2021, 4:24 PM
    Is there a way to go from an
    Output<string[]>
    to
    Input<string>[]
    ?
    c
    • 2
    • 5
  • a

    adamant-translator-31969

    01/25/2021, 5:32 PM
    Hi! How can I add trigger to my lambda function? more specifically a SQS trigger
    b
    b
    • 3
    • 8
  • b

    bland-byte-34481

    01/25/2021, 7:41 PM
    Hello! How can I pass outputs to create a file based BucketObject? My example code looks like the following:
    export const bucketObjectWithInput = (bucket: Bucket, param: pulumi.Input<string>, param2: pulumi.Input<string>) => {
        const output: Output<string> = pulumi.all([
            param2,
            param2
        ]).apply<string>(async (args) => {
            const [
                param,
                param2
            ] = args;
            return JSON.stringify({
                param,
                param2
            });
        });
        const outputPromise = new Promise<string>(resolve => output.apply(resolve));
        const asset = new StringAsset(outputPromise);
        const bucketObject = new BucketObject("uniqueName", {
            bucket,
            source: asset,
        });
    }
    • 1
    • 1
  • c

    colossal-australia-65039

    01/25/2021, 9:27 PM
    Is it possible to store encrypted secrets with the automation API? or is that not supported? the examples have them as code in plaintext
    g
    • 2
    • 1
  • b

    bland-byte-34481

    01/26/2021, 11:57 PM
    is there any setting / env variable that will let me know when the program is running in preview mode?
    l
    • 2
    • 2
  • p

    prehistoric-kite-30979

    01/27/2021, 4:36 PM
    I'm following along with (copy-pasting from) https://github.com/joeduffy/aws-tags-example/tree/master/autotag-ts. And am hitting the
    root stack was referenced before it was initialzed
    error. https://github.com/pulumi/pulumi/blob/master/sdk/nodejs/runtime/stack.ts#L218
    b
    l
    • 3
    • 31
  • q

    quiet-hairdresser-18834

    01/27/2021, 5:24 PM
    I am struggling with inputs / outputs or just my general understanding
    let agwConfig: azure.network.ApplicationGatewayArgs = {
            name: agwName,
            resourceGroupName: resourceGroup.name,
            autoscaleConfiguration: {
                        minCapacity: appGatewayAutoScaleMinimumInstanceCount,
                        maxCapacity: appGatewayAutoScaleMaximumInstanceCount 
            }
            //... more code here
       }
    If I wanted to optionally have the autoscaleConfiguration not be set to anything, how can I do that? I tried clearing it after with
    if (!useAppGateayAutoScale)
        {
            agwConfig.autoscaleConfiguration = null;
        }
    but it gives me an error that the property is readonly so it can not be changed
    w
    • 2
    • 3
  • i

    incalculable-engineer-92975

    01/28/2021, 2:39 PM
    When we run Pulumi in our build pipelines it keeps trying to compile grpc. We assume it's a mismatch between the version of Pulumi running and the Typescript dependency versions, e.g., '@pulumi/aws', etc. Anyone have any guidance here?
    e
    • 2
    • 1
  • a

    adamant-translator-31969

    02/01/2021, 10:06 PM
    Hi! I have this error
    error configuring Terraform AWS Provider: Error creating AWS session: SharedConfigErr: only one credential type may be specified per profile: source profile, credential source, credential process, web identity token, or sso
    when I try to create rds.Instance ...someone could help me?
    l
    • 2
    • 2
  • p

    proud-pizza-80589

    02/02/2021, 1:58 PM
    Is it possible to check if
    someStack.getOutput(identifier);
    exists or not? The typescript output is an Output<any> but the text docs say that it can be undefined.
    b
    • 2
    • 2
  • a

    adventurous-lighter-33507

    02/03/2021, 5:33 PM
    I am attempting to create a New Relic One Dashboard with the provider that was released a little bit ago. Here is my code:
    import { OneDashboard, OneDashboardArgs } from "@pulumi/newrelic";
    import { OneDashboardPage } from "@pulumi/newrelic/types/input";
    import { CustomResourceOptions } from "@pulumi/pulumi";
    
    const page1: OneDashboardPage = {
      name: "page1",
    };
    
    const oneDashArgs: OneDashboardArgs = {
      name: "sample dashboard",
      pages: [page1],
    };
    const oneDashOptions: CustomResourceOptions = {};
    
    const oneDash = new OneDashboard("my-one-dashboard", oneDashArgs, oneDashOptions);
    I get this error:
    error: Argument "dashboard" has invalid value $dashboard.
        In field "pages": Expected type "[DashboardPageInput!]!", found [{name: "page1"}].
        In element #1: Expected type "DashboardPageInput", found {name: "page1"}.
        In field "widgets": Expected type "[DashboardWidgetInput!]!", found null.
    It seems like there may be a mismatch between the New Relic One GraphQL API and the provider. Am I doing something wrong?
    👀 1
    c
    • 2
    • 2
  • b

    bland-lamp-16797

    02/11/2021, 11:00 AM
    Ok, I'm spending lot of time on this... I use internal package for reusing cloud components. The problem is that I get weird error when I try to import
    error: Running program '/Users/confiq/work/xxx/pulumi' failed with an unhandled exception:
        /Users/confiq/work/wave-xxx-service/pulumi/node_modules/xxx-pulumi/index.ts:1
        import * as pulumi from "@pulumi/pulumi";
               ^
    
        SyntaxError: Unexpected token *
            at Module._compile (internal/modules/cjs/loader.js:723:23)
            at Module._extensions..js (internal/modules/cjs/loader.js:789:10)
            at Object.require.extensions.(anonymous function) [as .ts] (/Users/confiq/work/wave-xxx-service/pulumi/node_modules/ts-node/src/index.ts:431:14)
            at Module.load (internal/modules/cjs/loader.js:653:32)
    If I take same file and use it as non-package, it works. This is probably beyond my knowledge of typescript/javascript but did anyone have something similar? Somehow pulumi think this is javascript but it's definitely typescript and I don't want to downgrade 😞
    g
    • 2
    • 4
  • f

    future-nail-59564

    02/12/2021, 3:18 PM
    Hey folks, quick question: How can I convert an actual string into an
    Output<string>
    ? I have a custom component that returns a string output: in some cases it will return an output from a child resource, but in some cases the value will be known immediately/synchronously and I want to return it in the same output property. What’s the simplest syntax to return such a string as output?
    w
    m
    l
    • 4
    • 4
  • a

    adventurous-lighter-33507

    02/12/2021, 8:25 PM
    Hey all, I am trying to create a new relic one dashboard with a pie chart. Here is my code:
    import { OneDashboard, OneDashboardArgs } from "@pulumi/newrelic";
    import { OneDashboardPage, OneDashboardPageWidgetPy } from "@pulumi/newrelic/types/input";
    const pieWiget: OneDashboardPageWidgetPy = {
      column: 1,
      height: 3,
      row: 4,
      width: 4,
      nrqlQueries: [
        {
          accountId: 399786,
          query:
            "...",
        },
      ],
      title: "filter envs",
    };
    const page1: OneDashboardPage = {
      name: "Deployments",
      description: "Current deployments by environment",
      widgetPies: [pieWiget],
    };
    
    const deploymentsDashboardArgs: OneDashboardArgs = {
      name: "Deployments Dashboard",
      pages: [page1],
    };
    
    new OneDashboard("deployments", deploymentsDashboardArgs);
    I am getting the following error:
    error: newrelic:index/oneDashboard:OneDashboard resource 'deployments' has a problem: page.0: invalid or unknown key: widget_pies
    w
    • 2
    • 5
Powered by Linen
Title
a

adventurous-lighter-33507

02/12/2021, 8:25 PM
Hey all, I am trying to create a new relic one dashboard with a pie chart. Here is my code:
import { OneDashboard, OneDashboardArgs } from "@pulumi/newrelic";
import { OneDashboardPage, OneDashboardPageWidgetPy } from "@pulumi/newrelic/types/input";
const pieWiget: OneDashboardPageWidgetPy = {
  column: 1,
  height: 3,
  row: 4,
  width: 4,
  nrqlQueries: [
    {
      accountId: 399786,
      query:
        "...",
    },
  ],
  title: "filter envs",
};
const page1: OneDashboardPage = {
  name: "Deployments",
  description: "Current deployments by environment",
  widgetPies: [pieWiget],
};

const deploymentsDashboardArgs: OneDashboardArgs = {
  name: "Deployments Dashboard",
  pages: [page1],
};

new OneDashboard("deployments", deploymentsDashboardArgs);
I am getting the following error:
error: newrelic:index/oneDashboard:OneDashboard resource 'deployments' has a problem: page.0: invalid or unknown key: widget_pies
w

witty-candle-66007

02/12/2021, 8:59 PM
There may be an issue with the “pie” widget in the sdk. Do you see issues with any of the other widgets types?
a

adventurous-lighter-33507

02/12/2021, 9:05 PM
no, i have tried the rest and they seem fine
w

witty-candle-66007

02/12/2021, 9:06 PM
OK. I’m looking into the pie widget and respond once I know for sure.
👍 1
As suspected, there is an bug with the “pie” widget. I opened this issue: https://github.com/pulumi/pulumi-newrelic/issues/175
a

adventurous-lighter-33507

02/12/2021, 10:52 PM
great. thanks
View count: 2