AWS Copilot

2 min read aws, ecs, copilot

Lab note What I wrote down while learning this by building with it. Short by design; the code is in pfeilbr/aws-copilot-playground.

learn AWS Copilot CLI

Workload Types

  • load balanced web service
  • backend service - isolated to private VPC that is accessible to frontend web app (load balanced web service)
  • scheduled job

Concepts

  • Application - a group of related services, environments, and pipelines
  • Environments - environment can have its own version of a service running allowing you to create a “test” and “production” environment
  • Service - your code and all of the supporting infrastructure needed to get it up and running on AWS
  • Jobs - ephemeral ECS tasks that are triggered by an event. uses CloudWatch’s rate expressions. Scheduled Jobs are composed of an AmazonECS Task Definition, Task Role, Task Execution Role, a Step Function State Machine for retrying on failures, and finally an Event Rule to trigger the state machine.
  • Pipelines - release pipeline that deploys your service whenever you push to your git repository. (At this time, Copilot supports GitHub, Bitbucket, and CodeCommit repositories.) When a push is detected, your pipeline will build your service, push the image to ECR, and deploy to your environments.

Notes

  • copilot cli automatically creates thw following stacks
    • aws-copilot-playground-infrastructure-roles stack
    • StackSet-aws-copilot-playground-infrastructure-777bf4f7-f4a1-469e-bbff-5113f346b47e
  • similar dev workflow to Elastic Beanstalk (eb), Cloud Foundry (cf), heroku.

Files and Directories

Running

# copilot does not allow use of root account.

copilot init

copilot deploy

copilot app show

copilot svc ls

# create new service (web, backend, scheduled)
copilot svc init

copilot svc show

copilot svc logs

# delete all resources / stack(s)
copilot app delete

Resources

Keep learning

Get new guides and courses by email

An occasional email when I publish a new guide, course or post. No spam, and you can unsubscribe any time.

Sent with Buttondown. I never share your address. Prefer a feed? Use the RSS feed.