https://pulumi.com logo
#automation-api
Title
# automation-api
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.
Copy code
Outputs:
artifact_bucket_name      : "12345-dev-codebuild-artifacts"
asg_name                  : "12345-dev"
etc ...
l

little-cartoon-10569

08/24/2021, 2:40 AM
If you're getting at them via a script after the program has finished, you can use
pulumi stack output
, and optionally add the
--json
flag if that's helpful.
If you're getting at them inside your automation-api program, after
up()
has completed, then you can use the
outputs()
method of the stack.
1
l

lemon-dog-29241

08/26/2021, 1:13 AM
@little-cartoon-10569 Do you have the documentation for that by chance (python)?
l

little-cartoon-10569

08/26/2021, 1:18 AM
Looking now... Python docs are woeful. Strongly recommend using Typescript, if only for the docs...
Hmm.. link says "LocalWorkspace"... that's concerning.
Ah, here's the link to the version for non-local workspaces: https://www.pulumi.com/docs/reference/pkg/python/pulumi/#pulumi.automation.Stack.outputs
l

lemon-dog-29241

08/26/2021, 1:40 AM
Thank you! 🙂
👍 1
@little-cartoon-10569 I'm getting this error where it looks like its a dict, but when I go to add it to DynamoDB, I'm getting this error:
[ERROR] TypeError: Unsupported type "<class 'pulumi.automation._output.OutputValue'>" for value "'12345-dev-codebuild-artifacts'"
It's like as a whole the type is a dict, but each individual value is a pulumi output still and not just a string. Any thoughts? Would an apply be appropriate...?
l

little-cartoon-10569

08/27/2021, 2:23 AM
Yes, you might need to use apply. Add things to DynamoDB from inside a loop of applies.
1