Skip to content

Instantly share code, notes, and snippets.

@aminmarashi
Created November 25, 2021 07:42
Show Gist options
  • Save aminmarashi/e3174dc261ee7f575b1adc1b9b386e16 to your computer and use it in GitHub Desktop.
Save aminmarashi/e3174dc261ee7f575b1adc1b9b386e16 to your computer and use it in GitHub Desktop.
Manually apply docker ECS up with cloudformation templates
#!/bin/bash
if [ -z $2 ]; then
echo "Usage: $0 [up|down] [stack name]"
exit 1
fi
if [ $1 == 'up' ]; then
aws cloudformation create-stack --stack-name $2 --capabilities=CAPABILITY_IAM --template-body file://<(docker compose convert)
elif [ $1 == 'down' ]; then
aws cloudformation delete-stack --stack-name $2
else
echo "Unsupported action: $1, supported actions: up, down"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment