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 get_ecs_service_instance_ips () { | |
| local cluster_name=$1 | |
| local service_name=$2 | |
| local tasks | |
| local container_arns | |
| local ec2_instance_ids | |
| # Get tasks | |
| tasks=$(aws --output json \ | |
| ecs list-tasks \ |
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 get_ecs_cluster_instance_ips () { | |
| local cluster_name=$1 | |
| local container_arns | |
| local ec2_instance_ids | |
| # Get container instances | |
| container_arns=$(aws --output json \ | |
| ecs list-container-instances \ | |
| --cluster "${cluster_name}" | \ | |
| jq '.containerInstanceArns[]' | tr -d '"' | tr "\n" " ") |
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 |
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 | |
| function delete_image () { | |
| local repo_name=$1 | |
| local image_digest=$2 | |
| echo "${image_digest}" | |
| aws --out=json \ | |
| ecr \ | |
| batch-delete-image \ | |
| --repository-name="${repo_name}" \ |
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 get_ecs_service_instances () { | |
| local cluster_name=$1 | |
| local service_name=$2 | |
| local tasks | |
| local container_arns | |
| local ec2_instance_ids | |
| echo "Cluster: ${cluster_name}" | |
| echo "Service: ${service_name}" | |
| echo "EC2 instances:" |
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 stop_ecs_service_tasks () { | |
| local cluster_name=$1 | |
| local service_name=$2 | |
| local wait_time=${3:-10} | |
| local tasks | |
| local task | |
| # Get tasks | |
| tasks=$(aws --output json \ | |
| ecs list-tasks \ |
OlderNewer