Skip to content

Conversation

@jscott-nava
Copy link
Contributor

@jscott-nava jscott-nava commented Dec 18, 2025

🎫 Ticket

https://jira.cms.gov/browse/PLT-1445

🛠 Changes

This PR contains various updates that were required in order to migrate the AB2D contracts, events and worker services and service definitions onto the service module.

ℹ️ Context

The existing AB2D contracts, events and worker services and service definitions contain some naming conventions and settings that were not supported by the current version of the service module. The changes in this PR add that support.

🧪 Validation

The following plan was generated against the AB2D test environment with the module source set to the branch of this PR:

Tofu plan output (AB2D-TEST)
OpenTofu will perform the following actions:

  # module.contracts_service.aws_ecs_service.this will be updated in-place
  # (moved from aws_ecs_service.contracts)
  ~ resource "aws_ecs_service" "this" {
        id                                 = "arn:aws:ecs:us-east-1:xxxxxxxxxxxx:service/ab2d-test-microservices/ab2d-test-contracts"
        name                               = "ab2d-test-contracts"
      ~ tags                               = {
          - "service" = "contracts" -> null
        }
      ~ tags_all                           = {
          ~ "service"        = "contracts" -> "microservices"
            # (6 unchanged elements hidden)
        }
        # (17 unchanged attributes hidden)

        # (4 unchanged blocks hidden)
    }

  # aws_ecs_task_definition.contracts has moved to module.contracts_service.aws_ecs_task_definition.this
    resource "aws_ecs_task_definition" "this" {
        id                       = "ab2d-test-contracts"
        tags                     = {}
        # (15 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # module.events_service.aws_ecs_service.this will be updated in-place
  # (moved from aws_ecs_service.events)
  ~ resource "aws_ecs_service" "this" {
      ~ force_new_deployment               = true -> false
        id                                 = "arn:aws:ecs:us-east-1:xxxxxxxxxxxx:service/ab2d-test-microservices/ab2d-test-events"
        name                               = "ab2d-test-events"
      ~ tags                               = {
          - "service" = "events" -> null
        }
      ~ tags_all                           = {
          ~ "service"        = "events" -> "microservices"
            # (6 unchanged elements hidden)
        }
        # (16 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

  # aws_ecs_task_definition.events has moved to module.events_service.aws_ecs_task_definition.this
    resource "aws_ecs_task_definition" "this" {
        id                       = "ab2d-test-events"
        tags                     = {}
        # (15 unchanged attributes hidden)

        # (3 unchanged blocks hidden)
    }

Plan: 0 to add, 2 to change, 0 to destroy.

container_definitions = nonsensitive(jsonencode([
{
name = local.service_name
name = local.container_name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would rather assign the container and service the same name in this shared service module unless one of the teams has a very good reason to do otherwise.

logDriver = "awslogs"
options = {
awslogs-group = "/aws/ecs/fargate/${var.platform.app}-${var.platform.env}/${local.service_name}"
awslogs-group = "/aws/ecs/fargate/${var.platform.app}-${var.platform.env}/${local.awslogs_group}"
Copy link
Member

@gsf gsf Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above for log groups. We should stick with the convention of naming these after the service.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants