Skip to content

[Proposal] Support for environment-specific addons #3112

@adrienlauer

Description

@adrienlauer

This is a proposal to fix issue #1975 regarding the ability to create environment-specific resources. These resources would be shared across all services.

An _addons subdirectory containing environment add-ons would be created in the copilot directory. This would contain addons that apply to all environments. To specify an addon for a specific environment, a subdirectory named after the environment would be created.

Example:

<project-root>
    |- copilot/
        |- _addons/
            |- addon-1.yml
            |- addon-2.yml
            |- dev/
                |- dev-addon-1.yml
            |- prod/
                |- prod-addon-1.yml
        |- service1/
            |- addons/
                |- service-addon-1.yml
            |- manifest.yml

Environment resources would be created automatically when the first service is deployed. For a specific environment, all relevant add-ons would be merged into a unique CF stack, deployed before the service add-ons stack.

Considering the example above, the copilot svc deploy -e dev -n service1 would execute the following steps:

  1. The environment add-ons CF stack, containing addon-1.yml, addon-2.yml and dev-addon-1.yml, is deployed.
  2. The service1 add-ons CF stack, containing service-addon-1.yml, is deployed as usual.
  3. The service1 CF stack is deployed as usual.

Environment add-ons resources would be deleted only when the environment itself is deleted.

This solution seems to nicely integrate in the current copilot workflow. Some commands could be added in the future (like copilot env update) to improve upon this solution.

I am proposing this with @rverpillot and we are reasonably confident to be able to propose a PR, so feel free to criticize and improve upon this idea. Obviously, we'll start working on this only if approved by the team. Thanks !

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/envIssues about environments.size/XLWe should be able to deliver a XL issue in several sprints.type/designIssues that are design proposals.type/featureIssues that are new feature requests.type/requestIssues that are created by customers.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions