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

    fresh-keyboard-13188

    08/26/2022, 12:40 PM
    Hello! Could anybody chip in here plz 🙂 https://pulumi-community.slack.com/archives/C84L4E3N1/p1661501169016009
    c
    • 2
    • 9
  • s

    straight-caravan-63576

    08/30/2022, 4:04 PM
    Hi! How to get resource auto-name from URN? Is that possible.
    f
    • 2
    • 7
  • s

    steep-toddler-94095

    08/31/2022, 4:35 AM
    so far i've just been using functions for everything but recently am looking into component resources. is there a recommended way to handle breaking up the code in a component resource so i don't have a (for example) 3000 line constructor?
    l
    r
    • 3
    • 6
  • w

    worried-balloon-88673

    08/31/2022, 11:09 AM
    hi all! is it possible to get a config value from the state of my most recent deploy? so, for example, i'm storing my pulumi state in s3. one of the config values when i deploy is
    imageTag
    , which specifies the tag of a container image that i'm deploying. in my pulumi code, i'd like to read this config value to see what tag is currently deployed. is that possible?
    • 1
    • 1
  • f

    fast-island-38778

    09/02/2022, 9:54 PM
    all examples on this page are out-of-date (https://www.pulumi.com/docs/guides/crosswalk/aws/ecs/#building-and-publishing-docker-images-automatically), my dependencies versions are the following:
    "dependencies": {
            "@pulumi/aws": "^5.13.0",
            "@pulumi/awsx": "^0.40.0",
            "@pulumi/pulumi": "^3.39.1"
     }
    i also have attached an example error i was getting
    c
    • 2
    • 12
  • f

    fast-island-38778

    09/02/2022, 10:55 PM
    After deploying the ECS with an application load balancer,
    curl
    the load balancer throws this error I think my
    portMappings
    config is correct because I expose port 8080 in my Docerfile and I specify the
    containerPort
    to be 8080 in the
    portMappings
    field, e.g.
    const service = new awsx.ecs.FargateService("my-service", {
      cluster: cluster,
      taskDefinitionArgs: {
        container: {
          image: image,
          cpu: 512,
          memory: 128,
          essential: true,
          portMappings: [
            {
              containerPort: 8080,
              hostPort: 8080,
            },
          ],
        },
      },
    });
    But I noticed the application load balancer does not have any inbound rules in its security group, could this be the reason why I am getting the error?
    [2/09/22 6:42] ➜  pulumi-quickstart curl <http://nginx-lb-6040493-1557012872.us-east-1.elb.amazonaws.com>
    curl: (28) Failed to connect to <http://nginx-lb-6040493-1557012872.us-east-1.elb.amazonaws.com|nginx-lb-6040493-1557012872.us-east-1.elb.amazonaws.com> port 80 after 75034 ms: Operation timed out
    • 1
    • 1
  • f

    fast-island-38778

    09/02/2022, 11:47 PM
    i ended up using the example here instead and it worked https://github.com/pulumi/examples/tree/master/aws-ts-hello-fargate
  • g

    gentle-zoo-32137

    09/04/2022, 6:44 AM
    Is there a way to programmatically get the account/organization name for a pulumi project? I want to construct a stack reference under the same account/org without hard-coding (or configuring) the org.
    v
    l
    l
    • 4
    • 13
  • b

    breezy-laptop-42679

    09/05/2022, 4:10 PM
    Has any used cloudtrail with ses notifications for sending any changes made to aws account
    b
    • 2
    • 6
  • b

    brash-toothbrush-39078

    09/08/2022, 12:59 AM
    I'm getting the following error when trying to create a Fargate service. I think it might be something on my end but I haven't been able to find much information about it online. The error occurs in
    node_modules/@pulumi/docker.ts:115:19
    .
    error: Error: No 'docker' command available on PATH: Please install to use container 'build' mode.
    c
    • 2
    • 1
  • s

    swift-fireman-31153

    09/08/2022, 6:39 PM
    Has anyone had any issues with API gateway and deployment stages?
  • s

    swift-fireman-31153

    09/08/2022, 6:40 PM
    I am having a heck of a time on pulumi updates erroring because the stage is still being used
    • 1
    • 1
  • p

    polite-window-12946

    09/08/2022, 9:01 PM
    message has been deleted
  • f

    freezing-artist-36980

    09/11/2022, 6:42 AM
    How do I get subnet ids of a vpc?
    const vpcConnector = new awsc.apprunner.VpcConnector("vpc-connector", {
    securityGroups: [ec2SecurityGroup.id],
    subnets: [pulumi.output(vpc.getSubnetsIds)], // ERROR HERE
    });
    It shows
    1. Type 'Output<(type: VpcSubnetType) => Promise<Output<string>[]>>[]' is not assignable to type 'Input<Input<string>[]>'.
    l
    • 2
    • 1
  • t

    thousands-hairdresser-72380

    09/11/2022, 8:42 PM
    Subject: Typescript Version / Custom Runtime Issue Hello! I’m attempting to use
    zod
    in a magic function but am running into this error:
    TSError: ⨯ Unable to compile TypeScript:
        src/index.ts(286,14): error TS2589: Type instantiation is excessively deep and possibly infinite.
    It appears to be due to the bundled typescript that comes with Pulumi being incompatible with the latest version of zod. I’ve attempted to disable the built-in typescript runtime by adding the following to
    Pulumi.yaml
    runtime:
      name: nodejs
      options:
        typescript: false
    But now when I run
    pulumi up
    I get
    import * as pulumi from '@pulumi/pulumi'
        ^^^^^^
    
        SyntaxError: Cannot use import statement outside a module
    Any ideas as to how I can get around this? I’ve tried 1. creating a new typescript config with
    npx tsc --init
    and that doesn’t seem to help. 2. Setting
    "type": "module"
    in
    package.json
    3. modifying the
    target
    ,
    esModuleInterop
    , and a few other things. a. (trying anything haha) 4. Searching through the Pulumi a. Slack Logs b. Github Issues c. Source Code Any help would be greatly appreciated. Thank you!
    w
    o
    • 3
    • 5
  • a

    abundant-hair-53100

    09/13/2022, 7:22 AM
    Hei guys, I’m trying to set a policy for a lambda to run post user confirmation in cognito and I want to give it permissions to just be able to PUT in a usersTable but I get this error My code:
    const confirmUserIamRolePolicy = new aws.iam.Policy(
      'confirm-user-signup-role-policy',
      {
        policy: JSON.stringify({
          Version: '2012-10-17',
          Statement: [
            {
              Effect: 'Allow',
              Action: [DBAction.Put],
              Resource: usersTable.arn.apply((arn) => `${arn}`),
            },
          ],
        }),
      }
    )
    
    export const confirmUserIamRole = new aws.iam.Role('confirm-user-signup-role', {
      assumeRolePolicy: aws.iam.assumeRolePolicyForPrincipal({
        Service: '<http://lambda.amazonaws.com|lambda.amazonaws.com>',
      }),
      managedPolicyArns: [confirmUserIamRolePolicy.arn],
    })
    
    const confirmUserIamRolePolicyAttachment = new aws.iam.PolicyAttachment(
      'confirm-user-signup-role-policy-attachment',
      {
        policyArn: confirmUserIamRolePolicy.arn,
        roles: [confirmUserIamRole],
      }
    )
    
    export const postConfirmationLambda = new aws.lambda.CallbackFunction(
      'post-confirmation-signup-lambda',
      {
        runtime: 'nodejs14.x',
        callback: confirmUserSignupHandler,
        role: confirmUserIamRole,
        environment: {
          variables: {
            USERS_TABLE: usersTable.name,
            REGION: region,
          },
        },
      }
    )
    m
    • 2
    • 7
  • q

    quick-microphone-7801

    09/14/2022, 8:18 AM
    Hi, I've been having some pulumi issues on my Macbook M1. After some extensive googling still haven't found the issue. Does anyone here know a solution by any chance?
    a
    l
    • 3
    • 4
  • c

    curved-eye-56312

    09/14/2022, 10:58 AM
    Hi all! I have a small question regarding `Config()`class. In my
    Pulumi.<stack_name>.yaml
    file I want to declare the following object:
    <stack_name>:blobContainers:
        1:
            name: container_name1
            accessLevel: Container
        2:
            name: container_name2
            accessLevel: Blob
        3:
            name: container_name3
            accessLevel: Container
    I understand that to retrieve this object from my configuration file I need to use the following (using Typescript):
    const containers = config.requireObject("blobContainers");
    However, when I try to iterate over my object and access
    name
    for example, I am not able to due to the object's type. What is the correct way to iterate over this object?
    a
    • 2
    • 2
  • b

    bland-thailand-60821

    09/14/2022, 7:08 PM
    Diagnostics:
      pulumi:pulumi:Stack (metal-auto-dev):
        error: Running program '/Users/dsayyed/metal-auto' failed with an unhandled exception:
        TSError: ⨯ Unable to compile TypeScript:
        index.ts(20,3): error TS2322: Type 'Buffer' is not assignable to type 'string | Promise<string> | OutputInstance<string> | undefined'.
          Type 'Buffer' is not assignable to type 'string'.
    b
    • 2
    • 12
  • b

    bland-thailand-60821

    09/14/2022, 7:09 PM
    Any idea how to fix above error ?
    import * as fs from "fs";
    const userData = fs.readFileSync('foo.txt','utf8');
    userData: fs.readFileSync('./basenode.sh'),
  • b

    big-notebook-65054

    09/14/2022, 10:10 PM
    Hi Pulumi team, this might be a more general question vs TS specific, but I'll ask it here anyway. I'm attempting to create an elastic beanstalk environment resource and was curious how to define the lower level configurations. Attached is a screenshot from the AWS console showing what I'm interested in. I'm fairly certain I'm supposed to use the EnvironmentAllSetting[] field to alter define these configuration values, but there's not a ton of direct examples out there. Can someone point me in the right direction?
    l
    • 2
    • 2
  • a

    abundant-telephone-90024

    09/15/2022, 6:34 AM
    Hi! I'm trying to use the provider-ts-boilerplate to create my own provider, but I have some issues when testing the template: https://github.com/pulumi/pulumi-component-provider-ts-boilerplate/issues/34 Is there something that I'm missing? Maybe I need to use a specific pulumiCLI version to generate the provider?
  • m

    most-toothbrush-43532

    09/16/2022, 3:30 AM
    I am using
    eks.Cluster
    and I have error when
    pulumi up
    from other stack. I configured output eks.cluster kubeconfig but it seems get previous kubeconfig output. I tried this, but it's not worked.
    PULUMI_K8S_DELETE_UNREACHABLE=true pulumi refresh
    this is works.
    pulumi stackoutput kubeconfig
    but this is not work. (get previous kubeconfig)
    const eksStack = new pulumi.StackReference('organization/eks/{stack}');
    const kubeconfig = eksStack.outputs.kubeconfig;
    My pulumi CLI version is
    v3.40.0
    , and my kubernetes module version
    "@pulumi/kubernetes": "^3.21.2"
    error message belows:
    pulumi preview
    Previewing update (dev)
    
    View Live: <https://app.pulumi.com/{masked}/argocd/dev/previews/ce0cceec-7ee2-4d75-aa7b-a7f9bfc1d2f0>
    
         Type                             Name        Plan       Info
         pulumi:pulumi:Stack              argocd-dev             1 error
     +   └─ kubernetes:core/v1:Namespace  argocd-ns   create
    
    Diagnostics:
      pulumi:pulumi:Stack (argocd-dev):
        error: Error: invocation of kubernetes:helm:template returned an error: failed to generate YAML for specified Helm chart: could not get server version from Kubernetes: Get "<https://8D443680F22BAD26FCEA969006E150DC.yl4.ap-northeast-2.eks.amazonaws.com/version?timeout=32s>": dial tcp: lookup <http://8D443680F22BAD26FCEA969006E150DC.yl4.ap-northeast-2.eks.amazonaws.com|8D443680F22BAD26FCEA969006E150DC.yl4.ap-northeast-2.eks.amazonaws.com> on 127.0.0.53:53: no such host
    anyone have this issue?
    • 1
    • 2
  • a

    adventurous-television-3865

    09/20/2022, 4:56 PM
    I realize this should probably have gone here… Apologies for that. Any help would be greatly appreciated as I’m very much new to this world of IaC in TS. 🙂
  • s

    sparse-intern-71089

    09/21/2022, 4:06 PM
    This message was deleted.
  • s

    square-hair-965

    09/21/2022, 4:06 PM
    hey everyone, quick question: I frequently want to have optional infrastructure for my stacks, in this instance a cron worker auto scale group that only runs in the primary region. My problem is that I want to output all my auto scale groups using
    pulumi.all().apply()
    and you can probably see the problem I run into. Now I could just output groups as individual constants and be done with it, which I'll likely do as I only have 4-5 autoscale groups per region, but I was wondering if anyone's ever encountered this scenario and figured out a certain code pattern to make it work? As of right now my go-to solution is to output "none" strings when trying to output arns and ids of optional infrastructure.
    l
    • 2
    • 18
  • l

    lemon-monkey-228

    09/27/2022, 1:48 PM
    So we currently deploy our applications in Kubernetes with individual Pulumi projects, however I'm looking to spin up an entire new cluster for testing.
  • l

    lemon-monkey-228

    09/27/2022, 1:49 PM
    Is there any mechanism in Pulumi for slurping in other projects, or should I just rely on the language's features (TypeScript) - ie. export all resources from a single place and import them using this master stack
    l
    • 2
    • 10
  • l

    lemon-monkey-228

    09/27/2022, 1:50 PM
    I know I could grab each project individually - and this probably needs to happen regardless - but it'd be nice to co-ordinate it all with a single pulumi project
  • s

    stocky-restaurant-98004

    09/27/2022, 2:36 PM
    If you want to deploy a bunch of stacks to recreate an entire environment (which is my understanding of what you're trying to do), you might want to check out the Automation API, which allows you to use Pulumi as a dependency in a regular ol' node program: https://www.pulumi.com/docs/guides/automation-api/
Powered by Linen
Title
s

stocky-restaurant-98004

09/27/2022, 2:36 PM
If you want to deploy a bunch of stacks to recreate an entire environment (which is my understanding of what you're trying to do), you might want to check out the Automation API, which allows you to use Pulumi as a dependency in a regular ol' node program: https://www.pulumi.com/docs/guides/automation-api/
View count: 1