Last active
December 2, 2016 09:44
-
-
Save mlf4aiur/acdbeb271ccda86934866e1310d6fb7c to your computer and use it in GitHub Desktop.
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
| function update_ecs_agent () { | |
| local cluster_name=$1 | |
| local container_arns | |
| local container_arn | |
| # Get container instances | |
| container_arns=$(aws --output json \ | |
| ecs list-container-instances \ | |
| --cluster "${cluster_name}" | \ | |
| jq '.containerInstanceArns[]' | tr -d '"' | tr "\n" " ") | |
| for container_arn in ${container_arns}; do | |
| echo "Update ${container_arn}" | |
| aws ecs update-container-agent \ | |
| --cluster "${cluster_name}" --container-instance "${container_arn}" >/dev/null | |
| done | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment