Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

assuming two profiles #823

Open
sebas-500 opened this issue Jan 29, 2025 · 1 comment
Open

assuming two profiles #823

sebas-500 opened this issue Jan 29, 2025 · 1 comment

Comments

@sebas-500
Copy link

I'm trying to apply terraform code that has two profiles configured

I ran

assume profile1
assume profile2

when I do terraform plan, the credentials for profile1 are gone.

To apply this kind of terraform I need to run

aws sso login --profile profile1
aws sso login --profile profile2

Is it possible to use assume tool for this kind of task?

@MDBeudekerCN
Copy link

When you run assume $profile, you receive temporaty credentials from your identity provider.

When assume another role, you get new credentials, so the 1st set of credentials are not used anymore

you can validate this by running aws sts get-caller-identity

not sure why you would want to assume two different roles with terraform by the way, I separate workloads for different accounts and run these workloads separate from each other

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants