The data you can see within the cloud provider, or within your pulumi state?
bored-oyster-3147
04/01/2022, 4:16 PM
Both of those should have separate static functions that you can call - if you want to retrieve the state of an existing resource there should be a pulumi static function to do so and return the result as an Output
bored-oyster-3147
04/01/2022, 4:24 PM
To be more specific, there should be a function for that specific resource type. For instance, this is the function to get an existing AWS S3 Bucket
bored-oyster-3147
04/01/2022, 4:29 PM
The above
getBucket
function will query AWS and get the current state of a bucket that may or may not already exist in your stack.
While this
Bucket.Get
function here will instead not query AWS at all, and will retrieve the state of an existing Bucket resource that already exists in your stack directly from your pulumi state.
So it depends what you want to do. Btw none of this functionality is specific to automation API, this is just pulumi program functionality.
l
lemon-agent-27707
04/03/2022, 6:36 PM
You can also access stack outputs from the stack outside of a pulumi program. So one possible pattern is:
1. read stack outputs from
main
function
2. curry them into the inline program
3. run your update
No matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.