That should be done outside of Pulumi. You can call your cloud provider's SDK to get the current value synchronously, before Pulumi starts doing its thing (that is: don't do it inside the component resource, do it in index.ts or similar). Then pass it to where it needs to be and apply your logic.
little-cartoon-10569
03/16/2022, 10:04 PM
Or, if you wanted to do it asynchronously, you could look it up inside the constructor, but that introduces more opportunity to fail during deployment.
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.