# Note: this cluster currently has no permanent instances, but they can be created via Test Kitchen in order to test this.
data "aws_ecs_cluster" "ecs_cluster" {
  cluster_name = "ECS-anywhere-POC"
}

module "external_worker" {
  source = "../../../"

  environment                    = var.environment
  service_name                   = var.service_name
  application_family             = var.application_family
  aws_region                     = var.aws_region
  commit_sha                     = "latest"
  container_port                 = "8080"
  task_type                      = "external_worker"
  ecs_network_mode               = "bridge"
  ecs_requires_compatibilities   = ["EXTERNAL"]
  ecs_launch_type                = "EXTERNAL"
  health_check_command           = "hostname"
  desired_task_count             = 2
  task_cpu                       = 1024
  task_memory                    = 2048
  max_swap                       = 4096
  swappiness                     = 55
  maximum_capacity               = 2
  minimum_capacity               = 2
  task_protection_policy_enabled = true
  splitio_enabled                = false
  ows_machine_to_machine_enabled = false
  ecs_cluster_name               = data.aws_ecs_cluster.ecs_cluster.cluster_name
  non_ecr_image                  = "public.ecr.aws/nginx/nginx:stable"
  cloudwatch_event_enabled       = true
  cloudwatch_event_schedule      = "rate(1 hour)"
}
