Fetch and export ECS definitions (service&taskdef) to files.
This is mainly created for PipeCD users.
Once you execute a command, you can generate ECS definition files like:
servicedef.yaml:
taskdef.yaml:
- Prerequisites
- You have golang
- You can execute AWS commands to your AWS account. (e.g.
aws ecs list-services --cluster <your-cluster>)
-
Execute the following command.
go run main.go --cluster <YOUR_ECS_CLUSTER_NAME> --outdir ./YOUR/TARGET/DIR
Then the definition files will be generated under
./YOUR/TARGET/DIR. -
(optional) If you want to remove unnecessary fields from the generated files, execute the following command.
find ./YOUR/TARGET/DIR -type f -exec sed -i '' \ -e '/nosmithydocumentserde:/d' \ -e '/createdat:/d' \ -e '/createdby:/d' \ -e '/deployments:/d' \ -e '/events:/d' \ -e '/loadbalancers:/d' \ -e '/pendingcount:/d' \ -e '/runningcount:/d' \ -e '/status:/d' \ -e '/tasksets:/d' \ -e '/deregisteredat:/d' \ -e '/registeredat:/d' \ -e '/registeredby:/d' {} \;


