# __generated__ by Terraform from "media-conversion-batch-c5-emergency-dev2"
resource "aws_batch_compute_environment" "media-conversion-batch-c5-emergency-dev2" {
  compute_environment_name        = "media-conversion-batch-c5-emergency-dev2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "ENABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "BEST_FIT_PROGRESSIVE"
    bid_percentage      = 0
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Name         = "aws-batch-instance-emergency-dev2"
      map-migrated = "migKNBMDMW06I"
    }
    type = "EC2"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform from "media-conversion-batch-c5-on-demand-dev2"
resource "aws_batch_compute_environment" "media-conversion-batch-c5-on-demand-dev2" {
  compute_environment_name        = "media-conversion-batch-c5-on-demand-dev2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "ENABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "BEST_FIT_PROGRESSIVE"
    bid_percentage      = 0
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Name         = "aws-batch-instance-on-demand-dev2"
      map-migrated = "migKNBMDMW06I"
    }
    type = "EC2"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform from "media-conversion-batch-c5-spot-dev2"
resource "aws_batch_compute_environment" "media-conversion-batch-c5-spot-dev2" {
  compute_environment_name        = "media-conversion-batch-c5-spot-dev2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "ENABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "SPOT_CAPACITY_OPTIMIZED"
    bid_percentage      = 50
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Name         = "aws-batch-instance-spot-dev2"
      map-migrated = "migKNBMDMW06I"
    }
    type = "SPOT"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform from "media-conversion-promo-batch-c5-emergency-dev2"
resource "aws_batch_compute_environment" "media-conversion-promo-batch-c5-emergency-dev2" {
  compute_environment_name        = "media-conversion-promo-batch-c5-emergency-dev2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "DISABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "BEST_FIT_PROGRESSIVE"
    bid_percentage      = 0
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Business-Unit  = "AOMA-Conversion"
      CLOPS_APPROVED = "YES"
      "DATA "        = "NORMAL"
      Environment    = "DEV"
      Name           = "aws-batch-instance-emergency-dev2"
      OS             = "AL3"
      Owner          = "Mandar Padsalgikar"
      Project-Code   = "SME-2000-0306C"
      Project-Name   = "Media-Conversion"
      SERVER_TYPE    = "BATCH"
      Terraform      = "True"
      map-migrated   = "migKNBMDMW06I"
    }
    type = "EC2"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform from "media-conversion-promo-batch-c5-emergency-stage2"
resource "aws_batch_compute_environment" "media-conversion-promo-batch-c5-emergency-stage2" {
  compute_environment_name        = "media-conversion-promo-batch-c5-emergency-stage2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "DISABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "BEST_FIT_PROGRESSIVE"
    bid_percentage      = 0
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge", "c6i.8xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Name         = "aws-batch-instance-emergency-dev2"
      map-migrated = "migKNBMDMW06I"
    }
    type = "EC2"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform from "media-conversion-promo-batch-c5-on-demand-stage2"
resource "aws_batch_compute_environment" "media-conversion-promo-batch-c5-on-demand-stage2" {
  compute_environment_name        = "media-conversion-promo-batch-c5-on-demand-stage2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "DISABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "BEST_FIT_PROGRESSIVE"
    bid_percentage      = 0
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge", "c6i.8xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Name         = "aws-batch-instance-on-demand-dev2"
      map-migrated = "migKNBMDMW06I"
    }
    type = "EC2"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform
resource "aws_batch_compute_environment" "media-conversion-promo-batch-c5-spot-dev2" {
  compute_environment_name        = "media-conversion-promo-batch-c5-spot-dev2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "DISABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "SPOT_CAPACITY_OPTIMIZED"
    bid_percentage      = 50
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Business-Unit  = "AOMA-Conversion"
      CLOPS_APPROVED = "YES"
      DATA           = "NORMAL"
      Environment    = "DEV"
      Name           = "aws-batch-instance-spot-dev2"
      OS             = "AL3"
      Owner          = "Mandar Padsalgikar"
      Project-Code   = "SME-2000-0306C"
      Project-Name   = "Media-Conversion"
      SERVER_TYPE    = "BATCH"
      Terraform      = "True"
      map-migrated   = "migKNBMDMW06I"
    }
    type = "SPOT"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

# __generated__ by Terraform from "media-conversion-promo-batch-c5-spot-stage2"
resource "aws_batch_compute_environment" "media-conversion-promo-batch-c5-spot-stage2" {
  compute_environment_name        = "media-conversion-promo-batch-c5-spot-stage2"
  compute_environment_name_prefix = null
  service_role                    = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                           = "DISABLED"
  tags                            = {}
  tags_all                        = {}
  type                            = "MANAGED"
  compute_resources {
    allocation_strategy = "SPOT_CAPACITY_OPTIMIZED"
    bid_percentage      = 50
    desired_vcpus       = 0
    ec2_key_pair        = null
    image_id            = null
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type       = ["c6i.4xlarge", "c6i.8xlarge"]
    max_vcpus           = 16
    min_vcpus           = 0
    security_group_ids  = ["sg-07ae06905b0f6dd1f"]
    spot_iam_fleet_role = null
    subnets             = ["subnet-0a238019630ccbc09", "subnet-0bdf396fe9a7dbe1b"]
    tags = {
      Name         = "aws-batch-instance-spot-dev2"
      map-migrated = "migKNBMDMW06I"
    }
    type = "SPOT"
    ec2_configuration {
      image_id_override = null
      image_type        = "ECS_AL2"
    }
    launch_template {
      launch_template_id   = null
      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}

resource "aws_batch_compute_environment" "media-conversion-promo-batch-c5-on-demand-dev2" {
  compute_environment_name = "media-conversion-promo-batch-c5-on-demand-dev2"
  service_role             = "arn:aws:iam::104858398257:role/aws-service-role/batch.amazonaws.com/AWSServiceRoleForBatch"
  state                    = "DISABLED"
  tags                     = { Environment = "DEV" }

  type = "MANAGED"
  lifecycle {
    ignore_changes = [compute_resources[0].desired_vcpus]
  }

  compute_resources {
    allocation_strategy = "BEST_FIT_PROGRESSIVE"
    bid_percentage      = 0
    desired_vcpus       = 0
    instance_role       = "arn:aws:iam::104858398257:instance-profile/ecsInstanceRole"
    instance_type = [
      "c6i.4xlarge",
    ]
    max_vcpus = 16
    min_vcpus = 0
    security_group_ids = [
      "sg-07ae06905b0f6dd1f",
    ]
    subnets = [
      "subnet-0a238019630ccbc09",
      "subnet-0bdf396fe9a7dbe1b",
    ]
    tags = merge(
      var.batch-tags,
      {

        "Name"         = "aws-batch-instance-on-demand-dev2"
        "map-migrated" = "migKNBMDMW06I"
    })
    type = "EC2"

    ec2_configuration {
      image_type = "ECS_AL2"
    }

    launch_template {

      launch_template_name = "media-conversion-batch-c5-template"
      version              = "$Latest"
    }
  }
}
