Skip to content

Support for excluding environment addons #5715

Open
@al-dpopowich

Description

I'm finding myself wanting a higher level of abstraction on conditional exclusion of Environment level addons.

Use case: we use RDS for our beta and production sites, but for short-lived feature branches used for demos and QA we prefer not to have the complexity or expense of RDS, instead preferring a postgresql container.

For example, using copilot storage init to create a RDS addon creates 9 resources and 2 outputs in the yaml patch. To exclude these resources you have to create a Conditions section then edit every Resource and Output adding a Condition, which is tedious and error prone:

Conditions:
   IsProduction: !Equals [!Ref Env, prod]
   IsBeta: !Equals [!Ref Env, beta]
   CreateRDS: !Or [!Condition IsProduction, !Condition IsBeta]

Resources:
   fooclusterDBSubnetGroup:
      Condition: CreateRDS
      ...

   fooclusterWorkloadSecurityGroup:
      Condition: CreateRDS
      ...

   fooclusterDBClusterSecurityGroup:
      Condition: CreateRDS
      ...

   ...

Outputs:
   fooclusterSecret:
      Condition: CreateRDS
      ...

   fooclusterSecurityGroup:
      Condition: CreateRDS
      ...

Feature request: add an exclude_addons property to the Environment manifest which is an array of file names in the copilot/environments/addons/ directory, e.g.:

# feature-branch Environment

name: feature
type: Environment

exclude_addons:
   # do not include RDS for feature branches
   - foo-cluster.yml

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    area/addonIssues about addons.type/enhancementIssues that are improvements for existing features.type/featureIssues that are new feature requests.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions