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

    breezy-agency-15661

    12/13/2019, 1:48 AM
    but how to do the same if I go from the following:
    aws.cloudwatch.onSchedule("test", "rate(1 minute)", async (event) => {
        try {
            console.log(`current time: ${Date.now()}`);
        } catch (e) {
            console.log(e);
        }
    });
  • b

    breezy-agency-15661

    12/13/2019, 1:49 AM
    By default, it creates Node 8 runtime, though I have upgraded pulumi to the latest
    w
    • 2
    • 1
  • s

    square-rocket-59657

    12/13/2019, 2:19 AM
    @breezy-agency-15661 could you not pass the
    lambda
    to the onSchedule as it accepts a handler something like:
    const lambda = new aws.lambda.Function("myfunc", {
            code: undefined,
            role: ";)",
            handler: "index.handler",
            runtime: aws.lambda.NodeJS10dXRuntime
        },
        {}
    );
    
    aws.cloudwatch.onSchedule("test", "rate(1 minute)", lambda.handler);
  • b

    breezy-butcher-78604

    12/13/2019, 6:34 AM
    i’m building a small docker container image containing pulumi to use in my deployments and want to ensure the relevant provider plugin (aws in this case) is installed when the image is built to prevent it having to be downloaded at runtime. i can see there is a CLI command
    pulumi plugin install KIND NAME VERSION
    but i’d prefer to just grab the latest (and not provide a version) is this possible? or will i need to always pass a specific version number?
    g
    • 2
    • 1
  • b

    breezy-butcher-78604

    12/13/2019, 7:15 AM
    another question (unrelated) - is it possible to generate an access key for Pulumi that isn’t associated with a specific person’s account? I’d like to create a token for our CI/CD systems to use but I don’t want to use my own personal tokens
    g
    • 2
    • 1
  • i

    incalculable-diamond-5088

    12/13/2019, 11:03 AM
    goroutine 280 [running]:
    <http://github.com/pulumi/pulumi/pkg/util/contract.failfast(...)|github.com/pulumi/pulumi/pkg/util/contract.failfast(...)>
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/util/contract/failfast.go:23
    <http://github.com/pulumi/pulumi/pkg/util/contract.Assert(...)|github.com/pulumi/pulumi/pkg/util/contract.Assert(...)>
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/util/contract/assert.go:26
    <http://github.com/pulumi/pulumi/pkg/resource/plugin.(*provider).Diff(0xc0036c9f20|github.com/pulumi/pulumi/pkg/resource/plugin.(*provider).Diff(0xc0036c9f20>, 0xc006027e00, 0xea, 0x0, 0x0, 0xc002a1ca50, 0xc001ed8d20, 0x203001, 0x0, 0x0, ...)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/plugin/provider_plugin.go:504 +0x15ba
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.diffResource(0xc006027e00|github.com/pulumi/pulumi/pkg/resource/deploy.diffResource(0xc006027e00>, 0xea, 0x0, 0x0, 0xc002a1c7b0, 0xc002a1ca50, 0xc001ed8d20, 0x19d5340, 0xc0036c9f20, 0xc004632501, ...)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:1049 +0x118
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).diff(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).diff(0xc0057c7440>, 0xc006027e00, 0xea, 0xc0029b6b00, 0xc00330e900, 0xc002a1c7b0, 0xc002a1ca50, 0xc001ed8d20, 0x19d5340, 0xc0036c9f20, ...)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:1037 +0x30d
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateStepsFromDiff(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateStepsFromDiff(0xc0057c7440>, 0x7f6ab8111fc0, 0xc00486efa0, 0xc006027e00, 0xea, 0xc0029b6b00, 0xc00330e900, 0xc002a1c7b0, 0xc002a1ca50, 0xc001ed8d20, ...)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:499 +0xf6
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateSteps(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).generateSteps(0xc0057c7440>, 0x7f6ab8111fc0, 0xc00486efa0, 0xc00119d200, 0x3, 0xc001401aa0, 0x1, 0xc00119d200)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:432 +0xead
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).GenerateSteps(0xc0057c7440|github.com/pulumi/pulumi/pkg/resource/deploy.(*stepGenerator).GenerateSteps(0xc0057c7440>, 0x7f6ab8111fc0, 0xc00486efa0, 0x7f6ab8111fc0, 0xc00486efa0, 0x1, 0xc001401ac0, 0x45d9c0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/step_generator.go:155 +0x5a
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).handleSingleEvent(0xc00577b200|github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).handleSingleEvent(0xc00577b200>, 0x1988bc0, 0xc00486efa0, 0x0, 0x1)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:361 +0x138
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute.func3(0xc005879440|github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute.func3(0xc005879440>, 0xc00577b200, 0xc005726bf0, 0x19b4280, 0xc001e25c80, 0x0, 0x0, 0x19b4340, 0xc00570a030, 0x0, ...)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:235 +0x210
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute(0xc00577b200|github.com/pulumi/pulumi/pkg/resource/deploy.(*planExecutor).Execute(0xc00577b200>, 0x19b4340, 0xc00570a030, 0x19b4680, 0xc0057c70e0, 0x7fffffff, 0x0, 0x0, 0x0, 0x0, ...)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan_executor.go:251 +0x7da
    <http://github.com/pulumi/pulumi/pkg/resource/deploy.(*Plan).Execute(...)|github.com/pulumi/pulumi/pkg/resource/deploy.(*Plan).Execute(...)>
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/resource/deploy/plan.go:335
    <http://github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk.func1(0x19b4680|github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk.func1(0x19b4680>, 0xc0057c70e0, 0xc0057c6ea0, 0x19b4340, 0xc00570a030, 0xc00570a001, 0xc005726b20, 0xc005878ba0)
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/engine/plan.go:192 +0x24a
    created by <http://github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk|github.com/pulumi/pulumi/pkg/engine.(*planResult).Walk>
    	/home/travis/gopath/src/github.com/pulumi/pulumi/pkg/engine/plan.go:178 +0x177
    g
    • 2
    • 2
  • i

    incalculable-diamond-5088

    12/13/2019, 11:03 AM
    After running pulumi up with multiple targets getting this on every `pulumi up`:
  • a

    adamant-motorcycle-38425

    12/13/2019, 12:55 PM
    Scenario: I'm creating a SingleRunFargateTask dynamic resource provider. I hoped to pass it's constructor a FargateTaskDefinition and then invoke run() on create, like so:
    const SingleRunFargateTaskProvider = {
      async create(inputs) {
        const id = crypto.randomBytes(16).toString("hex");
        const result = await inputs.fargateTaskDefn.run({
          cluster: inputs.ecsCluster
        });
        return { id };
      }
    };
    However I receive this Error:
    error: update failed
    
    pulumi-nodejs:dynamic:Resource (repro-customfgtask):
        error: inputs.fargateTaskDefn.run is not a function
    When I inspect the inputs, inputs.fargateTaskDefn is at that runtime, a string URN. Any guidance on how to make this work would be really appreciated! (My eventual use-case will be a database migration task that I tie to my RDS resource's lifetime). P.S/Sidenote: I am modelling this after the lambda/fargate example that captures a reference to a FargateTaskDefinition and uses the run() call at runtime (and I've tested that scenario/function serialization works fine. See: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/awsx/ecs/#task-definitions):
    const helloTask = new awsx.ecs.FargateTaskDefinition("hello-world", {
        container: {
            image: "hello-world",
            memory: 20,
        },
    });
    
    const api = new awsx.apigateway.API("examples-containers", {
        routes: [{
            path: "/run",
            method: "GET",
            eventHandler: async (req) => {
                const result = await helloTask.run({ cluster });
                return { statusCode: 200, body: "OK" };
            },
        }],
    });
    • 1
    • 1
  • s

    steep-printer-55468

    12/13/2019, 2:22 PM
    I have a question about organizing stacks. I'm using the s3 backend and I've got multiple stacks configured in one project. In order to actually apply stack configurations and permit inter-stack dependencies with stack references, I've got a bunch of imports in
    index.ts
    to pull in various modules, then I switch on
    pulumi.getStack()
    to execute the right "stack module" for the selected stack. Is there a better way to organize around multiple stacks or is that the more or less standard way to do it?
    b
    • 2
    • 1
  • c

    cuddly-leather-18640

    12/13/2019, 3:00 PM
    how do I get pulumi to deploy my k8s resources to a specific namespace? My google fu is failing me and I guess I’ve overlooked some of the docs: https://www.google.com/search?q=pulumi+kubernetes+deploy+to+namespace&amp;oq=pulumi+kubernetes+deploy+to+namespace&amp;aqs=chrome..69i57.7250j0j1&amp;sourceid=chrome&amp;ie=UTF-8
    g
    • 2
    • 1
  • b

    billowy-laptop-45963

    12/13/2019, 4:58 PM
    Is there a github provider with a resource like terraforms
    github_repository_webhook
    ?
    f
    • 2
    • 2
  • r

    rhythmic-hair-33677

    12/13/2019, 6:28 PM
    Is it possible to detect if an action was taken in an output apply? i.e. create, update
    a
    • 2
    • 7
  • b

    broad-boots-45639

    12/13/2019, 6:52 PM
    I'm having trouble making a secondary k8s node pool for digital ocean, but nothing is standing out to me in debug mode or verbose logging to point me in the right direction. I'm getting
    panic: fatal: An assertion has failed: Kubernetes GVK is: "urn:pulumi:nyc1-stage::kubernetes::digitalocean:index/kubernetesNodePool:KubernetesNodePool::kubernetes-secondary"
  • b

    broad-boots-45639

    12/13/2019, 6:53 PM
    const cluster = new digitalocean.KubernetesCluster(project_name, {
        region: digitalocean.Regions.NYC1,
        version: "1.15.5-do.2",
        nodePool: {
            name: `pulumi-${env}-default-nodepool`,
            size: "c-4",
            autoScale: true,
            minNodes: 2,
            maxNodes: 6
        }
    });
    
    export const kubeconfig = cluster.kubeConfigs[0].rawConfig;
    export const clusterName = digitalocean.KubernetesCluster.name;
    export const clusterID = cluster.id;
    
    const provider = new kubernetes.Provider("do-k8s", { kubeconfig })
    const nodepool_name = `${project_name}-secondary`;
    
    const node_pool = new digitalocean.KubernetesNodePool(nodepool_name, {
          name: nodepool_name,
          clusterId: cluster.id,
          size: "c-32",
          autoScale: true,
          minNodes: 1,
          maxNodes: 3
        }, { provider, dependsOn: cluster } );
  • b

    broad-boots-45639

    12/13/2019, 6:53 PM
    Has anyone got a working example, or see what I'm doing incorrectly?
    g
    • 2
    • 4
  • b

    breezy-agency-15661

    12/13/2019, 7:06 PM
    Stupid question, but I can’t find the answer in the docs - for AWS functionality, am I supposed to rely on the pulumi SDK or I have to bring in the aws sdk? Asking because when I put the following in the lambda callback, the code is crashing because pulumi did not include the necessary modules into the lambda:
    let secret = await aws.ssm.getParameter({
                name: "passwordParameter"
            });
    console.log(secret.value);
    g
    • 2
    • 3
  • r

    rhythmic-hair-33677

    12/13/2019, 8:01 PM
    Is it possible to write a provider that forces an update when a resource that it dependsOn is updated? I could serialize its inputs as JSON and compare the string, but I wonder if there is a more elegant way.
    a
    • 2
    • 1
  • b

    breezy-agency-15661

    12/13/2019, 8:14 PM
    Could use an advice on how to attach an additional role policy to the default policy created for an implicit lambda:
    aws.cloudwatch.onSchedule("test", "rate(1 minute)", async (event) => {
        try {
            let secret = await MYSSM.getValue("mySecret");
            console.log(secret);
            console.log(`current time: ${Date.now()}`);
        } catch (e) {
            console.log(e);
        }
    });
  • b

    breezy-agency-15661

    12/13/2019, 8:16 PM
    In general, I’m struggling to understand on how to modify the resources that you do not create directly. Or the only way is to create and tie everything together manually?
    w
    • 2
    • 1
  • n

    nice-airport-15607

    12/13/2019, 11:06 PM
    Hello, has anyone seen this error?
    error: aws:lambda/function:Function resource 'someLambda' has a problem: expected runtime to be one of [dotnetcore1.0 dotnetcore2.0 dotnetcore2.1 go1.x java8 nodejs4.3 nodejs4.3-edge nodejs6.10 nodejs8.10 nodejs10.x provided python2.7 python3.6 python3.7 ruby2.5], got nodejs12.x
  • n

    nice-airport-15607

    12/13/2019, 11:17 PM
    I’ve also seen this error, not sure how to handle it, but its preventing me from deploying…
    Untitled
  • r

    red-garage-90347

    12/15/2019, 3:56 AM
    Hey I'm trying to deploy a nodejs app to gcloud app engine, does anyone have an example of how to do that? etc in a normal flow: 1. Pulumi creates the app engine 2. Then run npm run build 3. Navigate to folder and run gcloud app deploy
  • v

    victorious-xylophone-55816

    12/15/2019, 4:08 AM
    Hello, pardon my ignorance but I am going to ask a few stupid questions: I have been studying Kubernetes and Docker for the past two weeks, I am implementing a stack of services at my company that necessitated the use of containerized applications due to some of its core dependencies. To me, it seems like YAML is a poor way to go for managing infrastructure and configuration, so having a typed-language that can guide you during development in your IDE is a huge no-brainer. So Pulumi looks fantastic. One question I have though, is that even after reading the docs extensively, I am having a difficult time understanding why the message consistently seems to be for reproducibility. What I mean by that is, once you have configured and deployed your Kubernetes cluster and service stack, that is kind of it, isn't it? You wouldn't want to continuously re-deploy everything over and over by executing your infrastructure code. Another thing that I see is examples of deploying Serverless functions like Lambas, where the Lambda code is directly in the deployment function. That is neat, that eliminates the headache of having to separately manage the functions code and its deployment, but how do you develop/test that? I guess I am just unsure of what the typical workflow for this stuff is. Do you write your Pulumi infrastructure once, leave it there in your repo, and keep it around on the off-chance you have to re-deploy everything. Or just add small services every now and then? Its not like docker, where you can distribute the infrastructure file to your teammates so that they can get set up locally to develop. Sorry for the wall of text, but I am so lost in this whole Docker/Kubernetes and Serverless infrastructure, coming from a career of traditional monolith apps deployed with git-hooks to a plain cloud server.
  • a

    ambitious-ram-5811

    12/15/2019, 4:11 AM
    @victorious-xylophone-55816 While it looks like what your Pulumi program would do is create everything from scratch, what it ends up doing is, it compares what you currently have to what your Pulumi program requested, and does a diff
  • a

    ambitious-ram-5811

    12/15/2019, 4:11 AM
    So, if you have nothing, indeed, it will create everything from scratch - but if you already have a super similar infrastructure, Pulumi will do the minimum set of operations to get you from here to there
  • a

    ambitious-ram-5811

    12/15/2019, 4:12 AM
    (This doesn't always work and sometimes Pulumi tries to recreate things that can't practically be recreated, so you have to cancel it out, but it often does!)
  • v

    victorious-xylophone-55816

    12/15/2019, 4:13 AM
    Ahhh, okay that IS pretty cool. So the idea still though is that generally, unless you want to programmatically deploy and manage more services, you would just
    pulumi up
    once in the beginning to get your stack up on your cloud provider?
  • v

    victorious-xylophone-55816

    12/15/2019, 4:13 AM
    Or could you use it to set up local development as well?
  • v

    victorious-xylophone-55816

    12/15/2019, 4:15 AM
    (I am really struggling with how to get other devs working on the current stack I have deployed on k8s in DO, it seems like some people have separate local dev configs where they use use
    docker-compose
    to set up the services, and then only build + push/deploy the app code Docker container to k8s, while other do Kubernetes-native development by live-sync`ing their local files to a k8s service)
  • v

    victorious-xylophone-55816

    12/15/2019, 4:16 AM
    (Ideally a local setup identical to the cloud would be great, but setting up k8s is a bit of a process and I am not sure if thats the way to go)
Powered by Linen
Title
v

victorious-xylophone-55816

12/15/2019, 4:16 AM
(Ideally a local setup identical to the cloud would be great, but setting up k8s is a bit of a process and I am not sure if thats the way to go)
View count: 1