Skip to content

Commit

Permalink
feat: update ecr image tagging strategy to use stable for production
Browse files Browse the repository at this point in the history
- Modified Terraform configuration to tag ECR images with both `latest` and `stable`.
- `Latest` is automatically applied to the dev environment for the latest version.
- `stable` is manually tagged to indicate a version that is ready for promotion to
  the production environment.
  • Loading branch information
jboix committed Oct 15, 2024
1 parent e11bef5 commit d8d2610
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "aws_ecs_task_definition" "transfer_task" {
container_definitions = jsonencode([
{
name = "pillarbox-monitoring-transfer"
image = "${local.ecr_repository}/pillarbox-monitoring-transfer:latest"
image = "${local.ecr_repository}/pillarbox-monitoring-transfer:${local.ecr_image_tag}"
readonlyRootFilesystem = true

# Port mapping for the container
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ locals {
ecs_cluster_name = "${var.application_name}-cluster"
is_prod = terraform.workspace == "prod"
ecr_repository = "${var.account_ids["prod"]}.dkr.ecr.${data.aws_region.current.name}.amazonaws.com"

ecr_image_tag = local.is_prod ? "stable" : "latest"

opensearch = {
domain_name = "${var.application_name}-search"
Expand Down Expand Up @@ -33,4 +33,4 @@ locals {
"srg-businessowner" = "pillarbox"
"srg-environment" = terraform.workspace
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ resource "aws_ecs_task_definition" "dispatch_task" {
container_definitions = jsonencode([
{
name = "pillarbox-event-dispatcher"
image = "${local.ecr_repository}/pillarbox-event-dispatcher:latest"
image = "${local.ecr_repository}/pillarbox-event-dispatcher:${local.ecr_image_tag}"
readonlyRootFilesystem = true

portMappings = [
Expand Down

0 comments on commit d8d2610

Please sign in to comment.