How do i create a aws ecs cluster using aws fargate on the cli?
-
Find out more on AWS Fargate: https://aws.amazon.com/fargate/
This assumes you have your api keys setup already. It is the same keys used for aws cli.
Create a cluster configuration.
$ ecs-cli configure --cluster frontend --region us-east-1 --default-launch-type FARGATE --config-name fronend_config INFO[0000] Saved ECS CLI cluster configuration ec2_frontend_config.
This tells ecs to use the region and launch type. This is stored under .ecs/config
Start the ecs cluster.
$ ecs-cli up INFO[0000] Created cluster cluster=ecscluster region=us-east-1 INFO[0000] Waiting for your cluster resources to be created... INFO[0000] Cloudformation stack status stackStatus=CREATE_IN_PROGRESS VPC created: vpc-x Subnet created: subnet-x Subnet created: subnet-x Cluster creation succeeded.
After running ecs-cli up command, the cluster is created.
List the ecs clusters.
$ aws ecs list-clusters
© Lightnetics 2024