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

    colossal-vr-62639

    07/22/2021, 7:27 AM
    Is there a way to use a StackReference in the Pulumi Automation API? When I attempt to initialize a new StackReference, it complains at runtime
    Trying to acquire Deployment.Instance before 'Run' was called.
    b
    • 2
    • 2
  • i

    icy-jordan-58549

    07/29/2021, 4:25 PM
    any ideas why
    stack.up
    takes
    Duration: 1m6s
    and when this message appears, to resolve the Promise and give me output back it takes like another 1min (typescript)
    b
    • 2
    • 8
  • w

    worried-city-86458

    08/05/2021, 7:45 PM
    It feels like there aren't that many dotnet/c# devs out there so I posted an example skeleton using dotnet automation api for cli to the discussions
    r
    • 2
    • 1
  • b

    bored-oyster-3147

    08/05/2021, 8:52 PM
    We definitely exist :) my primary use-case is using Automation API in an AspNetCore API. Or more specifically in a background worker after being triggered by a request to the Web API
    👍 3
  • b

    bumpy-grass-54508

    08/05/2021, 9:28 PM
    dozens of us
    😂 2
    👍 1
    😛 1
  • f

    fierce-cat-91199

    08/06/2021, 2:10 AM
    Can I use the automation API within a resource to query if the resource is being invoked from a Create or Update?
    👋 1
    b
    • 2
    • 1
  • l

    lemon-dog-29241

    08/06/2021, 2:38 AM
    Hey all! 🙂 I'm attempting to create and validate a certificate in route53 for a new hosted zone, but I'm getting a little lost and confused with Outputs and apply and how that relates to lists. I've used apply successfully elsewhere, but basically I'm trying to figure out how I can get the
    domain_validation_options
    from the creation of my certificate and then loop through them, creating a record for each. I'll share my python in a comment. I'm a newbie all around so it's very probably I've just done something that won't work period 😂
    l
    r
    • 3
    • 18
  • l

    lemon-dog-29241

    08/08/2021, 5:09 PM
    Hey there! 🙂 I have a pulumi program that saves it's state to an S3 bucket. Everytime I run pulumi destroy, I get the message about needing to remove the configuration files. Via the cli, I know how to do this. Is there a way to force that to happen with the automation API? I know I can just go delete the files / folder from S3, but I want to confirm there isn't an easier way first. Thanks!
    l
    • 2
    • 1
  • a

    ancient-monkey-64322

    08/10/2021, 11:42 AM
    Is there a way to check if a stack is currently locked? eg if I wanted to block deploying a commit within github actions until an earlier deploy had finished
    🙏 1
    b
    l
    p
    • 4
    • 10
  • l

    limited-rain-96205

    08/11/2021, 5:26 PM
    Hi. The Pulumi testing documentation (https://www.pulumi.com/docs/guides/testing/) indicates it’s possible to do Unit Tests without the Pulumi CLI available. Does this include Automation API scenarios? If so, how do you set that up?
    b
    b
    l
    • 4
    • 8
  • t

    thousands-psychiatrist-72487

    08/13/2021, 6:35 PM
    What's up everyone, so cool there's a community channel for the automation api
  • t

    thousands-psychiatrist-72487

    08/13/2021, 6:36 PM
    I'm trying to run pulumi automation API in AWS lambda but I'm running into
    mkdir /home/sbx_user1051: read-only file system
    . That makes sense, since only
    /tmp
    is writable in Lambda, but I'm struggling to find the right setting to configure the write location for automation API. Has anyone run into this?
    m
    b
    • 3
    • 5
  • l

    lemon-dog-29241

    08/16/2021, 3:59 PM
    Hey everyone! I'm trying to run pulumi in lambda and having a hard time. I keep getting the error:
    {
      "errorMessage": "\n code: 255\n stdout: Updating (dev):\n\npulumi:pulumi:Stack buildbot-shared-12345-dev running\npulumi:providers:aws default_4_15_0  error: no resource plugin 'aws-v4.15.0' found in the workspace or on your $PATH, install the plugin using `pulumi plugin install resource aws v4.15.0`\npulumi:providers:aws default_4_15_0 **failed** 1 error\npulumi:pulumi:Stack buildbot-shared-12345-dev\n\nDiagnostics:\npulumi:providers:aws (default_4_15_0):\nerror: no resource plugin 'aws-v4.15.0' found in the workspace or on your $PATH, install the plugin using `pulumi plugin install resource aws v4.15.0`\n\nResources:\n1 unchanged\n\nDuration: 3s\n\n stderr: warning: A new version of Pulumi is available. To upgrade from version '3.9.1' to '3.10.1', visit <https://pulumi.com/docs/reference/install/> for manual instructions and release notes.\n",
      "errorType": "CommandError",
      "stackTrace": [
        "  File \"/var/task/handler.py\", line 71, in launch_shared_stack\n    up_res = stack.up(on_output=print)\n",
        "  File \"/var/task/pulumi/automation/_stack.py\", line 262, in up\n    up_result = self._run_pulumi_cmd_sync(args, on_output)\n",
        "  File \"/var/task/pulumi/automation/_stack.py\", line 591, in _run_pulumi_cmd_sync\n    result = _run_pulumi_cmd(args, self.workspace.work_dir, envs, on_output)\n",
        "  File \"/var/task/pulumi/automation/_cmd.py\", line 75, in _run_pulumi_cmd\n    raise create_command_error(result)\n"
      ]
    }
    I've already created a layer with pulumi as an executable, and I've set
    PULUMI_HOME
    to
    /tmp
    but I'm still getting this error. Any ideas? I'm using python.
    l
    • 2
    • 5
  • l

    lemon-dog-29241

    08/24/2021, 2:31 AM
    Hello yet again! 🙂 I want to save my stack exports as values / strings in DynamoDB, but I'm unsure how to refer to my outputs. I am exporting values and see them as Outputs, but I don't knw how to access them to save them outside of the stack.
    Outputs:
    artifact_bucket_name      : "12345-dev-codebuild-artifacts"
    asg_name                  : "12345-dev"
    etc ...
    l
    • 2
    • 10
  • p

    proud-pizza-80589

    08/24/2021, 7:51 AM
    Is there a way to configure
    await stack.workspace.installPlugin(plugin.name, plugin.version);
    to use the version installed in npm_modules? We use renovate to auto upgrade dependencies but i have to manually go in and fix up the plugin versions each time.
    l
    • 2
    • 1
  • b

    brave-afternoon-91593

    08/24/2021, 6:38 PM
    Hi there! I’m trying to configure Pulumi to use Localstack for the AWS provider with
    s.SetConfig(ctx, "aws:endpoints.route53", auto.ConfigValue{Value: "<http://localstack.localstack:4566>"})
    , but the provider keeps crashing saying “cannot validate config.” Is there another syntax I should try for setting this nested object like this?
    • 1
    • 2
  • h

    handsome-state-59775

    08/26/2021, 4:49 PM
    [Python] How can I get a stack's config file path? I know it's
    Pulumi.<stack>.yaml
    , but can I avoid hardcoding this? If the last operation I do is
    stack.set_all_config(...)
    , I'm looking to follow it up with something like
    print(stack.<config_file_path>)
    . Is something like this available?
    b
    l
    • 3
    • 8
  • c

    curved-pharmacist-41509

    08/27/2021, 7:30 AM
    Is there a way to find out if the
    --skip-preview
    flag was passed in your pulumi application?
    b
    • 2
    • 15
  • h

    hallowed-ice-8403

    09/07/2021, 11:23 AM
    Hi, Is there a method call to retrieve the input passed to the stack using stackReference ?
    l
    • 2
    • 1
  • c

    crooked-pillow-11944

    09/11/2021, 1:33 PM
    There's no reference to my current project in the stack (dev.json) I just deployed. Where is project metadata stored (if at all) when using an s3 backend with the automation API?
    b
    • 2
    • 6
  • c

    crooked-pillow-11944

    09/12/2021, 6:55 PM
    I'm using Automation API and attempting to set KMS as the secrets provider. I thought this was being done but looking at the stack metadata in S3 I'm seeing
    "secrets_providers": {"type": "passphrase",...
    I'm also being prompted for
    PULUMI_CONFIG_PASSPHRASE
    which is what started me along this journey... Can somebody tell me what I'm missing? Here's my code:
    backend_url = f"s3://{backend_bucket}"
    secrets_provider = f"<awskms://alias/{kms_alias_name}>"
    project_settings=auto.ProjectSettings(
        name='test',
        runtime="python",
        backend={"url": backend_url}
    )
    stack_settings=auto.StackSettings(
       secrets_provider=secrets_provider)
    stack = auto.create_or_select_stack(stack_name='dev',
                                        project_name='test',
                                        program=pulumi_program,
                                        opts=auto.LocalWorkspaceOptions(project_settings=project_settings,
                                                                        stack_settings={'dev': stack_settings}))
    print("successfully initialized stack")
    r
    • 2
    • 3
  • l

    lemon-dog-29241

    09/13/2021, 1:08 AM
    Hey there everyone! I am trying to launch pulumi in my aws account and have it create resources in a different account. I already have a role set up that allows my lambda admin access (just for testing) to the other account. How do I pass in that role to pulumi? Currently I'm passing in the aws access key and secret, and I'm just not sure how I pass in a role instead...?
    l
    b
    +2
    • 5
    • 41
  • c

    crooked-pillow-11944

    09/16/2021, 12:07 PM
    With automation API how can I set a config element that has a path?:
    pulumi config set --path '["parent.name"].["nested.name"]' value will set the value of parent.name to a map nested.name: value.
    b
    r
    • 3
    • 11
  • c

    crooked-pillow-11944

    09/17/2021, 12:48 AM
    Is there a way to set a project to encrypt all exports by default?
    l
    f
    • 3
    • 6
  • p

    plain-dawn-65221

    09/17/2021, 11:41 PM
    What is the correct way to catch and handle errors with the Pulumi Automation API? Here's a very small sample where we do not set the
    new ec2.Instance()
    arguments properly Errors like this result in a large number of
    UnhandledPromiseRejectionWarnings
    , fills up our logging, and if running in an unattended loop seem to crash the Pulumi runtime If someone is able to advise on the best approach for handling
    stack.up()
    errors, we'd appreciate it!
    main.js
    l
    r
    p
    • 4
    • 15
  • h

    handsome-state-59775

    09/20/2021, 8:14 AM
    [python] how do i specify the automation API equivalents of
    --debug --logflow --verbose 9
    ?
    l
    r
    • 3
    • 4
  • w

    worried-lunch-10568

    09/20/2021, 10:53 AM
    Hey! What is the correct way to get a stack reference in async task in C#?
    class Program
        {
            static async Task<int> Main(string[] args)
            {
                var stack = new Pulumi.StackReference("path to stack");
    I get error
    Unhandled exception. System.InvalidOperationException: Trying to acquire Deployment.Instance before 'Run' was called.
       at Pulumi.Deployment.get_Instance()
       at Pulumi.Deployment.get_InternalInstance()
       at Pulumi.Resource..ctor(String type, String name, Boolean custom, ResourceArgs args, ResourceOptions options, Boolean remote, Boolean dependency)        
       at Pulumi.CustomResource..ctor(String type, String name, ResourceArgs args, CustomResourceOptions options, Boolean dependency)
       at Pulumi.CustomResource..ctor(String type, String name, ResourceArgs args, CustomResourceOptions options)
       at Pulumi.StackReference..ctor(String name, StackReferenceArgs args, CustomResourceOptions options)
       at Program.Main(String[] args) in C:\...\Program.cs:line 34
       at Program.<Main>(String[] args)
    b
    r
    • 3
    • 7
  • a

    adventurous-angle-51130

    09/22/2021, 12:01 PM
    Hi guys, is there any way to delete a stack itself via automation API? Something equivalent to
    pulumi stack rm
    ?
    m
    c
    • 3
    • 3
  • m

    miniature-leather-70472

    10/01/2021, 1:37 PM
    Is there a way to tell if my automation program is correctly using Azure Key Vault as the secret provider? I've set this up as below and it doesn't error, but when I run the app and it creates the config file it does not contain the "secretsprovider" and "encryptedkey" values that I would expect to see, just the "encryptionsalt" value, which leads me to think it is still using the local provider.
    var stackArgs = new LocalProgramArgs(stackName, $"{_workingDir}/{projectName}");
    stackArgs.SecretsProvider = "<azurekeyvault://xxxxxx.vault.azure.net/keys/pulumi>";
    var stack = await  LocalWorkspace.CreateOrSelectStackAsync(stackArgs);
    • 1
    • 2
  • d

    dry-autumn-28966

    10/01/2021, 9:31 PM
    Any idea? 😕
    l
    • 2
    • 1
Powered by Linen
Title
d

dry-autumn-28966

10/01/2021, 9:31 PM
Any idea? 😕
l

little-cartoon-10569

10/03/2021, 7:27 PM
You could wrap
pulumi stack
in a
pulumi.log.debug()
?
View count: 2