Copilot-cli: Env specific environment variables within pipelines

Created on 2 Oct 2020  路  6Comments  路  Source: aws/copilot-cli

My apologies if I'm missing something here.

We have setup a 2 stage pipeline, staging and production concerning a single app called api. Within our manifest we utilise the environments key to describe different environment variables depending on the copilot environment.

When testing this out via copilot svc package command the CloudFormation correctly outputs the correct variable values depending on the environment given.

Within the buildspec.yml this package command in run for each environment, outputting api.stack.yml and a api-[env].params.json file. The api.stack.yml file is overwritten each loop, leaving the last environment winning. This leaves all stages of the pipeline using the environment variables using a single environment's config.

typbug

Most helpful comment

Thanks @brudil for bring this up! We are able to reproduce the issue and working on a fix to it.

All 6 comments

Heya @brudil ! Sorry for the inconvenience, your explanation makes sense to me and it sounds like a bug.
We'll update the issue by trying to reproduce the issue and let you know

Thanks @brudil for bring this up! We are able to reproduce the issue and working on a fix to it.

@iamhopaul123 thanks. Is there a workaround to the issue until the fix is released?

Unfortunately I cannot think of any easy way to workaround this issue.

Possible workaround:

  1. Put test and prod env in different applications and make two identical services deploying to each of them.

  2. If you are not using the pipeline then this env override issue might not happen.

Heya @brudil the fixed was released last Friday (10/23) with v0.5.0: https://github.com/aws/copilot-cli/releases/tag/v0.5.0 !

Amazing, thanks for this project!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fullstackdev-online picture fullstackdev-online  路  3Comments

camilosantana picture camilosantana  路  3Comments

iamhopaul123 picture iamhopaul123  路  3Comments

tachyonics picture tachyonics  路  3Comments

kohidave picture kohidave  路  4Comments