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

    red-energy-90711

    10/02/2020, 9:55 PM
    Hi Guys. Is it possible when we provisioning for example an s3 bucket, passing the credentials by arguments instead of having it on a route like ~/.aws/credentials file? I mean, using this example: https://github.com/EvanBoyle/automation-api-examples/blob/main/inline_program/main.go It read credentials from ~/.aws/credentials or from env-vars, My idea is for example each request to an API that receives those credentials by arguments.
    l
    • 2
    • 2
  • l

    limited-rainbow-51650

    10/05/2020, 8:36 AM
    How should I set up structured configuration via the automation API? I have the following snippet in my code:
    stack.SetConfig(ctx, "osimis.orthanc:config.name", auto.ConfigValue{Value: customer})
    	stack.SetConfig(ctx, "osimis.orthanc:config.domain", auto.ConfigValue{Value: fmt.Sprintf("<http://%s.orthanc.osimis.io|%s.orthanc.osimis.io>", customer)})
    	stack.SetConfig(ctx, "osimis.orthanc:config.version", auto.ConfigValue{Value: version})
    In my stack, I retrieve the settings via:
    const demoConfig = new pulumi.Config('osimis.orthanc').requireObject<orthanc.OrthancServiceConfig>('config')
    But when running my automation program, I still have the error:
    error: Missing required configuration variable 'osimis.orthanc:config'
    https://www.pulumi.com/docs/intro/concepts/config/#structured-configuration
  • l

    limited-rainbow-51650

    10/05/2020, 8:37 AM
    In short, I need to find the programmatic version of this CLI command:
    pulumi config set --path osimis.orthanc:config.name demo
  • l

    limited-rainbow-51650

    10/05/2020, 8:59 AM
    Hmmm, looking at the source, it seems it ain’t supported. No reference to
    --path
    at all to be found: https://github.com/pulumi/pulumi/blob/3be1ea9592b305df8aeb83c3810aee9bb8adeb7a/sdk/go/x/auto/local_workspace.go#L166-L184
    l
    • 2
    • 2
  • l

    limited-rainbow-51650

    10/06/2020, 2:50 PM
    I have a container running on K8s with an automation API application. The application uses
    npm install
    in a
    Setup
    func on the
    GitRepo
    setup like adviced here: https://pulumi-community.slack.com/archives/C019YSXN04B/p1600959484002700?thread_ts=1600959097.002500&amp;cid=C019YSXN04B The app is running using a sub-image of
    pulumi/pulumi-nodejs:2.11.2
    . But when executing this, the
    npm install
    bails out. When trying this manually via an attached terminal, the
    npm install
    seems to hang around 75%. Package being installed at that moment was
    grcp-js
    , but not sure if it is related to that. Eventually, the process is killed. sigh
    l
    • 2
    • 2
  • l

    lemon-agent-27707

    10/07/2020, 7:33 AM
    Initial NodeJS support is out for code review. We should have something ready for interested parties to kick the tires with next week's CLI release. https://github.com/pulumi/pulumi/pull/5347
    πŸ™Œ 4
    πŸš€ 4
    πŸ’― 1
  • l

    lemon-agent-27707

    10/08/2020, 7:47 PM
    @salmon-account-74572 has a pretty awesome talk going on right now that demonstrates a combination of Automation API, kustomize, and Cluster API: https://cloudengineering.heysummit.com/talks/exploring-the-intersection-of-clusterapi-and-infrastructure-as-code/
    πŸ’― 2
  • s

    salmon-account-74572

    10/08/2020, 7:51 PM
    Thanks πŸ˜„
  • b

    billowy-army-68599

    10/08/2020, 8:50 PM
    @salmon-account-74572 I loved your talk, thanks so much!
    s
    • 2
    • 2
  • l

    lemon-agent-27707

    10/08/2020, 10:36 PM
    @brave-caravan-6336 gave a great talk on deploying multi-region Kubernetes, including a cool demo using Automation API to automate the process https://cloudengineering.heysummit.com/talks/shipping-a-new-multi-cloud-multi-region-kubernetes-platform-at-snowflake/
    πŸŽ‰ 3
  • l

    lemon-agent-27707

    10/09/2020, 2:20 AM
    Happy to announce that the Automation API PR has been merged for NodeJS: https://github.com/pulumi/pulumi/pull/5347 We'll do a CLI release next week that will include this in the official SDK, but here's an sneak peak for those who are interested: https://github.com/EvanBoyle/automation-api-examples/tree/main/typescript/inlineProgram That example includes VSCode debug config. Here's an example of debugging an
    .apply
    call:
    πŸŽ‰ 6
    πŸš€ 3
  • g

    gifted-student-18589

    10/09/2020, 9:40 AM
    wohooo! looking forward to trying it out! πŸ™‚
  • g

    gifted-student-18589

    10/09/2020, 9:44 AM
    btw, one question, does the automation API still require the user to download/install the Pulumi CLI first, or is this handled automatically (not-needed?) somehow? I can see this
    await stack.workspace.installPlugin("aws", "v3.6.1");
    , this looks promising already.
    t
    l
    • 3
    • 5
  • f

    famous-kite-52506

    10/13/2020, 1:28 PM
    Hi, I am a senior cloud developer at Ubisoft. We have recently decided to use Pulumi, notably the kubernetes operator, for our k8s provisioning engine we are currently building. As such, we would like to contribute to the project. Is there a proper channel of communication to help guide our potential contributions and make sure we working with the community?
    πŸŽ‰ 6
    πŸ‘πŸ½ 3
    g
    w
    b
    • 4
    • 5
  • l

    lemon-agent-27707

    10/14/2020, 10:14 PM
    The Pulumi CLI v2.12.0 is here, and with it comes the Automation API for Node.js! There's a blog post coming soon with more examples, but here some pointers to get you started: β€’ Automation API examples have been added for node: https://github.com/pulumi/automation-api-examples β€’ Node.js docs: https://www.pulumi.com/docs/reference/pkg/nodejs/pulumi/pulumi/x/automation/ β€’ CLI release page where you can find v2.12.0 (required for Automation API + Node.js): https://www.pulumi.com/docs/get-started/install/versions/ β€’ A list of known issues you can chime in on/add to: https://github.com/pulumi/pulumi/issues?q=is%3Aopen+is%3Aissue+label%3Aarea%2Fautomation-api+label%3Alanguage%2Fjavascript
    πŸ”₯ 6
    πŸŽ‰ 7
    πŸš€ 9
    πŸ‘ 2
  • l

    lemon-agent-27707

    10/19/2020, 4:30 PM
    The blog post that I mentioned is up. There are some really cool demos in there. I'm excited to hear what you all think! pulumi.com/blog/automation-api https://pulumi-community.slack.com/archives/CB36DSVSA/p1603124967060500
    πŸ‘ 2
    πŸš€ 1
    m
    • 2
    • 1
  • b

    boundless-insurance-52858

    10/19/2020, 6:06 PM
    How high is the support of the other storage backends on you list?
  • b

    boundless-insurance-52858

    10/19/2020, 6:08 PM
    I’d really like to build a POC around our current infrastructure to provision everything we need for a new customer. However we currently have all of our state files in Azure storage. Having access to these backends would be A+ for my use case.
    b
    l
    c
    • 4
    • 9
  • p

    prehistoric-librarian-12686

    10/20/2020, 7:59 AM
    Pulumi newbie here - just read about automation API. Is my understanding correct when I say that - earlier pulumi gave a cli with an ability to define infra in your fav prog lang - so the interface to the user was the
    pulumi
    command and now with automation api -
    pulumi
    command itself is a lib call and can be wrapped over custom REST APIs to abstract the infra management process?
    l
    • 2
    • 1
  • p

    prehistoric-librarian-12686

    10/20/2020, 10:35 AM
    Is pulumi automation api same as https://github.com/hashicorp/terraform-cdk - just trying to understand the differences. In case of TF CDK it says -
    The CDK for Terraform project helps users define infrastructure resources using supported programming languages and generates a Terraform configuration in JSON
    But in case of Pulumi - there is no interim DSL generated right? So the infra deployment capability is provided by the lib as a feature and does not need an extra step of running the deployer i.e. to do a
    pulumi up
    or
    terraform apply
    l
    • 2
    • 1
  • p

    prehistoric-librarian-12686

    10/21/2020, 3:59 AM
    Thanks for the detailed explanation @lemon-agent-27707 - this helps clear my doubts.
    πŸ˜›artypus-8bit: 1
  • l

    lemon-agent-27707

    10/24/2020, 6:22 AM
    We’ve scoped the effort for Python and C# including details on timeframe. Please take a look at the issues if you’re interested in following process or contributing to help accelerate the timeline. β€’ Python β€’ C# I'll be out on vacation this next week, but members of the team will be around for support if there is anyone who wants to get started contributing!
    πŸ‘ 1
    w
    f
    c
    • 4
    • 4
  • c

    curved-pharmacist-41509

    11/02/2020, 11:55 PM
    Is there a way to set array config items in the new node SDK? Or is it just basic string values at the moment
    l
    • 2
    • 2
  • b

    brief-alligator-51254

    11/03/2020, 11:27 AM
    maybe a silly question, but how do I keep the console logs great when I transition to the automation api? the cli version (left) is much more concise than the automation api one (right). Is there any workaround for keeping the great experience I am used to having?
    🐞 1
    l
    • 2
    • 4
  • f

    fancy-jelly-61092

    11/03/2020, 3:47 PM
    Is it possible to use dynamic resources (i.e.
    extends pulumi.dynamic.Resource
    ) in a nodejs inline program using the Automation API? I get an exception:
    Error: Cannot find module '@pulumi/pulumi/cmd/dynamic-provider'
    as well as
    error: could not read plugin [C:\Users\barcl\.pulumi\bin\pulumi-resource-pulumi-nodejs.cmd] stdout: EOF
    . The installation works perfectly well using the traditional CLI-driven method
    l
    w
    • 3
    • 3
  • h

    hundreds-musician-51496

    11/04/2020, 1:32 AM
    If I call
    refresh()
    on a stack that doesn't exist, what happens? Is that an error or no-op? (Using TypeScript if it matters)
    l
    • 2
    • 2
  • c

    curved-pharmacist-41509

    11/04/2020, 12:21 PM
    If I don't want to check in the stack config files, can I simply getOrCreateStack, set all the config again then run
    up
    ?
    l
    • 2
    • 2
  • h

    hundreds-musician-51496

    11/04/2020, 6:15 PM
    I'm trying to run a program using the automation API and getting this error:
    Error: Program run without the Pulumi engine available; re-run using the `pulumi` CLI
    at requireTestModeEnabled (C:\Users\Justin\Source\foo\internal-docs\deploy\node_modules\@pulumi\pulumi\runtime\settings.js:108:15)
    at Object.getMonitor (C:\Users\Justin\Source\foo\internal-docs\deploy\node_modules\@pulumi\pulumi\runtime\settings.js:190:13)
    at Object.readResource (C:\Users\Justin\Source\foo\internal-docs\deploy\node_modules\@pulumi\pulumi\runtime\resource.js:48:32)
    at new Resource (C:\Users\Justin\Source\foo\internal-docs\deploy\node_modules\@pulumi\pulumi\resource.js:204:24)
    at new CustomResource (C:\Users\Justin\Source\foo\internal-docs\deploy\node_modules\@pulumi\pulumi\resource.js:303:9)
    at new StackReference (C:\Users\Justin\Source\foo\internal-docs\deploy\node_modules\@pulumi\pulumi\stackReference.js:44:9)
    at C:\Users\Justin\Source\foo\internal-docs\deploy\index.ts:64:193
    at Generator.next (<anonymous>)
    at C:\Users\Justin\Source\foo\internal-docs\deploy\index.ts:8:71
    at new Promise (<anonymous>)
    I'm sure i'm missing something obvious. (thread)
    f
    l
    • 3
    • 6
  • h

    hundreds-musician-51496

    11/04/2020, 8:14 PM
    Can I set tags on a stack using the API, and if so how? Link to example or docs is fine ...
    l
    • 2
    • 3
  • h

    hundreds-musician-51496

    11/04/2020, 10:19 PM
    I'm creating a cloudfront distribution with attached lambda functions ("Lambda@Edge"). The ARN and Version properties on my lambda functions (
    aws.lambda.CallbackFunction
    ) are resolving to
    undefined
    inside
    apply
    . Why would that be? (thread)
    l
    • 2
    • 5
