Are you correcting a mistake when you change the profile within the stack? That's unlikely to be the correct thing to do, normally. When you change the profile (and refresh, as @billowy-army-68599 says), Pulumi will destroy all the old resources because they're associated with one set of credentials, then create similar resources using the new set.
little-cartoon-10569
03/10/2021, 9:05 PM
This demonstrates why changing the profile within the provider doesn't immediately change the account (and other credentials). If it did immediately change the credentials, Pulumi would "lose" all the old resources and be unable to tear them down. So it saves the credentials with the resources, so that it can clean up.
little-cartoon-10569
03/10/2021, 9:06 PM
Generally, the correct way to set up the same resources in a new account is to create a new stack with the new account's credentials.
☝️ 1
p
polite-lighter-21850
03/11/2021, 8:17 AM
Thanks for your replies - it makes sense now - the old resources have to be destroyed otherwise they're left on the old account and would need manually destroying via the AWS CLI or console - not a problem for hello-world exercises but for a full-blown commercial app that would be a nightmare. Thanks again.