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

    alert-france-93241

    10/08/2019, 8:15 AM
    @stocky-spoon-28903
  • s

    stocky-spoon-28903

    10/08/2019, 8:15 AM
    Are you trying to create a new volume from an image, or move one volume between instances?
  • a

    alert-france-93241

    10/08/2019, 8:18 AM
    I am trying to write a Pulumi script to create a new volume and also support attaching the create volume to the instance (in case the instance is deleted and replaced) in every update.
    s
    • 2
    • 3
  • s

    stocky-island-3676

    10/08/2019, 8:23 AM
    Changing the
    image
    of a Kubernetes Deployment is not displayed as a change with
    pulumi up --refresh
    . I changed it directly with
    kubectl edit
    . The details view of
    pulumi up
    shows that the
    image
    will be refreshed in the stack, though. What do I do wrong? (The code is from
    pulumi new kubernetes-typescript
    with fixed
    image
    &
    minikube
    provider.)
    k8s_simple-change-detection-failure.ts
    t
    f
    • 3
    • 9
  • r

    rhythmic-finland-36256

    10/08/2019, 1:59 PM
    If you want to group stuff into one single TS file to have it logically separated but this is not worth being a component / doesn’t have any reusability (e.g. some kubernetes deployment, service, ingress for one specific application) but still you want to have some shared config (provider and namespace), what is a good pattern for that? Exposing / importing functions that get the provider and namespace passed down and calling them? Already enough to have a
    ComponentResource
    for that?
    w
    c
    • 3
    • 4
  • s

    stale-park-1622

    10/09/2019, 3:02 AM
    Can someone guide me on how to create the following infrastructure (https://aws.amazon.com/blogs/compute/setting-up-an-envoy-front-proxy-on-amazon-ecs/) on aws using awsx.ecs.FargateService. For example, how do I set the networkMode? FargateServiceArgs interface does not define networkMode. I am assuming I have to create an instance of awsx.ecs.FargateTaskDefinition, but then again, that does not have networkMode in its args. not sure where to set this. thanks
    w
    • 2
    • 2
  • n

    nutritious-midnight-45753

    10/09/2019, 2:49 PM
    Hi - I'm wondering if the nodejs sdk is able to be used outside the CLI. I'm getting an error that says
    Program run without the Pulumi engine available; re-run using the pulumi CLI
    f
    w
    • 3
    • 6
  • i

    incalculable-engineer-92975

    10/11/2019, 3:35 PM
    Support request: My pulumi script is simply hanging. I've re-run the script many times and get the same result. Any suggestions?
    w
    l
    • 3
    • 6
  • h

    helpful-bear-175

    10/12/2019, 4:15 PM
    What is the best way to pull in environment variables from the CD process into pulumi? I need to pass aws credentials to a chart for KMS and don’t want to add keys anywhere except for example circleci.
    w
    • 2
    • 6
  • s

    stale-park-1622

    10/13/2019, 3:56 PM
    I am having difficulty setting up an A record for route53 using awsx. I created a vpc, a network load blancer, a network listener and a network target. I have some services running. How can I get the hostedZone of the vpc? The following code throws an error
    const vpcHostedZone = vpc.id.apply(vpcId => aws.route53.getZone({ vpcId }));
    
    **Error: invocation of aws:route53/getZone:getZone returned an error: invoking aws:route53/getZone:getZone: Either name or zone_id must be set**
    I can not seem to obtain the zone information from the network load balancer either. I can see it on aws console the Hosted zone information associated with the network load balancer. How can I obtain this programatically? thanks
    w
    • 2
    • 2
  • b

    billowy-needle-56870

    10/15/2019, 10:32 AM
    Hi I'm creating a new preview with the following code, but the process not finish. It's still waiting for creating the "VPC" resource. import * as pulumi from "@pulumi/pulumi"; import * as aws from "@pulumi/aws"; import * as awsx from "@pulumi/awsx"; const projectName = pulumi.getProject(); const region = aws.config.requireRegion(); const vpc = new awsx.ec2.Vpc(projectName + region, { cidrBlock: "10.10.0.0/16", subnets: [{type: "public"}, {type: "private"}] }); export const vpcId = vpc.id export const allVpcSubnets = vpc.privateSubnetIds.concat(vpc.publicSubnetIds);
    a
    • 2
    • 3
  • b

    billowy-needle-56870

    10/15/2019, 10:33 AM
    Has anybody the same problem?
  • h

    handsome-yak-9760

    10/15/2019, 3:30 PM
    @billowy-needle-56870 It works for me on Node v12.10.0
  • b

    billowy-needle-56870

    10/15/2019, 6:06 PM
    @handsome-yak-9760 that's right. With Node v12.10 works fine, but with Node v12.12 it fails. Thanks for your help.
  • b

    busy-magazine-48939

    10/16/2019, 8:25 AM
    Hi, I am trying to filter an array of public subnets during ec2 instance creation, but stuck with
    pulumi.Output.apply()
    function, in particular I am not sure how to work with
    pulumu.Output<any>
    during preview:
    const vpc = new awsx.ec2.Vpc("vpc", {
        cidrBlock: '10.0.0.0/16',
        enableDnsHostnames: true,
        numberOfAvailabilityZones: 1,
        subnets: [
            {
                type: "public",
                name: `${prefix}-app`,
                location: "10.0.1.0/26",
                tags: { 
                  subnetType: "apps",  // <-- my custom tag I intent to filter by
                  ...commonTags 
                }
            },
            {
                type: "public",
                name: `${prefix}-osb`,
                location: {
                    cidrBlock: "10.0.20.0/26",
                    availabilityZone: `${region}a`
                },
                tags: { subnetType: "osb", ...commonTags }
            }
        ],
        tags: { Name: "Collaboration Zone", ...commonTags }
    })
    const instance = new aws.ec2.Instance("instance", {
        tags: { "Name": `${prefix}-instance`, ...commonTags },
        instanceType: 't2.large',
        vpcSecurityGroupIds: [sg.id],
        ami: ami,
        subnetId: vpc.publicSubnets // <-- awsx.ec2.Subnet
                    .filter(subnet => filterSubnetByTag('apps', subnet))
                    .map(subnet => subnet.id)[0],
        keyName: deployer.keyName
    })
    function filterSubnetByTag(subnetTag: string, subnet: awsx.ec2.Subnet): boolean {
    
    // subnet.subnet.tags is of the following type:
    //     readonly tags: pulumi.Output<{
    //        [key: string]: any;
    //   } | undefined>;
    
    // how do I filter pulumu.Output<any> during preview????
    
    return !!(subnet.subnet.tags.apply(tag => tag && tag.subnetType && tag.subnetType === subnetTag))
    }
    s
    • 2
    • 2
  • m

    modern-bear-85657

    10/16/2019, 7:41 PM
    Why does defining IAM policies think this is an error?
    Types of property 'Version' are incompatible.
          Type 'string' is not assignable to type 'Input<"2008-10-17" | "2012-10-17">'.ts(2322)
    b
    s
    • 3
    • 22
  • s

    stale-park-1622

    10/16/2019, 8:14 PM
    Having issue with creating an AWS network listener for NLB. I want to redirect TCP traffic to secure TCP (TLS). According to aws documentation (https://docs.aws.amazon.com/elasticloadbalancing/latest/network/load-balancer-listeners.html), listeners support the following protocols: TCP, TLS, UDP, and TCP_UDP. My goal is to terminate the SSL at the NLB. Not sure if that is even possible? The following code is producing an error:
    const nlb = new awsx.elasticloadbalancingv2.NetworkLoadBalancer(`network-lb`, {
        vpc,
        external: true
      });  
    const tg = nlb.createTargetGroup(`tg`, {
        port: 80,
        protocol: "TCP",
      });
    const tlsListener = tg.createListener(`tls-listener`, {
        vpc,
        loadBalancer: nlb,
        port: 443,
        protocol: 'TLS',
        certificateArn,
      });
    const tcpListener = tg.createListener(`listener`, {
        vpc,
        loadBalancer: nlb,
        port: 80,
        protocol: "TCP",
        defaultAction: {
          type: "redirect",
          redirect: {
            protocol: "TLS",
            port: "443",
            statusCode: "HTTP_301",
          },
        },
      });
    Diagnostics:
      aws:lb:Listener (listener):
        error: aws:lb/listener:Listener resource 'listener' has a problem: expected default_action.0.redirect.0.protocol to be one of [#{protocol} HTTP HTTPS], got TLS
    Is there any issues with my code? thanks
  • a

    acceptable-army-69872

    10/17/2019, 2:39 PM
    I'm having trouble using getVpcPeeringConnection as a datasource. I'm trying to pass in an array of awsx.Vpcs, and then loop thru them, looking for any peering connections in the VPC, and then creating the route between every VPC that's peered. The routes code is not where it needs to be, but my issue is using getVpcPeeringConnection. It always seems to trigger the catch instead of returning. My typescript is weak, so maybe it's a language thing, but I don't know. Anyone have any thoughts on a better (or the right way to do this)? https://gist.github.com/packplusplus/8cb354760e6b6e1631a4023b9eb761ee
    g
    • 2
    • 2
  • r

    rhythmic-finland-36256

    10/18/2019, 1:49 PM
    Seeing some issues (reproducible from scratch) when creating Azure app registration, service principal and some assignments/aks cluster. The
    ServicePrincipal
    is reported as a successful creation but all depending items (assignments, aks cluster) fail due to not finding the ServicePrincipal. Tried that several times. I’m on node10 and the latest versions of pulumi and the provider packages.
    t
    • 2
    • 11
  • a

    acoustic-toothbrush-71581

    10/18/2019, 5:27 PM
    Hi there - I'm new to Pulumi and fairly green with JS/Node promises. I have a deployment via the yaml module for cert manager, currently I'm lead to believe by the docs, that I can load the deployment object for the webhook deployment. My goal is to check the deployment status and wait until it's ready to continue deploying some other things. However when I call
    apply()
    I seem to get another promise? is this expected I didn't believe it would be. Am I taking the wrong approach here? Is there a better way? Currently we are loading the js kubernetes client and loading a kubeconfig then using it to check the deployment status. However we support at least 3 managed k8s providers and each of the pulumi modules have different ways to obtain the kubeconfig, making this harder. I was hoping to load a client from pulumis modules to check the deployment status.
    // Deploy cert-manager
     const certmanagerResources = new k8s.yaml.ConfigFile("cmResources", { file: `<https://github.com/jetstack/cert-manager/releasesdownload/${args.version}/cert-manager.yaml>`
     let deployment = certmanagerResources.getResource("apps/v1/Deployment", "cert-manager-webhook")
    deployment.apply(k => { k.status ) })` // error status isn't a propery
    console.log(Object.getOwnPropertyNames(deployment))
    console.log(deployment.apply(k => { Object.getOwnPropertyNames(k) }))
    //results in
        [ '__pulumiOutput',
          'isKnown',
          'isSecret',
          'resources',
          'promise',
          'toString',
          'toJSON',
          'apply',
          'get' ]
        OutputImpl {
          __pulumiOutput: true,
          isKnown: Promise { <pending> },
          isSecret: Promise { <pending> },
          resources: [Function],
          promise: [Function],
          toString: [Function],
          toJSON: [Function],
          apply: [Function],
          get: [Function] }
    g
    • 2
    • 4
  • p

    plain-spring-19734

    10/21/2019, 12:46 AM
    Hi, can anyone help? I'm having an issue where I can create an Azure Front Door but can't update it. If I change any configuration, then
    pulumi up
    again to apply the update, I get this error:
    error: Plan apply failed: 1 error occurred:
    * updating urn:pulumi:lab::app-service::azure:frontdoor/frontdoor:Frontdoor::myfrontdoor: A resource with the ID "/subscriptions/{guid}/resourcegroups/my-rg/providers/Microsoft.Network/frontdoors/myfrontdoor" already exists - to be managed via Terraform this resource needs to be imported into the State.
    It seems as if it's trying to create the resource again? Here's my code:
    const frontDoor = new azure.frontdoor.Frontdoor('myfrontdoor', {
        resourceGroupName: resourceGroup.name,
        tags: defaultTags,
        name: 'myfrontdoor',
        frontendEndpoints: [{
            name: 'myfrontdoor-azurefd-net',
            hostName: '<http://myfrontdoor.azurefd.net|myfrontdoor.azurefd.net>',
        }],
        backendPools: [{
            name: 'backendPoolAll',
            backends: [{
                address: '<http://myapp.azurewebsites.net|myapp.azurewebsites.net>',
                hostHeader: '<http://myapp.azurewebsites.net|myapp.azurewebsites.net>',
                httpPort: 80,
                httpsPort: 443,
                priority: 1,
                weight: 100,
                enabled: true
            },
            ],
            healthProbeName: 'tdylabHealthProbeSettings',
            loadBalancingName: 'tdylabLoadBalancingSettings',
        }],
        // etc.
        // <other config snipped>
    });
    I also tried again using the example code from the docs and ran into the same issue. https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/azure/frontdoor/#Frontdoor
    g
    • 2
    • 4
  • a

    alert-france-93241

    10/21/2019, 9:25 AM
    Hi Everyone, I have a query.
  • a

    alert-france-93241

    10/21/2019, 9:26 AM
    Can we have our domain registered in a separate aws account and link it with cloudfront in another aws account on pulumi.
    f
    • 2
    • 1
  • w

    worried-musician-21478

    10/22/2019, 1:28 PM
    Hello ! I recently upgraded my node version from 10.13 to 12.11. Under this version I have an issue with @pulumi/aws. Any code inside someOutput.apply() never executes during preview (tried aws.s3 and aws.lambda). I tried a few versions of this library, from the 1.4.0 to 1.7.0, with the same result. I'll paste repro steps in the thread.
    w
    • 2
    • 7
  • r

    rapid-ram-37207

    10/27/2019, 9:57 PM
    Hi, I have a stack deploying a component resource of type
    NetworkSecurityGroup
    containing 3 Azure network security rules. I want to export each network security rule as an output. like so :
    const nsg = new NetworkSecurityGroup('nsg', nsgArgs)
    export const nsgResource = nsg.group
    export const port1234Rule = nsg.rules.find(r => {
        return r.rule.name.get() === 'Deny_Outbound_Port1234'
    })
    export const consulRule = nsg.rules.find(r => {
        return r.rule.name.get() === 'Allow_Inbound_Vnet_Consul'
    })
    export const sshRule = nsg.rules.find(r => {
        return r.rule.name.get() === 'Allow_Inbound_SSH'
    })
    But I'm getting this error :
    pulumi:pulumi:Stack (azure-network-security-group-ci):
        error: Running program '/home/mathieu/git/pulumi-azure-network-security-group/tests/stack' failed with an unhandled exception:
        Error: Cannot call '.get' during update or preview.
        To manipulate the value of this Output, use '.apply' instead.
    How can I get the specific rule I want out of the collection of rules from an
    apply()
    call ? Or, is there a better way to do this ? Sorry if this is a silly question, I'm fairly new to TypeScript.
  • q

    quiet-wolf-18467

    10/28/2019, 8:19 AM
    I'm trying to create a "special" type of Secret for Kubernetes, which is
    dockerconfigjson
    with Pulumi. I'm running into problems:
    export const imagePullSecret = new k8s.core.v1.Secret(
      "docker-hub",
      {
        type: "<http://kubernetes.io/dockerconfigjson|kubernetes.io/dockerconfigjson>",
        metadata: {
          namespace: "community"
        },
        data: {
          ".dockerconfigjson": config
            .requireSecret("docker-hub-token")
            .apply(value => {
              Buffer.from(
                JSON.stringify({
                  auths: {
                    "<https://index.docker.io/v1/>": {
                      auth: value
                    }
                  }
                })
              ).toString("base64");
            })
        }
      },
      {
        provider: kubernetesProvider
      }
    );
    Diagnostics:
      kubernetes:core:Secret (docker-hub):
        error: check failed because malformed resource inputs: malformed RPC secret: missing value
    Any advice, @creamy-potato-29402?
    g
    l
    • 3
    • 19
  • r

    rapid-ram-37207

    10/29/2019, 7:06 PM
    Hi everyone, I've been pulling my hair out trying to make the outputs of my stack work. I want to get each network security rule by name, and then output it. Here is what I have right now : https://gist.github.com/MathieuBuisson/0aeb53488077beb4da484cc79caad079#file-stack-ts This deploys resources perfectly, however the outputs
    consulRule
    and
    sshRule
    are incorrect. All the rule outputs have the same property values : https://gist.github.com/MathieuBuisson/0aeb53488077beb4da484cc79caad079#file-outputs-txt As you can see in the Gist, all rules outputs are identical. It looks like these 3 rules outputs are all referencing the same object : the first rule. Could anyone give me any pointers on what I'm doing wrong here ? Thank you.
    w
    t
    • 3
    • 15
  • c

    calm-parrot-72437

    10/30/2019, 4:38 PM
    hi ya'll. I'm trying to create an eks cluster with const cluster = new eks.Cluster("dev"); but it's failing to create the vpc-ci. i.e., nodejs:dynamic:Resource (dev-vpc-cni): error: Plan apply failed: Command failed: kubectl apply -f /tmp/tmp-5954tR6ELxplfZpu.tmp error: EOF
  • c

    calm-parrot-72437

    10/30/2019, 4:38 PM
    how can i get more information to debug this further?
    w
    • 2
    • 8
  • c

    chilly-article-21928

    11/03/2019, 11:37 AM
    Hi everyone ! I'm encountering an issues with
    StackReference.getOutputSync
    or
    StackReference.requireOutputSync
    . In both cases, when I run
    pulumi preview
    , the program get stuck calling these functions. Is it a known issue ? Here is the snippet:
    const env = pulumi.getStack();
    const network = new pulumi.StackReference(`Shiroy/webhosting-network/${env}`);
    
    const privateSubnetIds = <string[]>(
      network.requireOutputSync("privateSubnetIds")
    );
    console.log(privateSubnetIds);
Powered by Linen
Title
c

chilly-article-21928

11/03/2019, 11:37 AM
Hi everyone ! I'm encountering an issues with
StackReference.getOutputSync
or
StackReference.requireOutputSync
. In both cases, when I run
pulumi preview
, the program get stuck calling these functions. Is it a known issue ? Here is the snippet:
const env = pulumi.getStack();
const network = new pulumi.StackReference(`Shiroy/webhosting-network/${env}`);

const privateSubnetIds = <string[]>(
  network.requireOutputSync("privateSubnetIds")
);
console.log(privateSubnetIds);
View count: 1