{
  "tagging" : {
    "taggable" : false
  },
  "typeName" : "AWS::EC2::EC2Fleet",
  "readOnlyProperties" : [ "/properties/FleetId" ],
  "description" : "Resource Type definition for AWS::EC2::EC2Fleet",
  "createOnlyProperties" : [ "/properties/LaunchTemplateConfigs", "/properties/OnDemandOptions", "/properties/ReservedCapacityOptions", "/properties/ReplaceUnhealthyInstances", "/properties/SpotOptions", "/properties/TagSpecifications", "/properties/TerminateInstancesWithExpiration", "/properties/Type", "/properties/ValidFrom", "/properties/ValidUntil", "/properties/TargetCapacitySpecification/TargetCapacityUnitType", "/properties/TargetCapacitySpecification/DefaultTargetCapacityType" ],
  "primaryIdentifier" : [ "/properties/FleetId" ],
  "required" : [ "TargetCapacitySpecification", "LaunchTemplateConfigs" ],
  "sourceUrl" : "https://github.com/aws-cloudformation",
  "handlers" : {
    "read" : {
      "permissions" : [ "ec2:DescribeFleets" ]
    },
    "create" : {
      "permissions" : [ "ec2:CreateFleet", "ec2:DescribeFleets", "ec2:CreateTags", "ec2:RunInstances", "iam:PassRole", "ec2:DescribeCapacityReservations" ]
    },
    "update" : {
      "permissions" : [ "ec2:ModifyFleet", "ec2:DescribeFleets" ]
    },
    "list" : {
      "permissions" : [ "ec2:DescribeFleets" ],
      "handlerSchema" : {
        "properties" : {
          "Type" : {
            "$ref" : "resource-schema.json#/properties/Type"
          }
        }
      }
    },
    "delete" : {
      "permissions" : [ "ec2:DescribeFleets", "ec2:DescribeFleetInstances", "ec2:DescribeInstanceStatus", "ec2:DeleteFleets", "ec2:TerminateInstances" ],
      "timeoutInMinutes" : 40
    }
  },
  "writeOnlyProperties" : [ "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/HostResourceGroupArn", "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/Affinity", "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/SpreadDomain", "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/AvailabilityZone", "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/PartitionNumber", "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/HostId", "/properties/LaunchTemplateConfigs/*/Overrides/*/Placement/Tenancy" ],
  "additionalProperties" : false,
  "definitions" : {
    "TargetCapacitySpecificationRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "DefaultTargetCapacityType" : {
          "type" : "string",
          "enum" : [ "on-demand", "spot", "capacity-block", "reserved-capacity" ]
        },
        "TotalTargetCapacity" : {
          "type" : "integer"
        },
        "OnDemandTargetCapacity" : {
          "type" : "integer"
        },
        "SpotTargetCapacity" : {
          "type" : "integer"
        },
        "TargetCapacityUnitType" : {
          "type" : "string",
          "enum" : [ "vcpu", "memory-mib", "units" ]
        }
      },
      "required" : [ "TotalTargetCapacity" ]
    },
    "FleetLaunchTemplateSpecificationRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "LaunchTemplateName" : {
          "minLength" : 3,
          "pattern" : "[a-zA-Z0-9\\(\\)\\.\\-/_]+",
          "type" : "string",
          "maxLength" : 128
        },
        "Version" : {
          "type" : "string"
        },
        "LaunchTemplateId" : {
          "type" : "string"
        },
        "LaunchTemplateSpecificationUserData" : {
          "format" : "password",
          "type" : "string"
        }
      },
      "required" : [ "Version" ]
    },
    "MemoryGiBPerVCpuRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "number"
        },
        "Max" : {
          "type" : "number"
        }
      }
    },
    "CapacityReservationOptionsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "UsageStrategy" : {
          "type" : "string",
          "enum" : [ "use-capacity-reservations-first" ]
        }
      }
    },
    "TotalLocalStorageGBRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "number"
        },
        "Max" : {
          "type" : "number"
        }
      }
    },
    "NetworkBandwidthGbpsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "number"
        },
        "Max" : {
          "type" : "number"
        }
      }
    },
    "VCpuCountRangeRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "integer"
        },
        "Max" : {
          "type" : "integer"
        }
      }
    },
    "BaselineEbsBandwidthMbpsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "integer"
        },
        "Max" : {
          "type" : "integer"
        }
      }
    },
    "NetworkInterfaceCountRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "integer"
        },
        "Max" : {
          "type" : "integer"
        }
      }
    },
    "OnDemandOptionsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "SingleAvailabilityZone" : {
          "type" : "boolean"
        },
        "AllocationStrategy" : {
          "type" : "string"
        },
        "SingleInstanceType" : {
          "type" : "boolean"
        },
        "MinTargetCapacity" : {
          "type" : "integer"
        },
        "MaxTotalPrice" : {
          "type" : "string"
        },
        "CapacityReservationOptions" : {
          "$ref" : "#/definitions/CapacityReservationOptionsRequest"
        }
      }
    },
    "SpotOptionsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "SingleAvailabilityZone" : {
          "type" : "boolean"
        },
        "AllocationStrategy" : {
          "type" : "string",
          "enum" : [ "lowest-price", "lowestPrice", "diversified", "capacityOptimized", "capacity-optimized", "capacityOptimizedPrioritized", "capacity-optimized-prioritized", "priceCapacityOptimized", "price-capacity-optimized" ]
        },
        "SingleInstanceType" : {
          "type" : "boolean"
        },
        "MinTargetCapacity" : {
          "type" : "integer"
        },
        "MaxTotalPrice" : {
          "type" : "string"
        },
        "MaintenanceStrategies" : {
          "$ref" : "#/definitions/MaintenanceStrategies"
        },
        "InstanceInterruptionBehavior" : {
          "type" : "string",
          "enum" : [ "hibernate", "stop", "terminate" ]
        },
        "InstancePoolsToUseCount" : {
          "type" : "integer"
        }
      }
    },
    "Placement" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "GroupName" : {
          "type" : "string"
        },
        "Tenancy" : {
          "type" : "string"
        },
        "SpreadDomain" : {
          "type" : "string"
        },
        "PartitionNumber" : {
          "type" : "integer"
        },
        "AvailabilityZone" : {
          "type" : "string"
        },
        "Affinity" : {
          "type" : "string"
        },
        "HostId" : {
          "type" : "string"
        },
        "HostResourceGroupArn" : {
          "type" : "string"
        }
      }
    },
    "PerformanceFactorReferenceRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "InstanceFamily" : {
          "type" : "string"
        }
      }
    },
    "CpuPerformanceFactorRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "References" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/PerformanceFactorReferenceRequest"
          }
        }
      }
    },
    "MaintenanceStrategies" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "CapacityRebalance" : {
          "$ref" : "#/definitions/CapacityRebalance"
        }
      }
    },
    "BlockDeviceMapping" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Ebs" : {
          "$ref" : "#/definitions/EbsBlockDevice"
        },
        "NoDevice" : {
          "type" : "string"
        },
        "VirtualName" : {
          "type" : "string"
        },
        "DeviceName" : {
          "type" : "string"
        }
      }
    },
    "NetworkInterfaceSpecificationRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Description" : {
          "type" : "string"
        },
        "PrivateIpAddress" : {
          "type" : "string"
        },
        "PrivateIpAddresses" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/PrivateIpAddressSpecificationRequest"
          }
        },
        "SecondaryPrivateIpAddressCount" : {
          "type" : "integer"
        },
        "DeviceIndex" : {
          "type" : "integer"
        },
        "Ipv6Addresses" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Ipv6AddressRequest"
          }
        },
        "SubnetId" : {
          "type" : "string"
        },
        "AssociatePublicIpAddress" : {
          "type" : "boolean"
        },
        "NetworkCardIndex" : {
          "type" : "integer"
        },
        "NetworkInterfaceId" : {
          "type" : "string"
        },
        "InterfaceType" : {
          "type" : "string"
        },
        "Groups" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string"
          }
        },
        "Ipv6AddressCount" : {
          "type" : "integer"
        },
        "DeleteOnTermination" : {
          "type" : "boolean"
        }
      }
    },
    "ReservedCapacityOptionsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "ReservationTypes" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "interruptible-capacity-reservation" ]
          }
        }
      }
    },
    "AcceleratorCountRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "integer"
        },
        "Max" : {
          "type" : "integer"
        }
      }
    },
    "CapacityRebalance" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "TerminationDelay" : {
          "type" : "integer"
        },
        "ReplacementStrategy" : {
          "type" : "string",
          "enum" : [ "launch", "launch-before-terminate" ]
        }
      }
    },
    "IamInstanceProfileSpecification" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Arn" : {
          "type" : "string"
        },
        "Name" : {
          "type" : "string"
        }
      }
    },
    "FleetLaunchTemplateConfigRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "LaunchTemplateSpecification" : {
          "$ref" : "#/definitions/FleetLaunchTemplateSpecificationRequest"
        },
        "Overrides" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/FleetLaunchTemplateOverridesRequest"
          }
        }
      }
    },
    "FleetLaunchTemplateOverridesRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "MetadataOptions" : {
          "$ref" : "#/definitions/InstanceMetadataOptionsRequest"
        },
        "Priority" : {
          "type" : "number"
        },
        "AvailabilityZoneId" : {
          "type" : "string"
        },
        "BlockDeviceMappings" : {
          "uniqueItems" : true,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/BlockDeviceMapping"
          }
        },
        "AvailabilityZone" : {
          "type" : "string"
        },
        "IamInstanceProfile" : {
          "$ref" : "#/definitions/IamInstanceProfileSpecification"
        },
        "SubnetId" : {
          "type" : "string"
        },
        "KeyName" : {
          "type" : "string"
        },
        "WeightedCapacity" : {
          "type" : "number"
        },
        "Placement" : {
          "$ref" : "#/definitions/Placement"
        },
        "NetworkInterfaces" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/NetworkInterfaceSpecificationRequest"
          }
        },
        "InstanceRequirements" : {
          "$ref" : "#/definitions/InstanceRequirementsRequest"
        },
        "InstanceType" : {
          "type" : "string"
        },
        "MaxPrice" : {
          "type" : "string"
        }
      }
    },
    "InstanceRequirementsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "InstanceGenerations" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "current", "previous" ]
          }
        },
        "RequireEncryptionInTransit" : {
          "type" : "boolean"
        },
        "MemoryGiBPerVCpu" : {
          "$ref" : "#/definitions/MemoryGiBPerVCpuRequest"
        },
        "AcceleratorTypes" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "gpu", "fpga", "inference", "media" ]
          }
        },
        "VCpuCount" : {
          "$ref" : "#/definitions/VCpuCountRangeRequest"
        },
        "AcceleratorManufacturers" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "amazon-web-services", "amd", "habana", "nvidia", "xilinx" ]
          }
        },
        "LocalStorage" : {
          "type" : "string",
          "enum" : [ "included", "required", "excluded" ]
        },
        "CpuManufacturers" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "intel", "amd", "amazon-web-services", "apple" ]
          }
        },
        "BareMetal" : {
          "type" : "string",
          "enum" : [ "included", "required", "excluded" ]
        },
        "RequireHibernateSupport" : {
          "type" : "boolean"
        },
        "MaxSpotPriceAsPercentageOfOptimalOnDemandPrice" : {
          "type" : "integer"
        },
        "OnDemandMaxPricePercentageOverLowestPrice" : {
          "type" : "integer"
        },
        "MemoryMiB" : {
          "$ref" : "#/definitions/MemoryMiBRequest"
        },
        "LocalStorageTypes" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "hdd", "ssd" ]
          }
        },
        "NetworkInterfaceCount" : {
          "$ref" : "#/definitions/NetworkInterfaceCountRequest"
        },
        "ExcludedInstanceTypes" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "minLength" : 1,
            "pattern" : "[a-zA-Z0-9\\.\\*]+",
            "type" : "string",
            "maxLength" : 30
          }
        },
        "AllowedInstanceTypes" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "minLength" : 1,
            "pattern" : "[a-zA-Z0-9\\.\\*]+",
            "type" : "string",
            "maxLength" : 30
          }
        },
        "NetworkBandwidthGbps" : {
          "$ref" : "#/definitions/NetworkBandwidthGbpsRequest"
        },
        "AcceleratorCount" : {
          "$ref" : "#/definitions/AcceleratorCountRequest"
        },
        "BaselinePerformanceFactors" : {
          "$ref" : "#/definitions/BaselinePerformanceFactorsRequest"
        },
        "SpotMaxPricePercentageOverLowestPrice" : {
          "type" : "integer"
        },
        "BaselineEbsBandwidthMbps" : {
          "$ref" : "#/definitions/BaselineEbsBandwidthMbpsRequest"
        },
        "AcceleratorNames" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "type" : "string",
            "enum" : [ "a10g", "a100", "h100", "inferentia", "k520", "k80", "m60", "radeon-pro-v520", "t4", "t4g", "vu9p", "v100", "l40s", "l4", "gaudi-hl-205", "inferentia2", "trainium", "trainium2", "u30" ]
          }
        },
        "AcceleratorTotalMemoryMiB" : {
          "$ref" : "#/definitions/AcceleratorTotalMemoryMiBRequest"
        },
        "BurstablePerformance" : {
          "type" : "string",
          "enum" : [ "included", "required", "excluded" ]
        },
        "TotalLocalStorageGB" : {
          "$ref" : "#/definitions/TotalLocalStorageGBRequest"
        }
      }
    },
    "MemoryMiBRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "integer"
        },
        "Max" : {
          "type" : "integer"
        }
      }
    },
    "TagSpecification" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "ResourceType" : {
          "type" : "string",
          "enum" : [ "client-vpn-endpoint", "customer-gateway", "dedicated-host", "dhcp-options", "egress-only-internet-gateway", "elastic-gpu", "elastic-ip", "export-image-task", "export-instance-task", "fleet", "fpga-image", "host-reservation", "image", "import-image-task", "import-snapshot-task", "instance", "internet-gateway", "key-pair", "launch-template", "local-gateway-route-table-vpc-association", "natgateway", "network-acl", "network-insights-analysis", "network-insights-path", "network-interface", "placement-group", "reserved-instances", "route-table", "security-group", "snapshot", "spot-fleet-request", "spot-instances-request", "subnet", "traffic-mirror-filter", "traffic-mirror-session", "traffic-mirror-target", "transit-gateway", "transit-gateway-attachment", "transit-gateway-connect-peer", "transit-gateway-multicast-domain", "transit-gateway-route-table", "volume", "vpc", "vpc-flow-log", "vpc-peering-connection", "vpn-connection", "vpn-gateway" ]
        },
        "Tags" : {
          "uniqueItems" : false,
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Tag"
          }
        }
      }
    },
    "BaselinePerformanceFactorsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Cpu" : {
          "$ref" : "#/definitions/CpuPerformanceFactorRequest"
        }
      }
    },
    "Ipv6AddressRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Ipv6Address" : {
          "type" : "string"
        }
      }
    },
    "AcceleratorTotalMemoryMiBRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Min" : {
          "type" : "integer"
        },
        "Max" : {
          "type" : "integer"
        }
      }
    },
    "EbsBlockDevice" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "SnapshotId" : {
          "type" : "string"
        },
        "VolumeType" : {
          "type" : "string",
          "enum" : [ "gp2", "gp3", "io1", "io2", "sc1", "st1", "standard" ]
        },
        "KmsKeyId" : {
          "type" : "string"
        },
        "Encrypted" : {
          "type" : "boolean"
        },
        "Iops" : {
          "type" : "integer"
        },
        "VolumeSize" : {
          "type" : "integer"
        },
        "DeleteOnTermination" : {
          "type" : "boolean"
        }
      }
    },
    "InstanceMetadataOptionsRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "HttpPutResponseHopLimit" : {
          "type" : "integer"
        },
        "HttpTokens" : {
          "type" : "string",
          "enum" : [ "optional", "required" ]
        },
        "HttpEndpoint" : {
          "type" : "string",
          "enum" : [ "disabled", "enabled" ]
        }
      }
    },
    "PrivateIpAddressSpecificationRequest" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "PrivateIpAddress" : {
          "type" : "string"
        },
        "Primary" : {
          "type" : "boolean"
        }
      }
    },
    "Tag" : {
      "additionalProperties" : false,
      "type" : "object",
      "properties" : {
        "Value" : {
          "type" : "string"
        },
        "Key" : {
          "type" : "string"
        }
      },
      "required" : [ "Value", "Key" ]
    }
  },
  "properties" : {
    "Context" : {
      "type" : "string"
    },
    "TargetCapacitySpecification" : {
      "$ref" : "#/definitions/TargetCapacitySpecificationRequest"
    },
    "OnDemandOptions" : {
      "$ref" : "#/definitions/OnDemandOptionsRequest"
    },
    "ExcessCapacityTerminationPolicy" : {
      "type" : "string",
      "enum" : [ "termination", "no-termination" ]
    },
    "TagSpecifications" : {
      "uniqueItems" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/TagSpecification"
      }
    },
    "SpotOptions" : {
      "$ref" : "#/definitions/SpotOptionsRequest"
    },
    "LaunchTemplateConfigs" : {
      "maxItems" : 50,
      "uniqueItems" : false,
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/FleetLaunchTemplateConfigRequest"
      }
    },
    "TerminateInstancesWithExpiration" : {
      "type" : "boolean"
    },
    "ValidUntil" : {
      "type" : "string"
    },
    "Type" : {
      "type" : "string",
      "enum" : [ "maintain", "request", "instant" ]
    },
    "ReservedCapacityOptions" : {
      "$ref" : "#/definitions/ReservedCapacityOptionsRequest"
    },
    "FleetId" : {
      "type" : "string"
    },
    "ValidFrom" : {
      "type" : "string"
    },
    "ReplaceUnhealthyInstances" : {
      "type" : "boolean"
    }
  }
}