resource "aws_instance" "aomap-aomapgbouncer03" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-064831802eae3c1b0"
  instance_type               = "m5.large"
  iam_instance_profile        = "aomap1-sftspgbouncer01-role"
  vpc_security_group_ids      = ["sg-022e89ceaaa8e35e9"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-01cab8cb0d3394c21.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomap-aomapgbouncer03",
      "Environment"    = "Prod",
      "SERVER_TYPE"    = "EC2",
      "OS"             = "AL3",
      "Patch Group"    = "General",
      "Business-Unit"  = "SME-AOMA-Core",
      "Project-Code"   = "SME-2000-0306A"
      "Project-Name"   = "AOMA-Core"
      "CLOPS_APPROVED" = "YES",
      "ME-Joined"      = "NO",
      "OPS"            = "STND",
      "DATA"           = "NORMAL",
      "Owner"          = "nathaniel.lovett@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-txmgr-ecs-01" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "m5.xlarge"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0c4aeb15e7c60afeb"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-01cab8cb0d3394c21.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomap-txmgr-ecs >> /etc/ecs/ecs.config
EOT
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomap-txmgr-ecs-01",
      "Environment"    = "Prod",
      "SERVER_TYPE"    = "ECS",
      "OS"             = "AL3",
      "Patch Group"    = "Container",
      "Business-Unit"  = "SME-AOMA-Core",
      "Project-Code"   = "SME-2000-0306A"
      "Project-Name"   = "AOMA-Core"
      "CLOPS_APPROVED" = "YES",
      "ME-Joined"      = "NO",
      "OPS"            = "STND",
      "DATA"           = "NORMAL",
      "Owner"          = "nathaniel.lovett@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I"
      "datadog"        = "monitored"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-txmgr-ecs-02" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "m5.xlarge"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0c4aeb15e7c60afeb"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-05855aa4e7d99fede.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomap-txmgr-ecs >> /etc/ecs/ecs.config
EOT
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomap-txmgr-ecs-02",
      "Environment"    = "Prod",
      "SERVER_TYPE"    = "ECS",
      "OS"             = "AL3",
      "Patch Group"    = "Container",
      "Business-Unit"  = "SME-AOMA-Core",
      "Project-Code"   = "SME-2000-0306A"
      "Project-Name"   = "AOMA-Core"
      "CLOPS_APPROVED" = "YES",
      "ME-Joined"      = "NO",
      "OPS"            = "STND",
      "DATA"           = "NORMAL",
      "Owner"          = "nathaniel.lovett@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I"
      "datadog"        = "monitored"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-txmgr-ecs-03" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "m5.xlarge"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0c4aeb15e7c60afeb"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-01cab8cb0d3394c21.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomap-txmgr-ecs >> /etc/ecs/ecs.config
EOT
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomap-txmgr-ecs-03",
      "Environment"    = "Prod",
      "SERVER_TYPE"    = "ECS",
      "OS"             = "AL3",
      "Patch Group"    = "Container",
      "Business-Unit"  = "SME-AOMA-Core",
      "Project-Code"   = "SME-2000-0306A"
      "Project-Name"   = "AOMA-Core"
      "CLOPS_APPROVED" = "YES",
      "ME-Joined"      = "NO",
      "OPS"            = "STND",
      "DATA"           = "NORMAL",
      "Owner"          = "nathaniel.lovett@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I"
      "datadog"        = "monitored"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-txmgr-ecs-04" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "m5.xlarge"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0c4aeb15e7c60afeb"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-05855aa4e7d99fede.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomap-txmgr-ecs >> /etc/ecs/ecs.config
EOT
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomap-txmgr-ecs-04",
      "Environment"    = "Prod",
      "SERVER_TYPE"    = "ECS",
      "OS"             = "AL3",
      "Patch Group"    = "Container",
      "Business-Unit"  = "SME-AOMA-Core",
      "Project-Code"   = "SME-2000-0306A"
      "Project-Name"   = "AOMA-Core"
      "CLOPS_APPROVED" = "YES",
      "ME-Joined"      = "NO",
      "OPS"            = "STND",
      "DATA"           = "NORMAL",
      "Owner"          = "nathaniel.lovett@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I"
      "datadog"        = "monitored"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-queue01" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "m5.large"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = [aws_security_group.AOMA-P1-QUEUE-SG.id]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-01cab8cb0d3394c21.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomap-queue01",
      "Environment"    = "Prod",
      "SERVER_TYPE"    = "EC2",
      "OS"             = "AL3",
      "Patch Group"    = "General",
      "Business-Unit"  = "SME-AOMA-Core",
      "Project-Code"   = "SME-2000-0306A"
      "Project-Name"   = "AOMA-Core"
      "CLOPS_APPROVED" = "YES",
      "ME-Joined"      = "NO",
      "OPS"            = "STND",
      "DATA"           = "NORMAL",
      "Owner"          = "nathaniel.lovett@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-txmgr-kafka-consumer-ecs-01" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79:
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "t3.medium"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0c4aeb15e7c60afeb"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-01cab8cb0d3394c21.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomap-txmgr-kafka-consumer >> /etc/ecs/ecs.config
EOT
  tags = {
    "Name"           = "aomap-txmgr-kafka-consumer-ecs-01",
    "Environment"    = "Prod",
    "SERVER_TYPE"    = "ECS",
    "OS"             = "AL3",
    "Patch Group"    = "General",
    "Business-Unit"  = "SME-AOMA-Core",
    "Project-Code"   = "SME-2000-0306A"
    "Project-Name"   = "AOMA-Core"
    "CLOPS_APPROVED" = "YES",
    "ME-Joined"      = "NO",
    "OPS"            = "STND",
    "DATA"           = "NORMAL",
    "Owner"          = "nathaniel.lovett@sonymusic.com",
    "Terraform"      = "True",
    "CLOPS_FW"       = "YES",
    "map-migrated"   = "migKNBMDMW06I",
  }
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomap-txmgr-usm-ecs-01" {
  # checkov:skip=CKV_AWS_8: Ensure all data stored in the Launch configuration or instance Elastic Blocks Store is securely encrypted
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # checkov:skip=CKV_AWS_126: Ensure that detailed monitoring is enabled for EC2 instances
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "t3.medium"
  iam_instance_profile        = "aomap-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0c4aeb15e7c60afeb"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-01cab8cb0d3394c21.id
  associate_public_ip_address = "false"
  key_name                    = "aomap1-17sep2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomap-txmgr-usm-ecs >> /etc/ecs/ecs.config
EOT
  tags = {
    "Name"           = "aomap-txmgr-usm-ecs-01",
    "Environment"    = "Prod",
    "SERVER_TYPE"    = "ECS",
    "OS"             = "AL3",
    "Patch Group"    = "General",
    "Business-Unit"  = "SME-AOMA-Core",
    "Project-Code"   = "SME-2000-0306A"
    "Project-Name"   = "AOMA-Core"
    "CLOPS_APPROVED" = "YES",
    "ME-Joined"      = "NO",
    "OPS"            = "STND",
    "DATA"           = "NORMAL",
    "Owner"          = "nathaniel.lovett@sonymusic.com",
    "Terraform"      = "True",
    "CLOPS_FW"       = "YES",
    "map-migrated"   = "migKNBMDMW06I",
  }
  lifecycle { ignore_changes = [user_data] }
}
