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.