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
automation-api
  • h

    hundreds-musician-51496

    11/04/2020, 11:04 PM
    It would be really nice if the output type of my pulumi program could be preserved on the stack object's outputs property, or in some other way I could make make a static guarantee about outputs returned. (thread)
    l
    • 2
    • 5
  • h

    hundreds-receptionist-31352

    11/06/2020, 11:36 AM
    Hello, I'm trying to do my first steps with automation-api and following the example in https://github.com/pulumi/automation-api-examples/tree/main/nodejs/pulumiOverHttp-ts I got the problem with passphrase must be set with PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE environment variables even if I do: export PULUMI_CONFIG_PASSPHRASE="" curl --header "Content-Type: application/json" --request POST --data '{"id":"hello3","content":"hello world\n"}' http://localhost:1337/sites {"commandResult":{"stdout":"Created stack 'hello3'\n","stderr":"error: passphrase must be set with PULUMI_CONFIG_PASSPHRASE or PULUMI_CONFIG_PASSPHRASE_FILE environment variables\n","code":255},"name":"CommandError"} surely I'm making some mistakes but can't realize yet
    f
    l
    • 3
    • 4
  • m

    microscopic-xylophone-85966

    11/12/2020, 2:21 PM
    funny, I just realized that the whole API is a wrapper around pulumi cli tool:
    cmd := exec.CommandContext(ctx, “pulumi”, args...)
    any plans to bring real programmatic api with no dependencies?
    l
    • 2
    • 2
  • c

    calm-table-93204

    11/13/2020, 1:25 AM
    I built a simple prototype of a self-service platform using automation api... for those interested, check it out here: https://medium.com/@danfhern/self-service-platform-development-made-easy-with-pulumi-4e2cf150e93c
    😛artypus-8bit: 4
    🚀 1
    🏭 2
    🤖 2
    👍 3
    🎉 1
    l
    h
    • 3
    • 3
  • m

    many-psychiatrist-74327

    11/16/2020, 8:09 PM
    👋 Hello! Is it possible to have pulumi default to “my current cluster”, when running the automation api inside a k8s pod? Context: I’m building a service that will be able to deploy some k8s resources using Pulumi. The service itself runs inside a k8s pod. I don’t want to hard-code the kubeconfig for my service. Rather, I just want it to create the resources in whatever cluster it’s running, so that I can run it in different clusters without having to change the code/configuration. Is this possible? thanks!
    b
    • 2
    • 2
  • l

    lemon-agent-27707

    11/16/2020, 10:10 PM
    Cool video from @quiet-wolf-18467 @billowy-army-68599 and @broad-dog-22463 https://pulumi-community.slack.com/archives/C84L4E3N1/p1605563754306700
  • q

    quiet-wolf-18467

    11/16/2020, 10:27 PM
    🙂 a channel! Nice. This is where I get help when I take the next steps then 🙂
  • h

    hundreds-musician-51496

    11/17/2020, 7:07 PM
    Does the automation API allow me to control what resources get updated/deleted? Is there any sort of lifecycle hook where I can affect the state of the stack or similar before pulumi performs an update?
    l
    g
    • 3
    • 12
  • k

    kind-school-28825

    11/22/2020, 1:38 PM
    How to destroy AND delete the stack using automation api? Stack#destroy method only destroys the resources defined in the stack, but the stack stays behind with the history as defined in the API documentation https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/x/automation/#Stack-destroy
    b
    • 2
    • 2
  • w

    wet-soccer-72485

    11/22/2020, 5:37 PM
    If the Pulumi Automation API can’t find modules needed by my Dynamic Resource Provider, is that a sign my working directory might be wrong?
    + pulumi-nodejsdynamic:Resource xyz creating error: _my_logger__WEBPACK_IMPORTED_MODULE_6__ is not defined
    + pulumi-nodejsdynamic:Resource xyz **creating failed** error: _my_logger__WEBPACK_IMPORTED_MODULE_6__ is not defined
    • 1
    • 2
  • w

    white-midnight-53747

    11/23/2020, 3:24 PM
    Hi, been looking into automation-api for a few days, on one of my (go) experiments to simply stand up an ec2 instance, my application is blocking when calling aws.GetAmi. When stepping through, the execution appears to stall around
    pulumirpc.InvokeRequest
    Be grateful if anyone who has seen this could point me in the right direction to progressing past this. I'm more or less following the example from the documentation page and the output is stuck printing Updating........
    b
    • 2
    • 2
  • k

    kind-school-28825

    11/24/2020, 4:57 AM
    Hey all, I just wrote a short article on something that I have been working on for a bit that might come in handy for some of you who is working with github actions and pulumi. A way to create a stack on every PR, and destroy when that PR is merged to fail fast during the development cycle using the automation API. Would love to have any input 🙂 https://qasimalbaqali.medium.com/deploy-a-stack-on-every-pull-request-using-pulumi-and-github-actions-d5dbfa8946f6
    ❤️ 2
    h
    g
    • 3
    • 7
  • w

    wet-soccer-72485

    11/29/2020, 8:51 AM
    Kind of a long shot… but has anyone had success serializing a React app (specifically React DOM’s Server module) to render a React tree within a GCP Cloud Function or AWS Lambda function. Never tried this, but was hoping to use React to power the templating of the HTTP Callback Response.
    p
    • 2
    • 17
  • f

    fancy-shoe-29676

    12/14/2020, 7:42 PM
    hi, i try to create a new stack with the automation api. i want to use the awskms as secretProvider but everything i tried did not work 😕 i always get the message that i have to provide the passphrase environment variable. i tried to set the secretProvider un the LocalWorkspaceOptions and i tried it in the Stack settings … both did not work - i am using typescript
  • f

    fancy-shoe-29676

    12/14/2020, 7:45 PM
    const projectName = "project"
    
        const args: InlineProgramArgs = {
            stackName: "dev",
            projectName: projectName,
            program: pulumiProgram
        };
    
        const projectSetting: ProjectSettings = {
            name: projectName,
            runtime: "nodejs",
            backend: {
                url: "<s3://pulumi-states>"
            }
        }
    
        const stackSettings: StackSettings = {
            secretsProvider: "<awskms://alias/pulumi?region=eu-central-1>"
        }
    
        const opts: LocalWorkspaceOptions = {
            projectSettings:  projectSetting,
            stackSettings: {
                "dev": stackSettings
            },
            secretsProvider: "<awskms://alias/pulumi?region=eu-central-1>"
        }
    
        // create (or select if one already exists) a stack that uses our inline program
        const stack = await LocalWorkspace.createOrSelectStack(args, opts);
    f
    • 2
    • 3
  • f

    fancy-shoe-29676

    12/14/2020, 7:55 PM
    Hm, i renamed the stack and it worked for the first time - a second run fails again with the PASSPHRASE requirement
    l
    • 2
    • 6
  • w

    white-midnight-53747

    12/15/2020, 10:24 AM
    Hi all, any examples of writing unit tests (go) when using automation-api that you can share? Any special considerations or design patterns we should use to facilitate this best? Thanks.
    l
    • 2
    • 1
  • e

    echoing-angle-67526

    12/22/2020, 5:08 AM
    are there any plans to publish and support the apis used by app.pulumi.com? it would be nice to use them in conjunction with the automation api to fully automate all programs and stacks in an organization and know they won't one day change.
    b
    • 2
    • 4
  • e

    echoing-angle-67526

    12/22/2020, 5:11 AM
    being able to query the projects, repos and stacks in an organization opens up a lot of possibilities.
    ☝️ 1
  • m

    magnificent-restaurant-51456

    12/23/2020, 10:19 AM
    Hi, I am new to the automation api in pulumi. Is there any video that I can start learn ?
    b
    • 2
    • 1
  • p

    proud-pizza-80589

    12/26/2020, 1:14 PM
    I’m moving my standalone code over to a worker using the automation api, based on the examples i gather i have to install plugins by calling `await stack.workspace.installPlugin("aws", "v3.6.1");`and that they are not installed automatically like in the stand alone version? And, where can i find the possible versions?
    l
    • 2
    • 3
  • p

    proud-pizza-80589

    12/26/2020, 1:43 PM
    Additionally:
    await stack.setConfig("somesecret", { value: "s3cr3t", secret: true });
    Is
    s3cr3t
    in this case plain text or the encrypted value i get from a
    pulumi config set somesecret s3cr3t --secret
    ?
    l
    • 2
    • 1
  • a

    astonishing-shoe-68042

    12/27/2020, 10:14 AM
    I'm having an issue with setting config with digital ocean provider when writing an inline automation program. I'm doing this
    await stack.setConfig('digitalocean:token', secrets['digitalocean:token']);
        const v = await stack.getConfig('digitalocean:token');
        console.log(v.value);
  • a

    astonishing-shoe-68042

    12/27/2020, 10:14 AM
    the console.log shows 'undefined' and when I try to create a resource I get a 401 error.
  • a

    astonishing-shoe-68042

    12/27/2020, 10:23 AM
    ok i figured it out after looking at https://pulumi-community.slack.com/archives/C019YSXN04B/p1608990218193500. turns out I needed to use an object format. this works now:
    await stack.setConfig('digitalocean:token', { value: secrets['digitalocean:token'], secret: true });
    🙌 1
  • p

    proud-pizza-80589

    12/28/2020, 1:17 PM
    How should I handle errors best? I have an inline program in typescript that deploys a GKE cluster. Which errored out because i forgot to set the zone (fyi, it is marked as optional in the docs if you always pass in a location, but anyway, small effort to set it) But the weird thing is my application “hangs”. The in progress spinner in the pulumi site keeps spinning and my “job” stalled. I restarted my application so that is “solved” but the pulumi site is still spinning. I would expect if the program errors, that the
    await stack.up()
    would throw?
    l
    • 2
    • 9
  • p

    proud-pizza-80589

    12/31/2020, 10:11 AM
    Another weird issue, we use the automation api in an application that runs on dev under nodemon, so it restarts when you modify a file. If an
    up
    is running during a restart, it leaves zombie processes running. Is there a way to cancel an
    up
    cleanly?
    r
    • 2
    • 3
  • p

    proud-pizza-80589

    01/06/2021, 6:16 PM
    Has anyone have an idea why using the eks package to create a cluster would give me this error? I found something similar in an issue, but the workdir workaround is not helping. GKE and AKS clusters work perfectly. Am i missing a plugin? I’m installing
    await ws.installPlugin('aws', 'v3.22.0');
    but i cannot install an eks one so i gathered this is enough?
    b
    l
    • 3
    • 12
  • b

    brainy-ocean-92780

    01/06/2021, 6:46 PM
    #automation-api I'm creating resources using Pulumi in Azure. I then have to pass information as a consequence of those resources back into Azure. An example is creating an Sql Database in Azure and then adding an administration group to it. The resource is stood up via Pulumi and I have an Azure Cli script that can perform the administrator group addition. However I need to update the Azure Cli scrip to include the ResourceGroupName and SqlServerName to the script. Basically I need a way to get those values back from pulumi so I can feed them into the script. Is the Automation-Api the best way to do that or is there some better way to get those values?
    b
    l
    • 3
    • 3
  • p

    proud-pizza-80589

    01/06/2021, 10:57 PM
    @lemon-agent-27707 one more question, @brave-planet-10645 told me about some concerns about concurrency. while i understand that the config setting for one stack etc is not concurrency enabled, can i safely run pulumi.up on 2 different stacks at the same time (using automation api)?
    l
    c
    • 3
    • 5
Powered by Linen
Title
p

proud-pizza-80589

01/06/2021, 10:57 PM
@lemon-agent-27707 one more question, @brave-planet-10645 told me about some concerns about concurrency. while i understand that the config setting for one stack etc is not concurrency enabled, can i safely run pulumi.up on 2 different stacks at the same time (using automation api)?
l

lemon-agent-27707

01/06/2021, 11:03 PM
For nodejs, one concurrent update per nodejs process. I updated the relevant issue with comment here https://github.com/pulumi/pulumi/issues/5449#issuecomment-755768711
The Go SDK does not have this limitation as it doesn't utilize global state in the same way.
p

proud-pizza-80589

01/06/2021, 11:09 PM
ok, thx, that is a serious limitation but for now i can work around it. Is this something that wil change in q1 2021 or shouldn’t i wait for it?
l

lemon-agent-27707

01/06/2021, 11:59 PM
TBD, we have not finalized the plan for automation api GA
c

clever-byte-21551

01/07/2021, 6:48 AM
@proud-pizza-80589 I’m using Go and I’m running multiple stack updates at the same time (using the automation API)
View count: 1