Last active
November 1, 2018 08:18
-
-
Save mrserverless/e5cab300e4537cb4ea9b4b4eb56a3077 to your computer and use it in GitHub Desktop.
make assumeRole
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
_assumeRole: | |
ifndef AWS_SESSION_TOKEN | |
$(eval ROLE = "$(shell aws sts assume-role --role-arn "$(TF_VAR_provider_role)" --role-session-name "terraform-assume-role" --query "Credentials.[AccessKeyId, SecretAccessKey, SessionToken]" --output text)") | |
$(eval export AWS_ACCESS_KEY_ID = $(shell echo $(ROLE) | cut -f1)) | |
$(eval export AWS_SECRET_ACCESS_KEY = $(shell echo $(ROLE) | cut -f2)) | |
$(eval export AWS_SESSION_TOKEN = $(shell echo $(ROLE) | cut -f3)) | |
endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment