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

    little-cartoon-10569

    09/17/2020, 3:07 AM
    Is there a recommended way to import awsx SecurityGroups and their related rules? I'm trying to refactor resources from awsx code in one project to another project, and I'm not sure it's possible.
    • 1
    • 1
  • a

    astonishing-tiger-81216

    09/17/2020, 11:51 AM
    Hi, I’m pondering on whether to upgrade the pulumi/aws package but I’m worried about breaking the stack. Package        Current  Wanted  Latest  Package Type   URL                           @pulumi/aws 1.21.0 1.31.0 3.2.1 dependencies https://pulumi.io Reason being, I’m trying to instantiate an
    aws.wafv2
    object which doesn’t appear to be present in my current version.   Has anyone done this before? Did it go well?
    g
    • 2
    • 2
  • n

    nutritious-flower-51098

    09/23/2020, 3:50 PM
    We’re using StackReference in one of the projects to configure kubernetes provider. That cluster was recreated. The problem is that StackReference is still referring to the old provider config, and now it cannot configure itself as IP has changed. Is this a bug or expected behaviour, and is there a way of refreshing that stale StackReference?
    b
    h
    • 3
    • 4
  • c

    clean-breakfast-29827

    09/23/2020, 10:44 PM
    Hello, I have some possibly stupid questions, setting up a very basic example
    graphql
    example, started with
    awsx.apigateway.API
    but I'm wondering if I should switch to
    appsync
    https://github.com/pulumi/examples/blob/master/aws-ts-appsync/index.ts atm I'm using
    apollo-server-lambda -> new ApolloServer({ typeDefs, resolvers })
    but this is starting to feel kind of redundant anybody have any thoughts there?
    • 1
    • 1
  • m

    millions-furniture-75402

    09/28/2020, 3:22 PM
    I have application code that uses implicit super() when using a base class. When using typescript locally, that’s no problem, however when building the application with pulumi, it requires an explicit constructor in the child class. Can anyone help me understand why this is happening? explicit constructor required in the child class:
    constructor(bucketName: string) {
        super(bucketName);
      }
    f
    • 2
    • 2
  • s

    salmon-ghost-86211

    09/29/2020, 9:34 PM
    Having trouble creating an EFS Policy. Getting this error
    error: aws:efs/fileSystemPolicy:FileSystemPolicy resource 'policy' has a problem: "policy" contains an invalid JSON: invalid character '\n' in string literal
    I have copied the example exactly from here
    <https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/aws/efs/#FileSystemPolicy>
    except for fixing the invalid reference
    aws_efs_file_system.test.arn
    . I also converted the leading spaces in the policy string to tabs in case that made a difference. It didn't. pulumi: v2.10.2 pulumi aws plugin: 3.5.0 node: v12.* (tried several versions to see of that mattered) Any ideas?
    l
    b
    • 3
    • 18
  • s

    salmon-ghost-86211

    09/29/2020, 9:36 PM
    Maybe this ^^ should be in #aws instead. I just happen to be using Typescript and wasn't sure if it was some sort of Typescript syntax issue. Let me know if I should move it.
  • n

    nutritious-flower-51098

    10/07/2020, 2:05 PM
    We need to call an external library during the apply phase on a promise Output<string>. Wrapping it inside of
    pulumi.interpolate
    doesn’t help. Is there any pattern to follow for this kind of functionality?
    l
    w
    • 3
    • 4
  • a

    adamant-translator-31969

    10/09/2020, 2:08 PM
    Hi! I want to follow this guide https://www.pulumi.com/docs/guides/testing/unit/ but when i run
    mocha -r ts-node/register ec2tests.ts
    with mocha this message appears
    ERROR: Error: Cannot find module 'ts-node/register'
    Require stack:
    l
    • 2
    • 3
  • n

    numerous-psychiatrist-20856

    10/13/2020, 7:34 AM
    Hello everyone! I’m having a bit of trouble with concatenating two arrays of key value pairs. The container definition already has environment vars defined as
    pulumi.Input<KeyValuePair[]>
    and also want to add some extra variables to that array, but not sure how to correctly work with the input types to be able to concat two arrays at the end
    g
    • 2
    • 3
  • n

    numerous-psychiatrist-20856

    10/13/2020, 7:34 AM
    can someone point me to the relevant documentation/example?
  • a

    adamant-translator-31969

    10/13/2020, 3:27 PM
    Hello everyone! How can I convert an Output<string> to a string?
    g
    • 2
    • 1
  • c

    calm-greece-42329

    10/15/2020, 7:23 PM
    is there a way to update values in resources after they are defined? im writing a library that will generate a new resource that includes some sub resources, and i want to allow users to change those sub resources
  • c

    calm-greece-42329

    10/15/2020, 7:24 PM
    for example, if i include a CloudWatch LogGroup in the returned class, i want people to be able to change the retention days, without having the parameterize everything in my new classes constructor, but
    retetionInDays
    is readonly
    g
    w
    • 3
    • 14
  • b

    brash-scientist-65555

    10/15/2020, 9:26 PM
    Hello, I'm new to pulumi and trying to create my first EC2 instance. I've attached an ebsBlockDevice to the instance and for some reason, every time I run pulumi up, I receive a notice that the ebs device needs to be replaced. Any idea why this might be occurring? Declared in this manner: rootBlockDevice: { volumeSize: 150, deleteOnTermination: false, }, ebsBlockDevices: [{ deviceName: "/dev/sdb", volumeType: "gp2", volumeSize: 2048, deleteOnTermination: false, }] Receive message that deleteOnTermination and deviceName have changed based on my understanding of what I'm seeing... ~ ebsBlockDevices: [ ~ [0]: { ~ deleteOnTermination: false => false ~ deviceName : "/dev/sdb" => "/dev/sdb" + volumeSize : 2048 + volumeType : "gp2" } ]
    l
    • 2
    • 6
  • c

    calm-greece-42329

    10/16/2020, 5:34 PM
    is there a way to do pulumi.interpolate instead of .all and .apply in https://github.com/pulumi/examples/blob/master/aws-ts-stepfunctions/index.ts#L62-L83?
    w
    • 2
    • 3
  • l

    little-cartoon-10569

    10/20/2020, 9:53 PM
    I'm using a monorepo with several Pulumi projects, each in their own directory. They share a single _node___modues_ and package.json. One of the projects deploys lambdas, and somehow back in the mists of time, it got its own package.json, presumably for building the lambda code. I'm now moving the resources into another project, and on
    pulumi up
    I'm getting ENOENT errors about a missing package.json. I could probably copy the defunct project's package.json, but I'd rather build a new one. How do I force npm or Pulumi to build a new package.json for use by the lambda-deploying code?
    • 1
    • 1
  • b

    brainy-policeman-17905

    10/21/2020, 2:41 PM
    Hi everyone I am trying to understand how Pulumi works behind the scenes particularly the
    Output
    Input
    data structure, I've run this example
    import * as pulumi from "@pulumi/pulumi";
    
    const x: pulumi.Output<string> = pulumi.output("testing")
    
    console.log(x.apply(x => x))
    I was expecting to have a
    console.log
    saying "testing" when I run
    pulumi preview
    in the terminal nut instead I got
    pulumi:pulumi:Stack (ww-pulumi-dev):
        OutputImpl {
          __pulumiOutput: true,
          resources: [Function],
          allResources: [Function],
          isKnown: Promise { <pending> },
          isSecret: Promise { <pending> },
          promise: [Function],
          toString: [Function],
          toJSON: [Function]
        }
    I guess my question is how can I output stuff to the terminal based in a
    Output
    object?
  • b

    brainy-policeman-17905

    10/21/2020, 2:43 PM
    I am sure I am missing something but I'm not really sure what that is 😞
    l
    c
    • 3
    • 9
  • a

    average-kilobyte-47828

    10/21/2020, 9:28 PM
    The policy examples in the reference use backticks to wrap json blocks. I was getting a lot of errors so I tried a JSON.stringify approach instead and it works great.
    Untitled
    💯 1
  • w

    wet-soccer-72485

    10/23/2020, 9:13 PM
    Does anyone know if it’s possible to log a message / execute some code if a resource is being updated? Something like:
    const k8sCluster = new gcp.container.Cluster();
      k8sCluster.on('update', () => {
          pulumi.log.warn(
            `NOTE: It takes upwards of 35 minutes to update the Cluster. The current timeout for updates and deletes is hardcoded and the supplied create timeout is "${clusterTimeout}"`,
            this.k8sCluster
          );
        });
    h
    • 2
    • 7
  • c

    colossal-school-15171

    10/25/2020, 2:54 AM
    I'm going through the Kubernetes Guides published by Pulumi (https://github.com/pulumi/kubernetes-guides) and getting some strange typescript errors causing failure to compile when running pulumi up. I searched here and everywhere else I can find, but nothing useful has cropped up, so I'm hoping to find some help. I've got a local minikube cluster up and running, azure cli is logged in, etc. Some pulumi up commands will work, so it's not a global problem. npm is installed, and pulumi SDK.
    $ pulumi up
    Previewing update (identity)
    
    View Live: <https://app.pulumi.com/dangersorus/k8s-az-identity/identity/previews/7d98c3c1-8011-4cef-af17-b168d33489e7>
    
         Type                 Name                      Plan       Info
     +   pulumi:pulumi:Stack  k8s-az-identity-identity  create     1 error
    
    Diagnostics:
      pulumi:pulumi:Stack (k8s-az-identity-identity):
        error: Running program '/Users/admin/Documents/workspace/k8s-cluster/01-identity' failed with an unhandled exception:
        TSError: ⨯ Unable to compile TypeScript:
        index.ts(114,39): error TS2339: Property 'objectId' does not exist on type 'Promise<GetClientConfigResult>'.
        index.ts(139,13): error TS2339: Property 'objectId' does not exist on type 'Promise<GetUserResult>'.
    
            at createTSError (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:261:12)
            at getOutput (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:367:40)
            at Object.compile (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:558:11)
            at Module.m._compile (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:439:43)
            at Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
            at Object.require.extensions.<computed> [as .ts] (/Users/admin/Documents/workspace/k8s-cluster/01-identity/node_modules/ts-node/src/index.ts:442:12)
            at Module.load (node:internal/modules/cjs/loader:948:32)
            at Function.Module._load (node:internal/modules/cjs/loader:789:14)
            at Module.require (node:internal/modules/cjs/loader:972:19)
            at require (node:internal/modules/cjs/helpers:88:18)
    and then a different error code here
    $ pulumi stack select
    Please choose a stack, or create a new one: infra
    $ pulumi up
    Previewing update (infra)
    
    View Live: <https://app.pulumi.com/dangersorus/k8s-az-infra/infra/previews/55b69106-e31c-4dc9-902a-3f804174a9cb>
    
         Type                 Name                Plan       Info
     +   pulumi:pulumi:Stack  k8s-az-infra-infra  create     1 error
    
    Diagnostics:
      pulumi:pulumi:Stack (k8s-az-infra-infra):
        error: Running program '/Users/admin/Documents/workspace/k8s-cluster/02-managed-infra' failed with an unhandled exception:
        TSError: ⨯ Unable to compile TypeScript:
        index.ts(1,24): error TS2307: Cannot find module '@pulumi/azure'.
    
            at createTSError (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:261:12)
            at getOutput (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:367:40)
            at Object.compile (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:558:11)
            at Module.m._compile (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:439:43)
            at Module._extensions..js (node:internal/modules/cjs/loader:1112:10)
            at Object.require.extensions.<computed> [as .ts] (/Users/admin/Documents/workspace/k8s-cluster/node_modules/ts-node/src/index.ts:442:12)
            at Module.load (node:internal/modules/cjs/loader:948:32)
            at Function.Module._load (node:internal/modules/cjs/loader:789:14)
            at Module.require (node:internal/modules/cjs/loader:972:19)
            at require (node:internal/modules/cjs/helpers:88:18)
    b
    • 2
    • 8
  • b

    bitter-zebra-93800

    10/26/2020, 10:14 PM
    Is node-gyp a new dependency? I am getting a bunch of errors on it with a pulumi stack that was working great.
    g
    • 2
    • 2
  • s

    stocky-helicopter-22690

    10/27/2020, 5:48 PM
    Hi everyone, here a non-dev pulumi padawan (I just clarify this because I'm noob in pulumi and TS 😅) I've read above that it is possible to import an EKS cluster using @ pulumi / eks package. I'm already did this but using @ pulumi / aws (aws.cluster("name",{},{import: id}). My question is: How I can import an EKS Cluster using @ pulumi / eks package, I understand that I can use IMPORT but it's an option of CustomResourceOption and eks.Cluster is extended from ComponentResourceOptions and when I try to use import in options I get this err message:
    Argument of type '{ import: any; }' is not assignable to parameter of type 'ComponentResourceOptions'.
      Object literal may only specify known properties, and 'import' does not exist in type 'ComponentResourceOptions'
    😿 1
    ➕ 2
    g
    • 2
    • 3
  • w

    wet-soccer-72485

    10/31/2020, 4:59 AM
    Is there a way to turn on throwing for this now?
    Calling [toString] on an [Output<T>] is not supported. To get the value of an Output<T> as an Output<string> consider either: 1: o.apply(v => `prefix${v}suffix`) 2: pulumi.interpolate `prefix${v}suffix` See <https://pulumi.io/help/outputs> for more details. This function may throw in a future version of @pulumi/pulumi.-file-run-pulumi-up an hour ago
    g
    b
    • 3
    • 4
  • m

    mysterious-portugal-46322

    11/03/2020, 9:20 AM
    Hi, what’s the best way to use add a stack validation policy, but only test a specific type of resource, i.e. all kubernetes resources?
    g
    • 2
    • 2
  • c

    creamy-traffic-12121

    11/03/2020, 2:38 PM
    How do I get a lambda using an S3 source to update its source code when a new zip file is uploaded to the bucket? Even if I push a new zip to the S3 bucket, the lambda function won't update on
    $ pulumi up
    . The bucket in question does have versioning enabled.
  • p

    proud-spoon-58287

    11/06/2020, 1:01 PM
    Hi all, I am trying to create an EKS cluster, but I got the following error:
    Diagnostics:
      pulumi:pulumi:Stack (platform-data-kafka-stage-stage):
        error: Running program '/Users/sdicola/IdeaProjects/property-xyz/platform-data-kafka-stage' failed with an unhandled exception:
        Error: providerCredentialOpts and AWS_PROFILE must be set together
    f
    • 2
    • 29
  • c

    careful-architect-87653

    11/08/2020, 2:22 PM
    Hey everyone, I have little trouble setting up config secrets. I'm getting
    Secret outputs cannot be captured by a closure.
    error. AFAIK, closure here means the code that gets serialized into Lambda? How am I supposed to access config secrets?
    c
    • 2
    • 2
  • q

    quiet-wolf-18467

    11/09/2020, 12:11 PM
    const projectID = getProject({
        projectId: config.require("projectID"),
      }).then(project => project.id);
    Why is projectID still a promise? 😂  I feel so stupid
    p
    g
    • 3
    • 2
Powered by Linen
Title
q

quiet-wolf-18467

11/09/2020, 12:11 PM
const projectID = getProject({
    projectId: config.require("projectID"),
  }).then(project => project.id);
Why is projectID still a promise? 😂  I feel so stupid
p

prehistoric-nail-50687

11/09/2020, 2:56 PM
how about this?
const projectID = await getProject({
    projectId: config.require("projectID"),
  }).then(project => project.id);
g

gorgeous-egg-16927

11/09/2020, 4:21 PM
Values returned from a Promise are also promises, just like values returned from Outputs are also Outputs. This is because these are eventual values, so they have to be awaited before they are known.
View count: 1