How to create an AWSCLI profile that is the same as another profile with a few changes?

Viewed 11

I am new to AWS CLI profiles.

I have a profile foo-profile, with various fields like credential_process, sso_start_url, sso_account_id, sso_role_name, etc. It is configured with sso_role_name = bar_role, and I am able to use AWS CLI to auth as this account and assume a role.

However, sometimes I want to do the same thing but with a baz_role instead. I want to create a new profile for this called foo-profile-baz. But foo-profile-baz would be identical to foo-profile, just it would have a different sso_role_name. Is there a way in .aws/config to do something like:

[profile foo-profile-baz]
import_profile = foo-profile
sso_role_name = baz_rol

?

I'm assuming there's no such keyword as import_profile since I made that up. I tried source_profile = foo-profile, but it didn't work.

0 Answers
Related