#
# data "aws_ecr_repository" "integration_example" {
#   name = "core/atlas-um-integration-example"
#
#   provider = aws.gdb-core-dev
# }
#
# module "integration_example_task_def" {
#   source = "../../../modules/ecs/tasks/fargate_v3"
#
#   env_prefix      = local.env_prefix
#   project_group   = local.project_group
#   family          = "${local.env_prefix}-${local.project_group}-integration-example"
#   container_name  = "integration-example"
#   container_image = "${data.aws_ecr_repository.integration_example.repository_url}:${local.docker_image_env_tag[local.env_prefix]}-${local.project_group}"
#   cpu             = 512
#   memory          = 1024
#
#   awslogs_retention = module.cloudwatch_logs_retention_by_env[local.env_prefix]
#
#   task_role_arn = data.aws_iam_role.ecs_tasks_execution_role.arn
#   exec_role_arn = data.aws_iam_role.ecs_tasks_execution_role.arn
#
#
#   port_mappings = [
#     {
#       containerPort = 8000
#       hostPort      = 8000
#       protocol      = "tcp"
#     }
#   ]
#
#   common_tags = merge(
#     local.common_tags,
#     {
#       project                  = "User Management",
#       service                  = "ECS",
#       plat_env_project_service = "${local.aggregated_tag}_UM_ECS"
#     }
#   )
# }
#
# module "integration_example_service" {
#   source = "../../../modules/ecs/services/service_taskless_v2"
#
#   env_prefix    = local.env_prefix
#   project       = "integration-example"
#   project_group = local.project_group
#
#   cluster_arn   = data.aws_ecs_cluster.main.arn
#   desired_count = 1
#
#   security_groups = [data.aws_security_group.main.id]
#   subnets         = data.aws_subnets.private_subnets.ids
#   vpc_id          = data.aws_vpc.main.id
#
#   task_definition_arn = module.integration_example_task_def.arn
#
#   alb_enabled             = true
#   https_listener_arn      = data.aws_lb_listener.external_https_listener.arn
#   tg_health_check_path    = "/health"
#   tg_health_check_matcher = "200"
#   container_port          = 8000
#   url                     = module.domains["${local.env_prefix}_insights"]["atlas-um-example"]
#
#   enable_ecs_managed_tags = true
#
#   common_tags = merge(
#     local.common_tags,
#     {
#       project                  = "User Management",
#       service                  = "ECS",
#       plat_env_project_service = "${local.aggregated_tag}_UM_ECS",
#       service_name             = "rti-integration-example"
#     }
#   )
# }
#
# resource "aws_route53_record" "integration_example_record" {
#   provider = aws.gdb-artistapp-prod
#
#   zone_id = data.aws_route53_zone.insights_stream_zone.zone_id
#   name    = module.domains["${local.env_prefix}_insights"]["atlas-um-example"]
#   type    = "A"
#
#   alias {
#     name                   = data.aws_lb.external_alb.dns_name
#     zone_id                = data.aws_lb.external_alb.zone_id
#     evaluate_target_health = false
#   }
# }
