aws / copilot-cli

The AWS Copilot CLI is a tool for developers to build, release and operate production ready containerized applications on AWS App Runner or Amazon ECS on AWS Fargate.
https://aws.github.io/copilot-cli/
Apache License 2.0
3.48k stars 401 forks source link

Supporting additional AWS resources #644

Closed efekarakus closed 3 years ago

efekarakus commented 4 years ago

Overview

Currently users can’t add other resources, such as a S3 bucket, to their application’s architecture beyond what is provided in the manifest. This issue describes the proposed solution and tracks the sub-tasks to deliver the feature.

Proposed design

We're proposing to add new top-level commands for resource categories that are likely to be common: secrets, storage, and mesh.

addons

A user that runs ecs-preview storage init will be greeted with a helpful interactive prompt to guide them through the AWS service's concepts and fill any required fields.

The resulting directory structure will be as follows, with the generated CloudFormation resources under the addons/ directory:

./
├── Dockerfile
├── LICENSE
├── app.js
└── ecs-project/
    └── {appName}/
        ├── addons/
        │   ├── {resourceName}-table.yml
        │   ├── outputs.yml
        │   ├── params.yml
        │   └── policy.yml
        └── manifest.yml

Users can then modify any of the files under addons/ except params.yml to tweak their service. If a service is not offered as a command, they'll be able to create the CFN template themselves and drop it under addons/.

Output values in outputs.yml will be added as environment variables to their app container in their ECS service.

The templates under addons/ will be glued together and ingested as a nested stack under their application stack.

Milestones

  1. Deliver custom addons

The remaining milestones are to create the commands that write to the addons/ directory. The commands that we're considering:

  1. ecs-preview storage init will allow you to create S3 buckets, DDB tables, Aurora serverless db cluster.
  2. ecs-preview secrets init will allow you to create SecretsManager secrets.
  3. ecs-preview mesh init will allow you to create an AppMesh mesh.
efekarakus commented 4 years ago

@hencrice 's suggestion: for the params.yml file we create it with a file permission of 400 so that only the user has permission to read and hints that the file should not be modified.

efekarakus commented 3 years ago

Closing this issue as we delivered this feature :)