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
#!/bin/bash | |
# Assume the role using locally configured AWS credentials, then pass the assumed role to the container via environment | |
# variables! | |
ASSUMED_ROLE=$(aws sts assume-role \ | |
--role-arn "arn:aws:iam::000000000000:role/our-role-to-assume" \ | |
--role-session-name "session_name" \ | |
--output text) |
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
docker-compose exec -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) <container> <command> |
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
PARAMS_LIST=$(aws ssm get-parameters-by-path \ | |
--path "/var/path/" \ | |
--recursive \ | |
--query 'Parameters[*].[Name, Value]' \ | |
--output text \ | |
--with-decryption) | |
# "/var/path/VARNAME variable_value" --> "export VARNAME=variable_value" | |
EXPORT_STATEMENTS=$(echo "$PARAMS_LIST" | awk '{ sub(".*/", "", $1); printf("export %s=\"%s\"\n", $1, $2) }') |