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

    average-dream-51210

    05/30/2019, 12:37 AM
    Hm somehow I got stuck in a state where when I do
    pulumi destroy
    it fails trying to delete some resources:
    w
    • 2
    • 13
  • a

    average-dream-51210

    05/30/2019, 12:37 AM
    It gets stuck in that state for a long time. I think this is the result of me canceling out of a destroy or update.
  • a

    average-dream-51210

    05/30/2019, 12:37 AM
    I tried doing the stack export and reimporting while cleaning up the pending state changes.
  • a

    average-dream-51210

    05/30/2019, 12:37 AM
    Are there any other methods to reset the state of everything?
  • a

    average-dream-51210

    05/30/2019, 12:38 AM
    Should I manually clean everything out in the AWS console, then
    pulumi up
    to recreate the infra?
  • d

    delightful-city-79989

    05/30/2019, 4:44 AM
    I keep running into this error:
    Error: Cannot find module './about.js'
        at Function.Module._resolveFilename (module.js:547:15)
        at Function.Module._load (module.js:474:25)
        at Module.require (module.js:596:17)
        at require (internal/module.js:11:18)
        at app.get (/var/task/__index.js:9:22)
        at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5)
        at next (/var/task/node_modules/express/lib/router/route.js:137:13)
        at Route.dispatch (/var/task/node_modules/express/lib/router/route.js:112:3)
        at Layer.handle [as handle_request] (/var/task/node_modules/express/lib/router/layer.js:95:5)
        at /var/task/node_modules/express/lib/router/index.js:281:22
    When I try to serve a js file using:
    const server = new cloud.HttpServer("myexpress", () => {
      const app = express();
      app.get("/", (req, res) => {
        const page = require("./about.js");
        page.render(req, res);
      });
    
      return app;
    });
    w
    • 2
    • 3
  • f

    full-dress-10026

    05/30/2019, 2:57 PM
    Is there a way to get a
    aws.cloudformation.Stack
    from an existing stack? I see the method
    aws.cloudformation.getStack
    but that returns a
    GetStackResult
    . I see
    aws.cloudformation.Stack.get
    but that takes an
    id
    - not sure what to pass for that.
  • j

    jolly-egg-4894

    05/30/2019, 2:59 PM
    GetStackResult
    has an
    id
    property, maybe use the
    id
    from that into
    aws.cloudformation.Stack.get
    🤷 https://pulumi.io/reference/pkg/nodejs/pulumi/aws/cloudformation/#GetStackResult
  • j

    jolly-egg-4894

    05/30/2019, 3:00 PM
    Although I wouldn’t be surprised if there was a cleaner way
  • f

    full-dress-10026

    05/30/2019, 3:02 PM
    It worked! Different problem now... I'm trying to follow the steps outlined here: https://github.com/pulumi/pulumi/issues/1662#issuecomment-483718863. However I cannot seem to get Pulumi to "adopt" the CF stacks. It wants to discard the Stacks adopted with
    aws.cloudformation.Stack.get
    and create new ones. Is there a way to see why Pulumi wants to do that?
    • 1
    • 1
  • w

    worried-engineer-33884

    05/30/2019, 3:50 PM
    I'm having trouble testing a resource that relies on an input. e.g. i have
    export class BucketPolicy extends aws.s3.BucketPolicy {
        constructor(name: string, bucket: aws.s3.Bucket) {
            const bucketPolicyArgs = {
                bucket: bucket.id,
                policy: "",
            }
            super(name, bucketPolicyArgs);
        }
    }
    and in my test i have
    describe("BucketPolicy", function() {
        describe("constructor", function() {
            let testBucket = new infra.Bucket("test");
            let bucketPolicy = new infra.BucketPolicy("test", testBucket);
            it("should attach to the given bucket", function(done) {
                bucketPolicy.bucket.apply(bucketId => {  // this hangs
                    if (bucketId == "test") {
                        done()
                    } else {
                        done(new Error(`wrong bucket id ${bucketId}`))
                    }
                })
            });
    the test hangs when it tries to retrieve the bucket output from bucketPolicy
    w
    • 2
    • 7
  • b

    boundless-monkey-50243

    05/30/2019, 4:06 PM
    Has anyone magicked up a way to read a Terraform remote state file in Pulumi, akin to the
    terraform_remote_state
    data source in Terraform? https://www.terraform.io/docs/providers/terraform/d/remote_state.html (He asked, totally wanting to start using Pulumi piecemeal at the new gig.)
    • 1
    • 1
  • s

    stocky-spoon-28903

    05/30/2019, 4:20 PM
    @boundless-monkey-50243 Yes!
  • s

    stocky-spoon-28903

    05/30/2019, 4:21 PM
    npm install "@pulumi/terraform"
  • s

    stocky-spoon-28903

    05/30/2019, 4:21 PM
    import * as terraform from "@pulumi/terraform";
    const remoteState = new terraform.state.RemoteStateReference("something", {
        type = "terraform backend name"
        // config here
    });
    💯 1
  • s

    stocky-spoon-28903

    05/30/2019, 4:21 PM
    then you can get the outputs on
    remoteState.outputs.getOutput(x)
  • s

    stocky-spoon-28903

    05/30/2019, 4:22 PM
    https://www.npmjs.com/package/@pulumi/terraform for a better example
  • b

    boundless-monkey-50243

    05/30/2019, 4:24 PM
    😄
  • b

    boundless-monkey-50243

    05/30/2019, 4:24 PM
    Thanks, dude
  • f

    full-dress-10026

    05/30/2019, 5:40 PM
    If I want to store my Typescript files in a
    src
    directory in my Pulumi project, how would I do that? I tried just moving them all into a
    src
    dir and adding this to my `tsconfig.json`:
    "files": [
            "src/index.ts"
        ]
    When running
    pulumi up
    , I get:
    We failed to locate the entry point for your program: /home/kenny/compute_software/infrastructure/pulumi-k8s-src
        Here's what we think went wrong:
          * Your program's 'main' file (/home/kenny/compute_software/infrastructure/pulumi-k8s-src/index.js) does not exist.
    f
    • 2
    • 1
  • s

    stocky-spoon-28903

    05/30/2019, 5:42 PM
    You also need to set:
    "main": "src/index.ts"
    in your package.json IIRC
    👍 1
  • f

    full-dress-10026

    05/30/2019, 6:04 PM
    How would I turn a
    awsx.ecs.Cluster
    into an EC2 based ECS cluster?
    w
    • 2
    • 11
  • f

    full-dress-10026

    05/30/2019, 6:54 PM
    If I have an Object with a bunch of keys whose values are `pulumi.Input`s, is there an easy way to wait for all of the `Input`s to become available without need to individually pull each one off the object and pass it to
    pulumi.all
    ?
    h
    w
    • 3
    • 5
  • d

    damp-book-35965

    05/30/2019, 9:26 PM
    So looks like I'm getting a 409 for update already in progress, even though there is no update going on. The update was in progress but I interrupted it and stopped it. It is not allowing me to
    pulumi export/import stack
    or
    pulumi destroy
    .. nothing What should I be doing in this case ?
    w
    • 2
    • 3
  • f

    full-dress-10026

    05/30/2019, 10:41 PM
    What
    provider
    do I pass to a
    k8s.apps.v1.Deployment
    when using Minikube?
    c
    w
    • 3
    • 6
  • h

    handsome-actor-1155

    05/30/2019, 10:55 PM
    When creating an EKS cluster, I specified the storage class type as
    st1
    . It seems that both a
    gp2
    AND my
    st1
    storageClasses get created and they are both marked as
    default
    . Is this expected behavior? Is there a specific property I need to set to prevent that from happening?
    // Create a VPC for our cluster.
    const vpc = new awsx.ec2.Vpc("Kafka-VPC", {numberOfAvailabilityZones: 3});
    
    // Create an EKS cluster with the given configuration.
    const cluster = new eks.Cluster("kafka-cluster", {
        vpcId: vpc.id,
        subnetIds: vpc.privateSubnetIds,
        instanceType: instanceType,
        desiredCapacity: desiredCapacity,
        minSize: minSize,
        maxSize: maxSize,
        storageClasses: storageClass,
        deployDashboard: deployDashboard,
    });
    w
    • 2
    • 7
  • i

    incalculable-diamond-5088

    05/30/2019, 10:56 PM
    When trying to deploy
    kiam
    helm chart, it seems that the TLS certificates are not generated. I checked
    helm template .
    and it generates them. Does pulumi has its own helm implementation?
    c
    • 2
    • 56
  • f

    full-dress-10026

    05/31/2019, 2:27 AM
    Given I set
    deployDashboard: true
    on my
    eks.Cluster
    , how would I connect to the dashboard?
    • 1
    • 1
  • f

    full-dress-10026

    05/31/2019, 2:51 AM
    I am trying to attach an IAM policy to the node Role that was created with my EKS cluster:
    new aws.iam.RolePolicyAttachment("eks-node-role-assignment", {
            policyArn: nodePolicy.arn,
            role: eksCluster.instanceRole
        })
    This is throwing an exception:
    Running program '/home/kenny/compute_software/infrastructure/pulumi-k8s-src' failed with an unhandled exception:
        Error: Missing required property 'role'
    Any idea why? Do I need to explicitly pass the role when creating the EKS cluster?
    s
    d
    • 3
    • 26
  • t

    thankful-island-60540

    05/31/2019, 9:56 AM
    Hi, have a question for injecting a values file to a helm chart deployment (no just specific values), so for example i'm deploying the latest stable jenkins helm chart, when deploying it manually via
    helm upgrade ...
    its all running fine, When using next code example
    jenkins_values = "PATH_TO_VALUES.yaml"
    with open(jenkins_values) as f:
        jenkins_values = f.read()
        jenkins_values = yaml.load(jenkins_values)
    
    Chart("jenkins",
          ChartOpts(chart="jenkins",
                    repo="stable",
                    version="1.1.23",
                    namespace="jenkins",
                    values=jenkins_values))
    The chart is being deployed, but not taking any of the values (it just deploys the default chart values). Does Pulumi support of injecting a values file, or should i actually pass exact values i want to change (equivalent to --set)?
    r
    b
    • 3
    • 10
Powered by Linen
Title
t

thankful-island-60540

05/31/2019, 9:56 AM
Hi, have a question for injecting a values file to a helm chart deployment (no just specific values), so for example i'm deploying the latest stable jenkins helm chart, when deploying it manually via
helm upgrade ...
its all running fine, When using next code example
jenkins_values = "PATH_TO_VALUES.yaml"
with open(jenkins_values) as f:
    jenkins_values = f.read()
    jenkins_values = yaml.load(jenkins_values)

Chart("jenkins",
      ChartOpts(chart="jenkins",
                repo="stable",
                version="1.1.23",
                namespace="jenkins",
                values=jenkins_values))
The chart is being deployed, but not taking any of the values (it just deploys the default chart values). Does Pulumi support of injecting a values file, or should i actually pass exact values i want to change (equivalent to --set)?
r

rapid-eye-32575

05/31/2019, 10:06 AM
Hey, i'm just a regular user of Pulumi so I might be wrong. But as I understood it Pulumi will in essence use the options in your code to generate the manifests using helm and then compare it to the state of the resources in the cluster. So yes, you have to specify the same value you did when creating the release manually.
I.e. Pulumi is not running
helm upgrade
and is not using (and not requiring) Tiller in your Cluster
t

thankful-island-60540

05/31/2019, 10:13 AM
Hey, yes that sounds right (btw, i'm not deploying via helm and then letting pulumi to do some more work, but deploying using pulumi from scratch). the issue is if i use
Chart("jenkins",
      ChartOpts(chart="jenkins",
                repo="stable",
                version="1.1.23",
                namespace="jenkins",
                values={
                    "alice": "bob"
                }))
Then the deploy will override a key named
alice
to a value of
bob
and that's ok, but what if i have hundreds (for example) values that i need to change? it would be easier to just
yaml.load
it from a file and that seems to not work... or maybe its just my values syntax is wrong🤔 i'll double check the dictionary that's being generated, but it look fine....
r

rapid-eye-32575

05/31/2019, 10:20 AM
Ah sorry, I misread your question completely!
Hmm I just checked my code and I actually do the same using the Node.js SDK. So it should work. Maybe this is some sort of concurrency issue and not actually a Pulumi issue? I don't know Python so I couldn't say 😉
b

busy-umbrella-36067

05/31/2019, 4:18 PM
My biggest issue with Helm Charts was that the wrong values were documented
One thing that helped was using
console.log
on
values
and
defaultValues
here. https://github.com/pulumi/pulumi-kubernetes/blob/0e3dcef044568b05d23945f1ac50113d5b21394f/sdk/nodejs/helm/v2/helm.ts#L166
You can edit your
@pulumi/kubernetes
package inside
node_modules
to add that and compare the default chart values to what you are passing to it
I had a case where the
ingress-nginx
chart documented the wrong values for setting targetPorts. Got it resolved using the above. I hope this helps
t

thankful-island-60540

06/01/2019, 6:57 AM
@busy-umbrella-36067 Thanks, i've really updated the python package and added some prints (too bad i cannot run the python code without the CLI to debug), and it really seems to have some bugs, thanks for the tip
View count: 1