This repository basic tutorial for AWS ECS. This contains some contents below.
- EC2 Launch Mode ECS
- Fargate Launch Mode ECS
- How to build and release your app to ECS with CircleCI
- AWS Account
- AWS S3 Bucket
- use for cloudformation
- use for ecr
- AWS CLI Authenticate
- CircleCI Account
- Set environments below in each context
- CLUSTER_NAME
- SERVICE_NAME
- AWS_ECR_ACCOUNT_URL
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_REGION_NAME
- Set environments below in each context
- Package templates in CloudFormation
aws2 --profile taisho6339 \
cloudformation package \
--s3-bucket ecs-sample-project \
--template-file deployments/ec2-cluster/cloudformation/bootstrap-template.yml \
--output-template-file deployments/ec2-cluster/cloudformation/bootstrap.yml
- Deploy stack in CloudFormation
aws2 --profile taisho6339 \
cloudformation deploy \
--template-file deployments/ec2-cluster/cloudformation/bootstrap.yml \
--stack-name ec2-sample-cluster \
--capabilities CAPABILITY_IAM \
--parameter-overrides ImageName=[YOUR_ECR_IMAGE_URI]
- Package templates in CloudFormation
aws2 --profile taisho6339 \
cloudformation package \
--s3-bucket ecs-sample-project \
--template-file deployments/fargate-cluster/cloudformation/bootstrap-template.yml \
--output-template-file deployments/fargate-cluster/cloudformation/bootstrap.yml
- Deploy stack in CloudFormation
aws2 --profile taisho6339 \
cloudformation deploy \
--template-file deployments/fargate-cluster/cloudformation/bootstrap.yml \
--stack-name fargate-sample-cluster \
--capabilities CAPABILITY_IAM
- Package templates in CloudFormation
aws2 --profile taisho6339 \
cloudformation package \
--s3-bucket ecs-sample-project \
--template-file deployments/fargate-batch-cluster/cloudformation/bootstrap-template.yml \
--output-template-file deployments/fargate-batch-cluster/cloudformation/bootstrap.yml
- Deploy stack in CloudFormation
aws2 --profile taisho6339 \
cloudformation deploy \
--template-file deployments/fargate-batch-cluster/cloudformation/bootstrap.yml \
--stack-name fargate-batch-sample-cluster \
--capabilities CAPABILITY_IAM
- Create ECR
aws2 --profile taisho6339 \
cloudformation create-stack \
--stack-name ecs-study-ecr \
--template-body file://deployments/ecr/cloudformation/create-ecr.yaml