The resources mightn't have been created at that time, right?
little-cartoon-10569
12/21/2023, 2:33 AM
But: no. Accessing the value of a resource property can be done only inside an
apply()
, which is a future function that is evaluated during engine execution. After planning, during execution.
little-cartoon-10569
12/21/2023, 2:35 AM
A pattern that may help is to split your project into two. The resources that strictly need to be available can be in the first project, and can export the appropriate values as stack references. The resources that depend on those guaranteed-available resources can be in the second project, and use the stack references.
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.