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

    purple-application-23904

    10/05/2021, 6:04 PM
    Hey all, running into this issue with the Typescript automation API:
    (node:22099) UnhandledPromiseRejectionWarning: Error [ERR_INSPECTOR_NOT_AVAILABLE] [ERR_INSPECTOR_NOT_AVAILABLE]: Inspector is not available
        at inspector.js:25:9
        at NativeModule.compileForInternalLoader (internal/bootstrap/loaders.js:277:7)
        at NativeModule.compileForPublicLoader (internal/bootstrap/loaders.js:219:10)
        at loadNativeModule (internal/modules/cjs/helpers.js:26:9)
        at Function.Module._load (internal/modules/cjs/loader.js:679:15)
        at Module.require (internal/modules/cjs/loader.js:887:19)
        at Module.require (pkg/prelude/bootstrap.js:1719:31)
        at require (internal/modules/cjs/helpers.js:74:18)
        at /snapshot/thin-cli/out/cloudcc.js:0
        at processTicksAndRejections (internal/process/task_queues.js:97:5)
    (node:22099) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see <https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode>). (rejection id: 1)
    (node:22099) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
    Which happens when I call
    LocalWorkspace.create
    . I didn't see anything in issues with this error so I'm not sure if this is something on my side or not. More details in thread
    r
    • 2
    • 4
  • c

    calm-nest-80923

    10/06/2021, 9:52 AM
    Hello all, I’m having a weird issue with pulumi preview - it fails without an error message. Please note, this is running on compiled ts code, not TS directly, as we’ve had issues with ts-node vs typescript compilation discrepancies. The code works perfectly fine with ts, and with
    pulumi preview
    . I’m trying to find out why
    Resources:
        ~ 1 to update
        12 unchanged
    
    
    Previewing update (MY_ORG/testing)
    
    
    View Live: <https://app.pulumi.com/MY_ORG/pspdfkit/testing/previews/08b5eb87-3c10-4426-82a4-b26f9290b4aa>
    
    
     
    
    MY_ORG/pspdfkit/testing preview failed (see errors in the pulumi update)
    Previewing update (MY_ORG/testing)
    
    
    View Live: <https://app.pulumi.com/MY_ORG/scan-upload/testing/previews/76289495-f575-4159-b68b-95cebac8bb60>
    
    
    Error: ENOENT: no such file or directory, stat '/tmp/automation-logs-preview-A5gUeo/eventlog.txt'
    Is there a way to enable verbose logging via an ENV var for Pulumi? Or how do you set verbose logging via the node / ts sdk? Issue does not seem to be related to: https://github.com/pulumi/pulumi/issues/6768 - which is the only issue I’ve found to have similar logs. Interestingly, only 2 services fail, the others work…
  • l

    loud-bear-51491

    10/06/2021, 4:16 PM
    Hi.. I am trying to run a piece of code to create a group when account id of aws is xxx and i get an error on my ci saying
    infra/groups.ts(6,14): error TS2322: Type 'Promise<string>' is not assignable to type 'string'.
    here is the code
    const current = aws.getCallerIdentity({});
    export const accountId: string = current.then(current => current.accountId);
    
    if (accountId == "xxx") { 
    
    const devops = new aws.iam.Group("devops", {
        name: "devops-users",
        path: "/",
    });
    
    }
    s
    l
    • 3
    • 2
  • r

    refined-appointment-5884

    10/08/2021, 3:58 AM
    message has been deleted
  • b

    bland-camera-22041

    10/08/2021, 8:29 AM
    I quite like this format
    const projectName = (params: TemplateStringsArray) =>
      `hello-world-${stage}-${String.raw(params)}`;
    And use like so in my resources
    const resourceGroup = new azure.resources.ResourceGroup(projectName`rg`, {
      resourceGroupName: `Hello-World-${stage}`,
      location: azure.migrate.AzureLocation.UkSouth,
    });
    Will generate a URN like
    hello-world-dev-rg
  • q

    quaint-electrician-41503

    10/10/2021, 6:52 AM
    Probably should have asked here: https://pulumi-community.slack.com/archives/C84L4E3N1/p1633831926471500
  • a

    able-planet-19148

    10/12/2021, 2:31 PM
    What’s the best way to break resources into multiple files? Any pulumi recommended way or use Typescript exports?
    b
    l
    • 3
    • 2
  • w

    wet-noon-14291

    10/13/2021, 10:40 AM
    Anyone that has experienced this: https://pulumi-community.slack.com/archives/C84L4E3N1/p1634045972043000 ?
  • b

    brave-nightfall-19158

    10/13/2021, 3:39 PM
    Hey y'all. I've got this issue regarding output and I just can't figure it out. I've used .apply elsewhere but here it doesnt work..pseudo code only fyi I have a custom component resource that exports a class var.
    export _class_ CustomResource extends ComponentResource {
    public resourceArn(): Output<_string_> {
    return this.resource.arn;
    }
    }
    and then I instantiate:
    _const_ service = new CustomResource(...);
    const service2 = new CustomResource2('name', {
    arn: service.resourceArn
    });
    However, I'm getting the dreaded Output/input problem because the export is a Pulumi Output (see attached screenshot). I also tried to service.resourceArn.apply() but that didn't seem to work either. Question - Do I need to wrap the entire of service2 in the pulumi.all/apply function?
  • b

    brave-nightfall-19158

    10/13/2021, 3:39 PM
    If anyone could help.. much appreciated 😍
  • b

    brave-nightfall-19158

    10/13/2021, 3:41 PM
    The reason I'm confused, is because with standard resources, I can pass the variables between eachother, e.g. screenshot attached, and it does not present problems.
  • b

    brave-nightfall-19158

    10/13/2021, 3:42 PM
    But I guess it's because the input argument must be a string. I also tried changing to allow an Output string as the input but that didn't work either
  • s

    steep-toddler-94095

    10/13/2021, 4:10 PM
    the type you're seeing isn't an
    Output<string>
    it's a
    function that returns Output<string>
    . you need to either call the function or change the class method to a
    get
    . I.e. for the latter:
    export class CustomResource extends ComponentResource {
        public get resourceArn(): Output<string> {
            return this.resource.arn;
        }
    }
    🙌 2
    b
    • 2
    • 2
  • q

    quaint-electrician-41503

    10/13/2021, 5:55 PM
    https://github.com/pulumi/pulumi-aws/issues/1665
  • q

    quaint-electrician-41503

    10/13/2021, 5:56 PM
    https://github.com/pulumi/pulumi-aws/issues/1666
  • q

    quaint-electrician-41503

    10/13/2021, 5:56 PM
    ^^ Both issues using typescript
  • q

    quaint-electrician-41503

    10/14/2021, 1:34 AM
    Does anyone have a typescript example that creates the lambda logic in a separate node project, and then imports it like approach 2: https://www.pulumi.com/blog/easy-serverless-apps-and-infrastructure-real-events-real-code/#approach2-manual-function-resources . I think this would possibly allow me to work around the above issues. But I can't find a complete example like this
  • e

    echoing-actor-55539

    10/14/2021, 3:50 AM
    does anybody have an example of an api-gateway mock integration?
    b
    • 2
    • 2
  • d

    dry-football-2639

    10/14/2021, 8:18 PM
    jose
  • r

    refined-terabyte-65361

    10/14/2021, 9:38 PM
    Hello I am trying to create addon to existing eks cluster but when i try to import the addon i get below error https://www.pulumi.com/docs/reference/pkg/aws/eks/addon/#import
    error: Preview failed: unrecognized resource type (Read): aws:eks/addon:Addon
    How to fix this ?
    b
    • 2
    • 6
  • o

    orange-kite-80991

    10/17/2021, 6:00 AM
    When building a Docker Image, my args & env values are not showing up in the docker build environment. My Pulumi code:
    export const dockerImage = new docker.Image( appName,  {              
        imageName,
        registry: infra.dockerRegistry,
        build: {
          context,
          env: {
            TEST_PARAM_SIMPLE: 'SimpleParam Value',
            TEST_PARAM_SECRET: `config secret ${config.get('test_param_secret')}`,
          },
          args: {
            TEST_PARAM_PULUMI: `from config ${config.get('test_param_pulumi')}`,
          }
    }})
    And at the other end in my Dockerfile
    RUN echo "SIMPLE=$TEST_PARAM_SIMPLE" > test_env_settings
    RUN echo "PARAM=$TEST_PARAM_PULUMI" > test_env_settings
    RUN echo "Secret=$TEST_PARAM_SECRET" > test_env_settings
    RUN env > all_env1
    None of my TEST... params show up in any of the outputs. Am I using the wrong incantations?
    c
    b
    • 3
    • 5
  • r

    refined-terabyte-65361

    10/20/2021, 7:13 PM
    Hello I am trying to create add-on to eks cluster https://www.pulumi.com/docs/reference/pkg/aws/eks/addon/#resolveconflicts_nodejs I was able to create addon using this
    const eksAddon = new aws.eks.Addon("eksAddon", {
        addonName: "coredns",
        clusterName: prefix,
        resolveConflicts: "OVERWRITE",
        addonVersion: addonVersion,
      });
    If i want to create multiple addons should create them separately ? I tried line below but it dint work
    const example = new aws.eks.Addon("example", {
        clusterName: aws_eks_cluster.example.name,
        addonName: "vpc-cni","coredns"
    });
    l
    • 2
    • 1
  • r

    refined-terabyte-65361

    10/20/2021, 8:05 PM
    How to unprotect a resource I set protect: true, to one of my resource now its preventing me from upgrading to latest version i tried setting protect: false but still update fails
    error: Preview failed: unable to delete resource "urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon"
        as it is currently marked for protection. To unprotect the resource, either remove the `protect` flag from the resource in your Pulumi program or use the command:
        `pulumi state unprotect urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon`
    i dont have access to run
    pulumi state unprotect urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon
    is it possible to fix this without running
    pulumi state unprotect urn:pulumi:raj-eks::eks::aws:eks/addon:Addon::eksAddon
    l
    • 2
    • 8
  • r

    refined-terabyte-65361

    10/20/2021, 10:05 PM
    Hello I am trying to rerun pulumi up but i get below error
    aws:eks:Addon (coredns):
    
        error: 1 error occurred:
    
        	* error creating EKS Add-On : ResourceInUseException: Addon already exists.
    
        {
    
          RespMetadata: {
    
            StatusCode: 409,
    
            RequestID: "4c48c30e-3c0d-43d3-aa0b-2cca66f8335d"
    
          },
    
          Message_: "Addon already exists."
    
        }
    earlier i created resource from pulumi itself and pulumi state refelcts that resource already exists I was expecting if the resource exists its should not complain that resource already exists
    l
    • 2
    • 14
  • s

    sparse-student-54516

    10/22/2021, 12:28 PM
    Hi, I am trying to set admin password and also GitHub auth provider for rancher using typescript. I am using below code after converting it from terraform. What could be the issue? I am getting following error:
    error: Rancher is not ready: Doing get: Get "<https://65.21.242.158/ping>": dial tcp 65.21.242.158:443: connect: connection refused
    const bootstrap = new rancher2.Provider("bootstrap", {
        apiUrl: rancherUrl,
        bootstrap: true,
        insecure: true,
    });
    
    
    const admin = new rancher2.Bootstrap("admin", {
        password: "focuswow",
        telemetry: true,
    }, {
        provider: bootstrap,
        dependsOn: [rancherServer],
    });
    
    
    const github = new rancher2.AuthConfigGithub("github", {
        clientId: "<CLIENT_ID>",
        clientSecret: "<CLIENT_SECRET>",
    }, {
        provider: bootstrap,
        dependsOn: [admin],
    });
    b
    • 2
    • 22
  • s

    sparse-student-54516

    10/27/2021, 11:24 AM
    Hi, Can you we divide the pulumi code from a single file
    e.g. index.ts
    -> multiple file
    e.g network.ts, server.ts, storage.ts
    ?
    m
    • 2
    • 5
  • s

    sparse-student-54516

    10/27/2021, 2:53 PM
    Hello, I am getting below error when trying set
    initialPassword
    as args for below:
    b
    • 2
    • 22
  • s

    sparse-student-54516

    10/27/2021, 2:54 PM
    Altought documentation mentions it can used as an argument:
  • l

    limited-rainbow-51650

    10/27/2021, 8:09 PM
    As long as one can create resources and pass outputs between them, my coding goes fine and smooth. But for the n-th time, I'm struggling when I have to mix in a get function. Context: I have a regular Javascript function creating, first calling a get function and based on the output, creating 2 resources and returning me a
    Promise
    which I used correctly in my code. So far so good. I'm now trying to convert that function to a
    pulumi.ComponentResource
    subclass, where I have the get function and the resource creation as well. But in that move, it seems I broke the setup for correct async processing. When I try to refer to the outputs of my
    ComponentResource
    , they still seem to be
    undefined
    . Each output in my component is an output from each of the 2 child resources. Does anyone have an example of a
    ComponentResource
    which mixes a get function, resource creation based on the fetched info and exposing outputs on the component class?
    l
    b
    e
    • 4
    • 22
  • l

    limited-rainbow-51650

    10/27/2021, 9:04 PM
    Making progress... Something else: my component resource creates Kubernetes and GCP child resources. In the
    ComponentResourceOptions
    , I can optionally pass a map of providers. How should I pass these to the child resources? Any good example for that?
Powered by Linen
Title
l

limited-rainbow-51650

10/27/2021, 9:04 PM
Making progress... Something else: my component resource creates Kubernetes and GCP child resources. In the
ComponentResourceOptions
, I can optionally pass a map of providers. How should I pass these to the child resources? Any good example for that?
View count: 1