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

    gorgeous-animal-95046

    03/02/2020, 6:18 PM
    Is there a way for me to manually create a
    pulumi.Output
    ? I'm trying to unit test a function that accepts this as a function param but I can't grok out how to do this.
    g
    • 2
    • 5
  • b

    broad-helmet-79436

    03/03/2020, 8:26 AM
    Type usage question: I see some of both
    Output
    and
    OutputInstance
    in the source code. Which one should I use in my own code? Does it matter?
    t
    • 2
    • 2
  • h

    handsome-cat-98152

    03/03/2020, 10:37 AM
    When working with external
    CRD
    s, how do I create an equvalent Pulumi Class for their
    yaml
    config?
  • c

    crooked-knife-92853

    03/03/2020, 5:20 PM
    Hi there, is there any way to import an existing EKS cluster into Pulumi? I get an error when I try to use the
    import
    syntax as I have for other resources.
    • 1
    • 1
  • h

    handsome-state-26704

    03/04/2020, 2:46 AM
    I'm curious - is there a way to use Pulumi like a regular module and invoke a "pulumi up" inside a node.js script, with all the output returned in a string (or object)? The reason I ask, is that I'm looking to use Pulumi in a more continuous model and not just a "one shot" call to pulumi up.
    👍 1
    w
    • 2
    • 2
  • c

    crooked-knife-92853

    03/04/2020, 5:16 PM
    Hi its me again! Somewhat related to my question from yesterday: so I was able to import my existing EKS cluster into my stack using
    _aws_._eks_._Cluster_
    and now I want to create a new node group using the
    createNodeGroup()
    from
    '@pulumi/eks/nodegroup'
    (bc there’s a lot of really good stuff in there I don’t want to have to rewrite). When I try to pass my cluster in I get the following error:
    Type 'Cluster' is not assignable to type 'Cluster | CoreData'.
      Type 'Cluster' is missing the following properties from type 'Cluster': kubeconfig, provider, clusterSecurityGroup, instanceRoles, and 9 more.ts(2322)
    nodegroup.d.ts(164, 5): The expected type comes from property 'cluster' which is declared here on type 'NodeGroupOptions'
    And at this point I’m not really sure how to proceed 😞 Is there any way to use that function on an eks cluster I imported into my stack? Thanks in advance!
  • p

    prehistoric-account-60014

    03/05/2020, 6:04 AM
    If one wanted to use Babel instead of the Pulumi runtime to transpile TypeScript, is importing from the build folder the recommended way to do so?
    w
    • 2
    • 1
  • p

    polite-motherboard-78438

    03/07/2020, 5:15 PM
    Hello. I am new to Pulumi and Typescript and I am trying to create a DigitalOcean Kubernetes cluster. The cluster resource have a property region of type "digitalocean.Region" that I want to make configurable. It is possible to read a string from config and convert it to an object of that type without manually mapping? Here is the type definitions of the region object:
    Untitled
    l
    • 2
    • 2
  • b

    billions-scientist-31826

    03/09/2020, 8:00 PM
    Is there a way to convert an
    Output<T>
    to a string?
    t
    b
    • 3
    • 5
  • p

    proud-eve-8632

    03/11/2020, 9:20 PM
    Trying to provision a github resource using a dynamic provider i created similar to the example provided here and getting the following error, has anyone come across this before?
    error: Error serializing '() => provider': index.js(19,37)
    
    '() => provider': index.js(19,37): captured
      variable 'provider' which indirectly referenced
        function 'create': Labels.ts(28,10): which captured
          module './Labels.ts' which indirectly referenced
            function 'bound register': which could not be serialized because
              it was a native code function.
    
    Function code:
      function () { [native code] }
    
    Capturing modules can sometimes cause problems.
    Consider using import('./Labels.ts') or require('./Labels.ts') inside function 'create': Labels.ts(28,10)
  • q

    quiet-morning-24895

    03/12/2020, 4:25 AM
    I am using an eks API that takes an
    aws.Region
    parameter, but
    aws.RegionResult.name
    doesn't have the right type. Is this a bug in the typings? The API:
    export declare function getRoleProvider(name: string, region?: aws.Region, profile?: string, parent?: pulumi.ComponentResource): CreationRoleProvider;
    getRegion:
    export declare function getRegion(args?: GetRegionArgs, opts?: pulumi.InvokeOptions): Promise<GetRegionResult> & GetRegionResult;
    export interface GetRegionResult {
        /**
         * The region's description in this format: "Location (Region name)".
         */
        readonly description: string;
        /**
         * The EC2 endpoint for the selected region.
         */
        readonly endpoint: string;
        /**
         * The name of the selected region.
         */
        readonly name: string;
        /**
         * id is the provider-assigned unique ID for this managed resource.
         */
        readonly id: string;
    }
  • b

    broad-dog-22463

    03/12/2020, 4:26 AM
    You can cast this to <aws.Region> before the string
  • b

    broad-dog-22463

    03/12/2020, 4:26 AM
    So maybe <aws.Region>myRegion.name will work for you
  • q

    quiet-morning-24895

    03/12/2020, 4:26 AM
    yep, that's what I'm doing. Seems like a silly workaround though.
  • b

    broad-dog-22463

    03/12/2020, 4:27 AM
    Right now we are discussing about how enums can be used and how we are able to cater for situations like this
  • b

    broad-dog-22463

    03/12/2020, 4:27 AM
    I agree with you that it’s not ideal at all
  • b

    broad-dog-22463

    03/12/2020, 4:28 AM
    If you would be happy to, I’d love it for you to open a an issue on Pulumi-aws so we can raise visibility of it?
    q
    • 2
    • 1
  • q

    quiet-morning-24895

    03/12/2020, 4:33 AM
    sure happy to open an issue!
  • b

    broad-dog-22463

    03/12/2020, 4:33 AM
    And you can tag me, @stack72, in it so I can see it
  • b

    broad-dog-22463

    03/12/2020, 4:33 AM
    Thanks!
  • d

    delightful-truck-1268

    03/16/2020, 6:49 PM
    I’m attempting to use a stack output as an argument into another stack’s resource but I’m getting an error saying
    Output<string> is not assigned to type 'string'
    t
    • 2
    • 2
  • d

    delightful-truck-1268

    03/16/2020, 6:50 PM
    I’m using the
    getOutput
    function as described in https://www.pulumi.com/docs/intro/concepts/programming-model/#stack-references
  • g

    great-vr-65723

    03/17/2020, 4:09 AM
    Hi - I'm trying to write a unit test for a function that calls:
    aws.getCallerIdentity().accountId
    I'm trying to find information on mock AWS providers for Pulumi. I found this PR, but zero additional documentation for how to use it. I also can't find much information about tests beyond this blog post that is very cursory. Anyway, does anyone have any information about how to mock the AWS provider? Spefically the
    getCallerIdentity()
    function?
    w
    • 2
    • 4
  • l

    limited-rainbow-51650

    03/18/2020, 5:23 PM
    I’m amidst refactoring some Pulumi code using
    aliases
    . I need to debug why my
    preview
    still says a resource will be deleted and created. Is there any way to see the values of the
    CustomResourceOptions
    in the output?
    w
    • 2
    • 1
  • b

    bitter-toddler-22112

    03/19/2020, 3:23 PM
    Hi guys, I'm new to typescript and don't know how it implements strong or weak typing, serialization and so on. Anyways, my Problem is that in one stack I export an object of type eks.Cluster. In another stack where I get it as output, it is of Type Output<any>. How can i cast it to eks.Cluster so that I can access its fields like eksCluster.nodeSecurityGroup.id and so on? Thx for your help!
    w
    b
    • 3
    • 3
  • b

    brainy-garden-89849

    03/23/2020, 8:37 PM
    Is there a way to delay for x seconds after one resource is created but before another is created? When I create my Azure Service Principal, and then create an AKS Kubernetes Cluster with that Azure Service Principal, sometimes it fails because replication of the Service Principal needs to occur. If I could just delay by 30 seconds or so after the Service Principal is created and before it starts creating the AKS Kubernetes cluster, it would allow my pipeline to pass first time without having to re-run as I do currently.
    w
    • 2
    • 1
  • s

    salmon-account-74572

    03/23/2020, 10:36 PM
    I have a somewhat newbie-ish question. I'm trying to store stack-specific configuration details with
    pulumi config set ...
    and then access them in my TypeScript code. In the past, when only dealing with AWS-specific details, I'd use this code:
    const config = new pulumi.Config("aws");
    const configRegion = config.require("region");
    Now, though, I'm trying access both AWS-specific details and non-AWS specific information. I would've thought this would work, but it doesn't:
    const config = new pulumi.Config();
    const configRegion = config.require("aws:region");
    Instead, I keep getting prompted to set configuration value
    <stack-name>:aws:region
    . I've set the region using
    pulumi config set aws:region us-west-2
    and
    pulumi config set <stack-name>:aws:region us-west-2
    , both to no avail. (The latter option doesn't work, even though that's what
    pulumi preview
    references as an error.) What am I missing?
    g
    • 2
    • 3
  • f

    faint-oil-7535

    03/24/2020, 1:31 AM
    Hey, can someone show me how I can define a KeyValuePair array in TS aws ecs container definition, as in the following example container definition? Cheers
    Untitled
    • 1
    • 1
  • a

    acceptable-army-69872

    03/24/2020, 12:15 PM
    Is there some magic to being able to use --target to create an awsx resource? It seems like if I target a vpc
    --target urn:pulumi:prod1::api::awsx:x:ec2:Vpc\$aws:ec2/vpc:Vpc::some-vpc --target-dependents
    the dependency graph only spits out the VPC, and none of the subnets / nat gateways / whatever else in the VPC. Then it fails on creation, with
    urn:pulumi:prod1::api::awsx:x:ec2:Vpc\$aws:ec2/vpc:Vpc::some-vpc could not be found in the stack.
  • a

    acceptable-army-69872

    03/24/2020, 12:15 PM
    Unless you can't use target to create things...
Powered by Linen
Title
a

acceptable-army-69872

03/24/2020, 12:15 PM
Unless you can't use target to create things...
View count: 1