Is there a simple pattern for a one-time deployment of a resource? For example, with aws OIDC providers there can only ever be one per provider URL, so we only want this resource deployed once ever, not once per stack, but we also don't want it torn down on other stacks because of the diff.
elegant-oyster-42272
05/11/2024, 12:49 AM
The suggestion by pulumi AI results in the diff causing pulumi to think we're wanting to destroy the oidc provider on subsequent runs
elegant-oyster-42272
05/11/2024, 12:51 AM
Oh, maybe I'm being dumb about this.. I could just check the stack name and if it's
production
then we deploy this resource and if not.. we don't.
elegant-oyster-42272
05/11/2024, 12:51 AM
Then anything that needs that resource can pull the output from the production stack?
elegant-oyster-42272
05/11/2024, 1:29 AM
Yep, that turned out to work.
🙌 1
l
little-cartoon-10569
05/12/2024, 3:26 AM
A better approach is to use different projects for this. If you want only one of a certain resource, then it should be in a project that has only one stack.
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.