{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-gamelift/json-schema/amazon-gamelift-create-container-group-definition-input-schema.json",
  "title": "CreateContainerGroupDefinitionInput",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-gamelift-container-group-definition-api-openapi.yml#/components/schemas/CreateContainerGroupDefinitionInput",
  "type": "object",
  "properties": {
    "Name": {
      "type": "string",
      "description": "A descriptive identifier for the container group definition. The name value must be unique in an Amazon Web Services Region."
    },
    "ContainerGroupType": {
      "type": "string",
      "enum": [
        "GAME_SERVER",
        "PER_INSTANCE"
      ],
      "description": "The type of container group being defined. Container group type determines how Amazon GameLift Servers deploys the container group on each fleet instance. Default value: GAME_SERVER"
    },
    "TotalMemoryLimitMebibytes": {
      "type": "integer",
      "description": "The maximum amount of memory (in MiB) to allocate to the container group. All containers in the group share this memory. If you specify memory limits for an individual container, the total value must be greater than any individual container's memory limit. Default value: 1024"
    },
    "TotalVcpuLimit": {
      "type": "number",
      "description": "The maximum amount of vCPU units to allocate to the container group (1 vCPU is equal to 1024 CPU units). All containers in the group share these resources. If you set vCPU reservations for individual containers, the total value must be equal to or greater than the sum of the Vcpu values for all containers in the group. This property is required for a per-instance container group. For a game server container group, Amazon GameLift Servers requires either a total vCPU limit or a Vcpu value for the game server container. If you set a total vCPU limit for a game server container group, Amazon Game"
    },
    "GameServerContainerDefinition": {
      "$ref": "#/$defs/GameServerContainerDefinitionInput"
    },
    "SupportContainerDefinitions": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/SupportContainerDefinitionInput"
      },
      "description": "One or more definition for support containers in this group. You can define a support container in any type of container group. You can pass in your container definitions as a JSON file."
    },
    "OperatingSystem": {
      "type": "string",
      "enum": [
        "AMAZON_LINUX_2023"
      ],
      "description": "The platform that all containers in the group use. Containers in a group must run on the same operating system. Default value: AMAZON_LINUX_2023 Amazon Linux 2 (AL2) will reach end of support on 6/30/2026. See more details in the Amazon Linux 2 FAQs. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See Migrate to server SDK version 5."
    },
    "VersionDescription": {
      "type": "string",
      "description": "A description for the initial version of this container group definition."
    },
    "Tags": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Tag"
      },
      "description": "A list of labels to assign to the container group definition resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources is useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference."
    }
  },
  "required": [
    "Name",
    "TotalMemoryLimitMebibytes",
    "OperatingSystem"
  ],
  "$defs": {
    "ContainerDependency": {
      "type": "object",
      "properties": {
        "ContainerName": {
          "type": "string",
          "description": "A descriptive label for the container definition that this container depends on."
        },
        "Condition": {
          "type": "string",
          "enum": [
            "START",
            "COMPLETE",
            "SUCCESS",
            "HEALTHY"
          ],
          "description": "The condition that the dependency container must reach before the dependent container can start. Valid conditions include: START - The dependency container must have started. COMPLETE - The dependency container has run to completion (exits). Use this condition with nonessential containers, such as those that run a script and then exit. The dependency container can't be an essential container. SUCCESS - The dependency container has run to completion and exited with a zero status. The dependency container can't be an essential container. HEALTHY - The dependency container has passed its Docker h"
        }
      },
      "required": [
        "ContainerName",
        "Condition"
      ]
    },
    "ContainerEnvironment": {
      "type": "object",
      "properties": {
        "Name": {
          "type": "string",
          "description": "The environment variable name."
        },
        "Value": {
          "type": "string",
          "description": "The environment variable value."
        }
      },
      "required": [
        "Name",
        "Value"
      ]
    },
    "ContainerHealthCheck": {
      "type": "object",
      "properties": {
        "Command": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "A string array that specifies the command that the container runs to determine if it's healthy."
        },
        "Interval": {
          "type": "integer",
          "description": "The time period (in seconds) between each health check."
        },
        "Retries": {
          "type": "integer",
          "description": "The number of times to retry a failed health check before flagging the container unhealthy. The first run of the command does not count as a retry."
        },
        "StartPeriod": {
          "type": "integer",
          "description": "The optional grace period (in seconds) to give a container time to bootstrap before the first failed health check counts toward the number of retries."
        },
        "Timeout": {
          "type": "integer",
          "description": "The time period (in seconds) to wait for a health check to succeed before counting a failed health check."
        }
      },
      "required": [
        "Command"
      ]
    },
    "ContainerMountPoint": {
      "type": "object",
      "properties": {
        "InstancePath": {
          "type": "string",
          "description": "The path to the source file or directory."
        },
        "ContainerPath": {
          "type": "string",
          "description": "The mount path on the container. If this property isn't set, the instance path is used."
        },
        "AccessLevel": {
          "type": "string",
          "enum": [
            "READ_ONLY",
            "READ_AND_WRITE"
          ],
          "description": "The type of access for the container."
        }
      },
      "required": [
        "InstancePath"
      ]
    },
    "ContainerPortConfiguration": {
      "type": "object",
      "properties": {
        "ContainerPortRanges": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerPortRange"
          },
          "description": "A set of one or more container port number ranges. The ranges can't overlap if the ranges' network protocols are the same. Overlapping ranges with different protocols is allowed but not recommended."
        }
      },
      "required": [
        "ContainerPortRanges"
      ]
    },
    "ContainerPortRange": {
      "type": "object",
      "properties": {
        "FromPort": {
          "type": "integer",
          "description": "A starting value for the range of allowed port numbers."
        },
        "ToPort": {
          "type": "integer",
          "description": "An ending value for the range of allowed port numbers. Port numbers are end-inclusive. This value must be equal to or greater than FromPort."
        },
        "Protocol": {
          "type": "string",
          "enum": [
            "TCP",
            "UDP"
          ],
          "description": "The network protocol that these ports support."
        }
      },
      "required": [
        "FromPort",
        "ToPort",
        "Protocol"
      ]
    },
    "GameServerContainerDefinitionInput": {
      "type": "object",
      "properties": {
        "ContainerName": {
          "type": "string",
          "description": "A string that uniquely identifies the container definition within a container group."
        },
        "DependsOn": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerDependency"
          },
          "description": "Establishes dependencies between this container and the status of other containers in the same container group. A container can have dependencies on multiple different containers. You can use dependencies to establish a startup/shutdown sequence across the container group. For example, you might specify that ContainerB has a START dependency on ContainerA. This dependency means that ContainerB can't start until after ContainerA has started. This dependency is reversed on shutdown, which means that ContainerB must shut down before ContainerA can shut down."
        },
        "MountPoints": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerMountPoint"
          },
          "description": "A mount point that binds a path inside the container to a file or directory on the host system and lets it access the file or directory."
        },
        "EnvironmentOverride": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerEnvironment"
          },
          "description": "A set of environment variables to pass to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference."
        },
        "ImageUri": {
          "type": "string",
          "description": "The location of the container image to deploy to a container fleet. Provide an image in an Amazon Elastic Container Registry public or private repository. The repository must be in the same Amazon Web Services account and Amazon Web Services Region where you're creating the container group definition. For limits on image size, see Amazon GameLift Servers endpoints and quotas. You can use any of the following image URI formats: Image ID only: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID] Image ID and digest: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]@[di"
        },
        "PortConfiguration": {
          "$ref": "#/$defs/ContainerPortConfiguration"
        },
        "ServerSdkVersion": {
          "type": "string",
          "description": "The Amazon GameLift Servers server SDK version that the game server is integrated with. Only game servers using 5.2.0 or higher are compatible with container fleets."
        },
        "LinuxCapabilities": {
          "$ref": "#/$defs/LinuxCapabilities"
        },
        "Vcpu": {
          "type": "number",
          "description": "The number of vCPU units reserved for the game server container. The container can use more vCPU when it's available, up to the container group's total vCPU limit if one is set. If the container group has a total vCPU limit and the request doesn't set this value, Amazon GameLift Servers calculates the game server container's vCPU as the total vCPU limit minus the sum of the vCPU units reserved for the group's support containers. A game server container group needs either a total vCPU limit or this value. If the container group doesn't have a total vCPU limit, the group's containers can use up "
        }
      },
      "required": [
        "ContainerName",
        "ImageUri",
        "PortConfiguration",
        "ServerSdkVersion"
      ]
    },
    "LinuxCapabilities": {
      "type": "object",
      "properties": {
        "Include": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "AUDIT_CONTROL",
              "AUDIT_WRITE",
              "BLOCK_SUSPEND",
              "CHOWN",
              "DAC_OVERRIDE",
              "DAC_READ_SEARCH",
              "FOWNER",
              "FSETID",
              "IPC_LOCK",
              "IPC_OWNER",
              "KILL",
              "LEASE",
              "LINUX_IMMUTABLE",
              "MAC_ADMIN",
              "MAC_OVERRIDE",
              "MKNOD",
              "NET_ADMIN",
              "NET_BIND_SERVICE",
              "NET_BROADCAST",
              "NET_RAW",
              "SETFCAP",
              "SETGID",
              "SETPCAP",
              "SETUID",
              "SYS_ADMIN",
              "SYS_BOOT",
              "SYS_CHROOT",
              "SYS_MODULE",
              "SYS_NICE",
              "SYS_PACCT",
              "SYS_PTRACE",
              "SYS_RAWIO",
              "SYS_RESOURCE",
              "SYS_TIME",
              "SYS_TTY_CONFIG",
              "SYSLOG",
              "WAKE_ALARM"
            ]
          },
          "description": "The list of Linux capabilities to add to the container's default configuration. Specify each capability as a string from the set of supported capability names (for example, NET_BIND_SERVICE or SYS_PTRACE)."
        }
      }
    },
    "SupportContainerDefinitionInput": {
      "type": "object",
      "properties": {
        "ContainerName": {
          "type": "string",
          "description": "A string that uniquely identifies the container definition within a container group."
        },
        "DependsOn": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerDependency"
          },
          "description": "Establishes dependencies between this container and the status of other containers in the same container group. A container can have dependencies on multiple different containers. You can use dependencies to establish a startup/shutdown sequence across the container group. For example, you might specify that ContainerB has a START dependency on ContainerA. This dependency means that ContainerB can't start until after ContainerA has started. This dependency is reversed on shutdown, which means that ContainerB must shut down before ContainerA can shut down."
        },
        "MountPoints": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerMountPoint"
          },
          "description": "A mount point that binds a path inside the container to a file or directory on the host system and lets it access the file or directory."
        },
        "EnvironmentOverride": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ContainerEnvironment"
          },
          "description": "A set of environment variables to pass to the container on startup. See the ContainerDefinition::environment parameter in the Amazon Elastic Container Service API Reference."
        },
        "Essential": {
          "type": "boolean",
          "description": "Flags the container as vital for the container group to function properly. If an essential container fails, the entire container group restarts. At least one support container in a per-instance container group must be essential. When flagging a container as essential, also configure a health check so that the container can signal that it's healthy."
        },
        "HealthCheck": {
          "$ref": "#/$defs/ContainerHealthCheck"
        },
        "ImageUri": {
          "type": "string",
          "description": "The location of the container image to deploy to a container fleet. Provide an image in an Amazon Elastic Container Registry public or private repository. The repository must be in the same Amazon Web Services account and Amazon Web Services Region where you're creating the container group definition. For limits on image size, see Amazon GameLift Servers endpoints and quotas. You can use any of the following image URI formats: Image ID only: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID] Image ID and digest: [AWS account].dkr.ecr.[AWS region].amazonaws.com/[repository ID]@[di"
        },
        "MemoryHardLimitMebibytes": {
          "type": "integer",
          "description": "A specified amount of memory (in MiB) to reserve for this container. If you don't specify a container-specific memory limit, the container shares the container group's total memory allocation. Related data type: ContainerGroupDefinition TotalMemoryLimitMebibytes"
        },
        "PortConfiguration": {
          "$ref": "#/$defs/ContainerPortConfiguration"
        },
        "Vcpu": {
          "type": "number",
          "description": "The number of vCPU units to reserve for this container. The container can use more resources when needed, if available. If you don't reserve vCPU units for this container, it shares the container group's total vCPU limit. Related data type: ContainerGroupDefinition TotalVcpuLimit"
        },
        "LinuxCapabilities": {
          "$ref": "#/$defs/LinuxCapabilities"
        }
      },
      "required": [
        "ContainerName",
        "ImageUri"
      ]
    },
    "Tag": {
      "type": "object",
      "properties": {
        "Key": {
          "type": "string",
          "description": "The key for a developer-defined key value pair for tagging an Amazon Web Services resource."
        },
        "Value": {
          "type": "string",
          "description": "The value for a developer-defined key value pair for tagging an Amazon Web Services resource."
        }
      },
      "required": [
        "Key",
        "Value"
      ]
    }
  }
}