Hey all, anyone knows how to make pulumi deploy my...
# aws
s
Hey all, anyone knows how to make pulumi deploy my stack to an entirely new AWS account? I created a stack with all resources, based on my current account. The goal was to switch to IaC as a way of life. Now, in order to test, my company set up a new account, and aims to run the stack on it - in order to test we are on par. I worked with the documentation (set a new env variables for access key and secret key of the new account), ran 'pulumi preview' and yet - I get 403, even though I'm sure the credentials I typed are correct Anyone knows how to make the switch?
b
did you create a new stack? or use the existing stack?
s
Use the existing stack. Shall I create a new one? (And if so, how to make all resources of the old account in it)
b
you can’t move all the resources. What’s the end goal here? All the resources in account A now live in new account B?
s
That's the goal
b
I would just destroy stack A with
pulumi destroy
and change the credentials, then run
pulumi up
with the new creds
unless you need to migrate data, in which case you’re going to have to do some lifting
s
No need to migrate data, simply create the same resource on the new env
And how would I go changing the credentials? Is it written somewhere in pulumi beside the .aws?
b
how did you initially set them?
s
Using env variables
b
okay, so credentials are associated to a stack
so do the following:
Copy code
# make sure you're authenticated to the original account
export AWS_ACCESS_KEY_ID=whatever your key is
export AWS_SECRET_ACCESS_KEY=whatever your secret key is
pulumi destroy

# then set up new environment variables for the new account
export AWS_ACCESS_KEY_ID="new access key"
export AWS_SECRET_ACCESS_KEY="new secret key"
pulumi up
s
Thank you!!