Sha256: 4b3c955daacccadab8e8cb56973cf9d19f0739526f47c8bd8c488547a3768be2

Contents?: true

Size: 1.61 KB

Versions: 34

Compression:

Stored size: 1.61 KB

Contents

resource "aws_ecs_cluster" "aws_recon" {
  name               = "${var.aws_recon_base_name}-${random_id.aws_recon.hex}"
  capacity_providers = [local.ecs_task_provider]
}

resource "aws_ecs_task_definition" "aws_recon_task" {
  family                   = "${var.aws_recon_base_name}-${random_id.aws_recon.hex}"
  task_role_arn            = aws_iam_role.aws_recon_role.arn
  execution_role_arn       = aws_iam_role.ecs_task_execution.arn
  requires_compatibilities = [local.ecs_task_provider]
  network_mode             = "awsvpc"
  cpu                      = 1024
  memory                   = 2048

  container_definitions = jsonencode([
    {
      name             = "${var.aws_recon_base_name}-${random_id.aws_recon.hex}"
      image            = "${var.aws_recon_container_name}:${var.aws_recon_container_version}"
      assign_public_ip = true
      entryPoint = [
        "aws_recon",
        "--verbose",
        "--format",
        "custom",
        "--json-lines",
        "--s3-bucket",
        "${aws_s3_bucket.aws_recon.bucket}:${data.aws_region.current.name}",
        "--regions",
        join(",", var.aws_regions)
      ]
      logConfiguration = {
        logDriver = "awslogs"
        options = {
          awslogs-group         = aws_cloudwatch_log_group.aws_recon.name,
          awslogs-region        = data.aws_region.current.name,
          awslogs-stream-prefix = "ecs"
        }
      }
    }
  ])
}

resource "aws_cloudwatch_log_group" "aws_recon" {
  name              = "/ecs/${var.aws_recon_base_name}-${random_id.aws_recon.hex}"
  retention_in_days = var.retention_period
}

locals {
  ecs_task_provider = "FARGATE"
}

Version data entries

34 entries across 34 versions & 1 rubygems

Version Path
aws_recon-0.5.33 utils/terraform/ecs.tf
aws_recon-0.5.32 utils/terraform/ecs.tf
aws_recon-0.5.31 utils/terraform/ecs.tf
aws_recon-0.5.30 utils/terraform/ecs.tf
aws_recon-0.5.29 utils/terraform/ecs.tf
aws_recon-0.5.28 utils/terraform/ecs.tf
aws_recon-0.5.27 utils/terraform/ecs.tf
aws_recon-0.5.26 utils/terraform/ecs.tf
aws_recon-0.5.25 utils/terraform/ecs.tf
aws_recon-0.5.24 utils/terraform/ecs.tf
aws_recon-0.5.23 utils/terraform/ecs.tf
aws_recon-0.5.22 utils/terraform/ecs.tf
aws_recon-0.5.21 utils/terraform/ecs.tf
aws_recon-0.5.20 utils/terraform/ecs.tf
aws_recon-0.5.19 utils/terraform/ecs.tf
aws_recon-0.5.18 utils/terraform/ecs.tf
aws_recon-0.5.17 utils/terraform/ecs.tf
aws_recon-0.5.16 utils/terraform/ecs.tf
aws_recon-0.5.15 utils/terraform/ecs.tf
aws_recon-0.5.14 utils/terraform/ecs.tf