Powered by Linen
Title
h

hundreds-musician-51496

11/04/2020, 10:19 PM
I'm creating a cloudfront distribution with attached lambda functions ("Lambda@Edge"). The ARN and Version properties on my lambda functions (
aws.lambda.CallbackFunction
) are resolving to
undefined
inside
apply
. Why would that be? (thread)
Relevant code, creating a lambda & associating it with CloudFront:
directoryRetryHandler = new aws.lambda.CallbackFunction(`...`, {
  ...
}),

docsDistribution = new aws.cloudfront.Distribution(`...`, {
  defaultCacheBehavior: {
    ...
    lambdaFunctionAssociations: [{
      eventType: "origin-response",
      lambdaArn: pulumi.interpolate`${directoryRetryHandler.arn}:${directoryRetryHandler.version}`,
    }]
  }
}),
When I try to bring the stack up, AWS complains:
error creating CloudFront Distribution: InvalidLambdaFunctionAssociation: Invalid function ARN: undefined:undefined
This same code previously worked with the CLI ...
l

lemon-agent-27707

11/04/2020, 10:29 PM
I believe you are hitting this known issue: https://github.com/pulumi/pulumi/issues/5578 The workaround is setting the `workdir`: https://github.com/pulumi/halloumi/blob/main/nodejs/app/index.ts#L106
h

hundreds-musician-51496

11/04/2020, 10:31 PM
Ah I'll try that
That did the trick, thanks!
View count: 1