Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design] Environment manifest #3522

Closed
Lou1415926 opened this issue May 3, 2022 · 2 comments
Closed

[Design] Environment manifest #3522

Lou1415926 opened this issue May 3, 2022 · 2 comments
Labels
area/env Issues about environments. area/manifest Issues about infrastructure-as-code templates. type/design Issues that are design proposals.

Comments

@Lou1415926
Copy link
Contributor

This issue is a design proposal to introduce manifest files for environments.

By introducing a declarative configuration similar to service or job manifests, environments will gain all the benefits of infrastructure-as-code: code reviews, easy to replicate and mutate. The manifest file will also allow Copilot to surface more environment configuration over time.

Problem statement

Today, environments can only be configured during creation with copilot env init <flags>. It’s not possible to toggle features without re-creating the environment (such as --container-insights). This becomes especially problematic as Copilot surfaces new environment configuration fields such as --import-cert-arns (#3503) that users cannot enable in their existing environments. Furthermore, commands cannot be code reviewed to ensure the organization standards are met.

Proposal

New deploy workflow

Running copilot env init -n <name> will now generate a manifest file for the environment under:

copilot/
└── environments/
    └── test/
        └── manifest.yml

After peeking and optionally making modifications to the manifest file, users will be able to deploy their environments using a new command: copilot env deploy.
Note: this means that once this feature is released, env init will no longer automatically deploy environments. Instead, clients will have to run env deploy to create or update environment stacks.

In order to view the CloudFormation template that will be generated, users can run copilot env package.

In order to generate a manifest file for existing environments, a new flag will be introduced to copilot env show --manifest that will print the manifest file representing their existing environment. Therefore, users with existing environments can create a manifest using env show —manifest instead of having deleting and re-creating the environment for the sake of manifest.

Manifest specification

The environment manifest file will initially ship with just a parity with the existing env init flags:

name: prod
type: Environment
network:
    vpc:
        id: 'vpc-12345'           # Import.
        cidr: '10.0.0.0/16'       # Configure.
        subnets:
            public:
                - id: 'subnet-11111'    # Import.
                  cidr: '10.0.0.0/24'   # Configure.
                  az: 'us-east-2a'      # Configure.
                - id: 'subnet-22222'    # Import.
                  cidr: '10.0.1.0/24'   # Configure.
                  az: 'us-east-2b'      # Configure.
            private:
                - id: 'subnet-33333'    # Import.
                  cidr: '10.0.3.0/24'   # Configure.
                  az: 'us-east-2a'      # Configure.
                - id: 'subnet-44444'    # Import.
                  cidr: '10.0.4.0/24'   # Configure.
                  az: 'us-east-2b'      # Configure.
http:  
    internet:
        cert:
            - certificate-arn-1
            - certificate-arn-2

observability:
    container_insights: true

Over time, we’ll add new properties to the manifest file to surface more power for environment such as security groups for load balancers, number of AZs in a VPC, private domain names.

Continuous delivery

Running copilot pipeline init will now prompt whether you’d like to create a pipeline for deploying your services or environments:

$ copilot pipeline init
Pipeline name: release-envs
What would you like to deploy with this pipeline?
> Services or jobs
> Environments
Repository url: https://github.com/acmecorp/repo

And the appropriate pipeline manifest and buildspec will be generated for you. Existing pipelines won’t be affected.


We’re extremely excited to surface environment manifests and bring more configurability for environments over time. Please let us know if you’ve any feedback!

@Lou1415926 Lou1415926 added area/manifest Issues about infrastructure-as-code templates. type/design Issues that are design proposals. area/env Issues about environments. labels May 3, 2022
@Lou1415926 Lou1415926 pinned this issue May 3, 2022
@Lou1415926
Copy link
Contributor Author

Related: #3030

efekarakus added a commit to efekarakus/copilot-cli that referenced this issue May 10, 2022
mergify bot pushed a commit that referenced this issue May 10, 2022
Related #3522


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
efekarakus added a commit to efekarakus/copilot-cli that referenced this issue Jul 5, 2022
mergify bot pushed a commit that referenced this issue Jul 6, 2022
Related #3522

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
mergify bot pushed a commit that referenced this issue Jul 11, 2022
Related #3522

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the Apache 2.0 License.
@efekarakus
Copy link
Contributor

This feature is now out in v1.20 🚀
Release notes: https://github.com/aws/copilot-cli/releases/tag/v1.20.0 !
Blog post: https://aws.github.io/copilot-cli/blogs/release-v120/

@efekarakus efekarakus unpinned this issue Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/env Issues about environments. area/manifest Issues about infrastructure-as-code templates. type/design Issues that are design proposals.
Projects
None yet
Development

No branches or pull requests

2 participants