resource "aws_instance" "aomas-txmgr05" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_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        = "sme-aoma-core-dev-gen"
  vpc_security_group_ids      = ["sg-00e2f4d06d7a68667"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0ee5db461c576e715.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomas-txmgr-ecs >> /etc/ecs/ecs.config
EOT  
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomas-txmgr-ecs-01",
      "Environment"    = "Stage",
      "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"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomas-txmgr06" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_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        = "sme-aoma-core-dev-gen"
  vpc_security_group_ids      = ["sg-06e53be35661ef729"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0bd6e967de4f78b99.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomas-txmgr-ecs >> /etc/ecs/ecs.config
EOT    
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomas-txmgr-ecs-02",
      "Environment"    = "Stage",
      "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"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomas-txmgr07" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_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        = "sme-aoma-core-dev-gen"
  vpc_security_group_ids      = ["sg-0c13bce58dfd37b3e"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0ee5db461c576e715.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomas-txmgr-ecs >> /etc/ecs/ecs.config
EOT    
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomas-txmgr-ecs-03",
      "Environment"    = "Stage",
      "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"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomas-txmgr08" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_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        = "sme-aoma-core-dev-gen"
  vpc_security_group_ids      = ["sg-008d2eca958510391"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0ee5db461c576e715.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomas-txmgr-ecs >> /etc/ecs/ecs.config
EOT    
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomas-txmgr-ecs-04",
      "Environment"    = "Stage",
      "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"
    }
  )
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomas-aomapgbouncer03" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_126: Ensure that detailed monitoring is
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-064831802eae3c1b0"
  instance_type               = "m5.large"
  iam_instance_profile        = "aomad-aomas-aomapgbouncer01"
  vpc_security_group_ids      = ["sg-09f913e003d76965b"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0dd89f02965c32573.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomas-aomapgbouncer03",
      "Environment"    = "Stage",
      "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" "aomas2-queue01" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_126: Ensure that detailed monitoring is
  # checkov:skip=CKV_AWS_135: Ensure that EC2 is EBS optimized
  ami                         = "ami-0d3b821ab4fd68e18"
  instance_type               = "t3.medium"
  iam_instance_profile        = "aomas-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-0992432ebc1229a39"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0ee5db461c576e715.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  tags = merge(
    var.common_tags,
    {
      "Name"           = "aomas2-queue01",
      "Environment"    = "Stage",
      "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" "aomas-txmgr-kafka-consumer-ecs-01" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_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.small"
  iam_instance_profile        = "aomas2-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-06e53be35661ef729"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0ee5db461c576e715.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
    user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomas-txmgr-kafka-consumer >> /etc/ecs/ecs.config
EOT
  tags                        = {
      "Name"           = "aomas-txmgr-kafka-consumer-ecs-01",
      "Environment"    = "Stage",
      "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"          = "vivien.leung@sonymusic.com",
      "Terraform"      = "True",
      "CLOPS_FW"       = "YES",
      "map-migrated"   = "migKNBMDMW06I",
    }
  lifecycle { ignore_changes = [user_data] }
}

resource "aws_instance" "aomas-txmgr-usm-ecs-01" {
  # checkov:skip=CKV_AWS_79: Ensure Instance Metadata Service Version 1 is not enabled
  # 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_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        = "aomas2-ECS-Instance-Role"
  vpc_security_group_ids      = ["sg-06e53be35661ef729"]
  disable_api_termination     = "true"
  subnet_id                   = aws_subnet.subnet-0ee5db461c576e715.id
  associate_public_ip_address = "false"
  key_name                    = "aoma-d1-27May2019"
  user_data                   = <<-EOT
#!/bin/bash
echo ECS_CLUSTER=aomas-txmgr-usm-ecs >> /etc/ecs/ecs.config
EOT
  tags                        = {
      "Name"           = "aomas-txmgr-usm-ecs-01",
      "Environment"    = "Stage",
      "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] }
}