Helps you assume administrative roles in various AWS accounts without having to rely on pre-configured AWS Profiles.
This especially helps with CI/CD pipelines for aws cli commands that require --profile flags.
Please configure env-conf.json with your pre-existing admin roles created in your accounts.
It consists of role (the role to assume) and region for some region specific operations.
python main.py <environment>
The output of this script is clean in a way that we can source it directly.
eval "$(python main.py <environment>)"
The argument can be used in dynamic pipelines or dynamic settings, as well. You could use this pattern:
# Describe the env with this variable and use it along with the rest of the commands
"ENV=${@#--}"
# Sample
"deploy-backend": [
"ENV=${@#--}",
"eval $(python main.py $ENV",
"pip install -r requirements.txt",
"python infrastructure/modules/get-secrets/getSecrets.py $ENV",
"bash infrastructure/modules/deploy-backend/deploy-backend.sh $ENV"
]