Skip to content

Commit

Permalink
Merge pull request #1748 from ministryofjustice/MLPAB-2796-keep-otel-…
Browse files Browse the repository at this point in the history
…image-in-ecs-tasks-up-to-date

MLPAB-2796 - update the otel collector image used in ECS
  • Loading branch information
andrewpearce-digital authored Jan 30, 2025
2 parents 7b70e77 + d186a3e commit 4701be2
Show file tree
Hide file tree
Showing 8 changed files with 720 additions and 683 deletions.
1 change: 1 addition & 0 deletions terraform/environment/global/iam_ecs_execution_role.tf
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ data "aws_iam_policy_document" "execution_role" {
actions = [
"ecr:GetAuthorizationToken",
"ecr:BatchCheckLayerAvailability",
"ecr:BatchImportUpstreamImage",
"ecr:GetDownloadUrlForLayer",
"ecr:BatchGetImage",
]
Expand Down
1 change: 1 addition & 0 deletions terraform/environment/region/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module "app" {
search_endpoint = var.search_endpoint
search_index_name = var.search_index_name
search_collection_arn = var.search_collection_arn
ecs_aws_otel_collector_version = var.ecs_aws_otel_collector_version

providers = {
aws.region = aws.region
Expand Down
2 changes: 1 addition & 1 deletion terraform/environment/region/modules/app/ecs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ locals {
{
cpu = 0,
essential = true,
image = "311462405659.dkr.ecr.eu-west-1.amazonaws.com/aws-otel-collector-public-ecr/aws-observability/aws-otel-collector:v0.21.0",
image = "311462405659.dkr.ecr.eu-west-1.amazonaws.com/aws-otel-collector-public-ecr/aws-observability/aws-otel-collector:${var.ecs_aws_otel_collector_version}",
mountPoints = [],
readonlyRootFilesystem = true
name = "aws-otel-collector",
Expand Down
5 changes: 5 additions & 0 deletions terraform/environment/region/modules/app/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,8 @@ variable "waf_alb_association_enabled" {
description = "Enable WAF association with the ALB"
default = true
}

variable "ecs_aws_otel_collector_version" {
type = string
description = "semver tag for the public ecr tag of the aws-otel-collector image"
}
5 changes: 5 additions & 0 deletions terraform/environment/region/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -210,3 +210,8 @@ variable "egress_checker_enabled" {
type = bool
default = false
}

variable "ecs_aws_otel_collector_version" {
type = string
description = "semver tag for the public ecr tag of the aws-otel-collector image"
}
2 changes: 2 additions & 0 deletions terraform/environment/regions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ module "eu_west_1" {
search_index_name = local.search_index_name
search_collection_arn = data.aws_opensearchserverless_collection.lpas_collection.arn
real_user_monitoring_cw_logs_enabled = local.environment.app.real_user_monitoring_cw_logs_enabled
ecs_aws_otel_collector_version = var.ecs_aws_otel_collector_version
providers = {
aws.region = aws.eu_west_1
aws.global = aws.global
Expand Down Expand Up @@ -168,6 +169,7 @@ module "eu_west_2" {
search_index_name = local.search_index_name
search_collection_arn = null
real_user_monitoring_cw_logs_enabled = local.environment.app.real_user_monitoring_cw_logs_enabled
ecs_aws_otel_collector_version = var.ecs_aws_otel_collector_version
providers = {
aws.region = aws.eu_west_2
aws.global = aws.global
Expand Down
Loading

0 comments on commit 4701be2

Please sign in to comment.