That won't work, since that code runs at the time Pulumi is generating the declarative state, but the API_URL value isn't available until after the infrastructure is deployed.
little-cartoon-10569
06/02/2022, 1:22 AM
Instead, you have to defer running that code until API_URL is available. It is available inside the call to
apply()
.
little-cartoon-10569
06/02/2022, 1:30 AM
I don't know Python, can you make something like this work?
Does the explanation / example make since? Is the difference in how apply() is being used understandable? Happy to answer more questions to clarify, this is a core concept that will make everything easier once you grok it.
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.