
Navigate Your Containerized Apps to Success with AWS Copilot
Hands-on approach to learning AWS Copilot
1
2
curl -Lo copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-linux
chmod +x copilot && sudo mv copilot /usr/local/bin/copilot && copilot --help
1
2
curl -Lo copilot https://github.com/aws/copilot-cli/releases/latest/download/copilot-darwin
chmod +x copilot && sudo mv copilot /usr/local/bin/copilot && copilot --help
1
brew install aws/tap/copilot-cli
1
copilot init
- ECS Cluster
- ECS Service
- Fargate Tasks
- ECR Repo
- VPC
- Subnets
- Security Groups
- Load Balancer
copilot init
, copilot svc init
, copilot job init
, or copilot env init
that gets converted to an AWS CloudFormation template. Manifest files are always stored under copilot/<your service, job, or environment name>/manifest.yml.1
copilot app show
copilot init
command. This command allows you to create a test environment that contains all the AWS resources needed to provision a secure network (VPC, subnets, security groups, etc.), as well as other resources that can be shared between multiple services. These resources include an Application Load Balancer or an ECS Cluster. When you deploy your service into your test environment, it will use the test environment's network and resources. Your application can have multiple environments, and each one will have its networking and shared resources infrastructure.1
copilot env init
copilot/environments/prod/manifest.yml
.copilot init
about our service name and type where we selected Load Balanced Web Service
? AWS has some pre-defined services to cater to almost every use case. As for our application, we wanted to deploy it on Amazon Load-Balancer so we selected that service type.- Request-Driven Web Service - will provision an AWS App Runner Service to run your service.
- Static Site - will provision a dedicated CloudFront distribution and S3 bucket for your static website.
- Load Balanced Web Service - will provision an Application Load Balancer, a Network Load Balancer, or both, along with security groups, and an ECS service on Fargate to run your service.
1
copilot svc show
1
copilot job init
1
copilot job ls
real-time
flag. This will show logs from any new instances of your job after you execute the command.1
copilot job logs
1
2
3
4
5
6
7
8
9
Sample Logs:
copilot/myjob/37236ed Doing some work
copilot/myjob/37236ed Did some work
copilot/myjob/37236ed Exited...
copilot/myjob/123e300 Doing some work
copilot/myjob/123e300 Did some work
copilot/myjob/123e300 Did some additional work
copilot/myjob/123e300 Exited
1
copilot app delete