1

We have two clusters for deploying ECS tasks - staging and production. When registering new task definition, in container definition we set ENVIRONMENT variable (can be "PRODUCTION" or "STAGING"). This creates duplicate task definitions with just "environment" values being different in container definition. So we end up with task definition revisions looking like this:

task:5
task:4
task:3
task:2
task:1

And it's hard to tell from the glance which revision has "STAGING" as environment variable and which one is "PRODUCTION". Since our deployments are automated, it's not that big of a deal, but I was wondering how others handle situation like this. Maybe there's a better way?

4
  • 1
    Usually environment segragation is done at AWS account level.
    – Andrey
    Nov 28, 2018 at 7:00
  • Thanks for reply @Andrey. I like the idea of building Docker image once, testing it in staging and "promoting" it to prod. With separate AWS accounts it seems we would have separate ECRs and would end up building different images for staging and for prod.
    – arnaslu
    Nov 28, 2018 at 7:21
  • 1
    Not necessarily. You can configure ECR policy to allow ECS from production account to pull images from Dev/stage account. Some places I worked in, there was was even a separate account just to host ECR.
    – Andrey
    Nov 28, 2018 at 10:10
  • Interesting. I don't think we'll be changing our AWS accounts setup (we split by responsibility, not by environment) right now, but I will keep it in mind. Thanks for the insights @Andrey
    – arnaslu
    Nov 28, 2018 at 13:21

0

You must log in to answer this question.

Browse other questions tagged .