Last active
December 4, 2019 09:26
-
-
Save mikaelvesavuori/7e732fbf71d923f45a04bdd1cea9d07f to your computer and use it in GitHub Desktop.
What is needed to add an AssumeRole policy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #https://github.com/aws/aws-cli/issues/2279#issuecomment-262616353 | |
| export AWS_ACCOUNT_ID='123412341234'; | |
| export ROLE='SomeAccessRole'; | |
| export CLOUDFRONT_DISTRIBUTION_ID='E123123123123'; | |
| export SOME_ROLE='SomeUser'; | |
| curl "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip" | |
| unzip awscli-bundle.zip | |
| sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws | |
| aws sts assume-role --role-arn arn:aws:iam::${AWS_ACCOUNT_ID}:role/${ROLE} --role-session-name "RoleSession1" | |
| aws sts get-caller-identity | |
| aws cloudfront create-invalidation --distribution-id ${CLOUDFRONT_DISTRIBUTION_ID} --paths /* | |
| aws get-role —role-name ${SOME_ROLE} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment