{
  "typeName" : "AWS::Batch::ComputeEnvironment",
  "description" : "Resource Type definition for AWS::Batch::ComputeEnvironment",
  "additionalProperties" : false,
  "properties" : {
    "ComputeEnvironmentArn" : {
      "type" : "string"
    },
    "ComputeEnvironmentName" : {
      "type" : "string"
    },
    "ComputeResources" : {
      "$ref" : "#/definitions/ComputeResources"
    },
    "ReplaceComputeEnvironment" : {
      "type" : "boolean",
      "default" : true
    },
    "ServiceRole" : {
      "type" : "string"
    },
    "State" : {
      "type" : "string"
    },
    "Tags" : {
      "type" : "object",
      "description" : "A key-value pair to associate with a resource.",
      "patternProperties" : {
        ".*" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Type" : {
      "type" : "string"
    },
    "UpdatePolicy" : {
      "$ref" : "#/definitions/UpdatePolicy"
    },
    "UnmanagedvCpus" : {
      "type" : "integer"
    },
    "EksConfiguration" : {
      "$ref" : "#/definitions/EksConfiguration"
    }
  },
  "definitions" : {
    "ComputeResources" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "AllocationStrategy" : {
          "type" : "string"
        },
        "BidPercentage" : {
          "type" : "integer"
        },
        "DesiredvCpus" : {
          "type" : "integer"
        },
        "Ec2Configuration" : {
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "items" : {
            "$ref" : "#/definitions/Ec2ConfigurationObject"
          }
        },
        "Ec2KeyPair" : {
          "type" : "string"
        },
        "ImageId" : {
          "type" : "string"
        },
        "InstanceRole" : {
          "type" : "string"
        },
        "InstanceTypes" : {
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "LaunchTemplate" : {
          "$ref" : "#/definitions/LaunchTemplateSpecification"
        },
        "MaxvCpus" : {
          "type" : "integer"
        },
        "MinvCpus" : {
          "type" : "integer"
        },
        "PlacementGroup" : {
          "type" : "string"
        },
        "SecurityGroupIds" : {
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "SpotIamFleetRole" : {
          "type" : "string"
        },
        "Subnets" : {
          "type" : "array",
          "uniqueItems" : false,
          "insertionOrder" : false,
          "items" : {
            "type" : "string"
          }
        },
        "Tags" : {
          "type" : "object",
          "description" : "A key-value pair to associate with a resource.",
          "patternProperties" : {
            ".*" : {
              "type" : "string"
            }
          },
          "additionalProperties" : false
        },
        "Type" : {
          "type" : "string"
        },
        "UpdateToLatestImageVersion" : {
          "type" : "boolean",
          "default" : false
        }
      },
      "required" : [ "Subnets", "Type", "MaxvCpus" ]
    },
    "Ec2ConfigurationObject" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "ImageIdOverride" : {
          "type" : "string"
        },
        "ImageType" : {
          "type" : "string"
        },
        "ImageKubernetesVersion" : {
          "type" : "string"
        }
      },
      "required" : [ "ImageType" ]
    },
    "LaunchTemplateSpecification" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "LaunchTemplateId" : {
          "type" : "string"
        },
        "LaunchTemplateName" : {
          "type" : "string"
        },
        "Version" : {
          "type" : "string"
        }
      }
    },
    "UpdatePolicy" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "TerminateJobsOnUpdate" : {
          "type" : "boolean",
          "default" : false
        },
        "JobExecutionTimeoutMinutes" : {
          "type" : "integer",
          "default" : 30
        }
      }
    },
    "EksConfiguration" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "EksClusterArn" : {
          "type" : "string",
          "default" : false
        },
        "KubernetesNamespace" : {
          "type" : "string",
          "default" : false
        }
      },
      "required" : [ "EksClusterArn", "KubernetesNamespace" ]
    }
  },
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : false,
    "cloudFormationSystemTags" : false,
    "tagProperty" : "/properties/Tags"
  },
  "required" : [ "Type" ],
  "createOnlyProperties" : [ "/properties/ComputeResources/SpotIamFleetRole", "/properties/ComputeEnvironmentName", "/properties/Tags", "/properties/Type", "/properties/EksConfiguration" ],
  "conditionalCreateOnlyProperties" : [ "/properties/ComputeResources/AllocationStrategy", "/properties/ComputeResources/BidPercentage", "/properties/ComputeResources/Ec2Configuration", "/properties/ComputeResources/Ec2KeyPair", "/properties/ComputeResources/ImageId", "/properties/ComputeResources/InstanceRole", "/properties/ComputeResources/InstanceTypes", "/properties/ComputeResources/LaunchTemplate", "/properties/ComputeResources/PlacementGroup", "/properties/ComputeResources/SecurityGroupIds", "/properties/ComputeResources/Subnets", "/properties/ComputeResources/Tags", "/properties/ComputeResources/Type" ],
  "writeOnlyProperties" : [ "/properties/ComputeResources/UpdateToLatestImageVersion", "/properties/ReplaceComputeEnvironment", "/properties/UpdatePolicy" ],
  "primaryIdentifier" : [ "/properties/ComputeEnvironmentArn" ],
  "readOnlyProperties" : [ "/properties/ComputeEnvironmentArn" ],
  "additionalIdentifiers" : [ [ "/properties/ComputeEnvironmentName" ] ],
  "handlers" : {
    "create" : {
      "permissions" : [ "Batch:CreateComputeEnvironment", "Batch:TagResource", "Batch:DescribeComputeEnvironments", "iam:CreateServiceLinkedRole", "Iam:PassRole", "Eks:DescribeCluster" ]
    },
    "read" : {
      "permissions" : [ "Batch:DescribeComputeEnvironments" ]
    },
    "update" : {
      "permissions" : [ "Batch:UpdateComputeEnvironment", "Batch:TagResource", "Batch:UnTagResource" ]
    },
    "delete" : {
      "permissions" : [ "Batch:DeleteComputeEnvironment" ]
    },
    "list" : {
      "permissions" : [ "Batch:DescribeComputeEnvironments" ]
    }
  }
}