Created
August 20, 2024 01:59
-
-
Save mizzy/3013964bb5fcdb6c9eee4345cb76c9e4 to your computer and use it in GitHub Desktop.
This file contains 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 | |
state_machine_arns=$(aws stepfunctions list-state-machines | jq -r .stateMachines[].stateMachineArn) | |
for state_machine_arn in ${state_machine_arns}; do | |
echo "{ $(aws stepfunctions describe-state-machine --state-machine-arn ${state_machine_arn} \ | |
| jq -r .definition \ | |
| jq . \ | |
| grep TaskDefinition) }" \ | |
| jq -r .TaskDefinition | |
done | |
clusters=$(aws ecs list-clusters | jq -r .clusterArns[]) | |
for cluster in ${clusters}; do | |
task_arns=$(aws ecs list-tasks --cluster ${cluster} | jq -r .taskArns[]) | |
if [ -n "${task_arns}" ]; then | |
aws ecs describe-tasks --tasks ${task_arns} --cluster ${cluster} | jq -r .tasks[].taskDefinitionArn | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment