create_container_group_definition
async
¶
create_container_group_definition(
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
name: Optional[ContainerGroupDefinitionName] = None,
container_group_type: Optional[ContainerGroupType] = None,
total_memory_limit_mebibytes: Optional[ContainerTotalMemoryLimit] = None,
total_vcpu_limit: Optional[ContainerTotalVcpuLimit] = None,
game_server_container_definition: Optional[
GameServerContainerDefinitionInput
] = None,
support_container_definitions: Optional[SupportContainerDefinitionInputList] = None,
operating_system: Optional[ContainerOperatingSystem] = None,
version_description: Optional[NonZeroAndMaxString] = None,
tags: Optional[TagList] = None,
) -> CreateContainerGroupDefinitionOutput
This API works with the following fleet types: Container
Creates a ContainerGroupDefinition that describes a set of containers for hosting your game server with Amazon GameLift Servers managed containers hosting. An Amazon GameLift Servers container group is similar to a container task or pod. Use container group definitions when you create a container fleet with CreateContainerFleet.
A container group definition determines how Amazon GameLift Servers deploys your containers to each instance in a container fleet. You can maintain multiple versions of a container group definition.
There are two types of container groups:
-
A game server container group has the containers that run your game server application and supporting software. A game server container group can have these container types:
-
Game server container. This container runs your game server. You can define one game server container in a game server container group.
-
Support container. This container runs software in parallel with your game server. You can define up to 8 support containers in a game server group.
When building a game server container group definition, you can choose to bundle your game server executable and all dependent software into a single game server container. Alternatively, you can separate the software into one game server container and one or more support containers.
On a container fleet instance, a game server container group can be deployed multiple times (depending on the compute resources of the instance). This means that all containers in the container group are replicated together.
-
-
A per-instance container group has containers for processes that aren't replicated on a container fleet instance. This might include background services, logging, test processes, or processes that need to persist independently of the game server container group. When building a per-instance container group, you can define up to 10 support containers.
This operation requires Identity and Access Management (IAM) permissions to access container images in Amazon ECR repositories. See IAM permissions for Amazon GameLift Servers for help setting the appropriate permissions.
Request options
Use this operation to make the following types of requests. You can specify values for the minimum required parameters and customize optional values later.
-
Create a game server container group definition. Provide the following required parameter values:
-
Name -
ContainerGroupType(GAME_SERVER) -
OperatingSystem -
TotalMemoryLimitMebibytes -
Either
TotalVcpuLimitor aVcpuvalue for the game server container -
At least one
GameServerContainerDefinition-
ContainerName -
ImageUrl -
PortConfiguration -
ServerSdkVersion
-
-
-
Create a per-instance container group definition. Provide the following required parameter values:
-
Name -
ContainerGroupType(PER_INSTANCE) -
OperatingSystem -
TotalMemoryLimitMebibytes -
TotalVcpuLimit -
At least one
SupportContainerDefinition-
ContainerName -
ImageUrl
-
-
Results
If successful, this request creates a ContainerGroupDefinition resource and assigns a unique ARN value. You can update most properties of a container group definition by calling UpdateContainerGroupDefinition, and optionally save the update as a new version.
Parameters:
-
name(Optional[ContainerGroupDefinitionName], default:None) –A descriptive identifier for the container group definition. The name value must be unique in an Amazon Web Services Region.
-
container_group_type(Optional[ContainerGroupType], default:None) –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 -
total_memory_limit_mebibytes(Optional[ContainerTotalMemoryLimit], default:None) –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
-
total_vcpu_limit(Optional[ContainerTotalVcpuLimit], default:None) –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
Vcpuvalues 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
Vcpuvalue for the game server container. If you set a total vCPU limit for a game server container group, Amazon GameLift Servers uses this value to calculate how many game server container groups fit on an instance. If you don't set a total vCPU limit, the group's containers can use up to the instance's available vCPU, and Amazon GameLift Servers uses the sum of the containers'Vcpuvalues to calculate how many game server container groups fit on an instance. -
game_server_container_definition(Optional[GameServerContainerDefinitionInput], default:None) –The definition for the game server container in this group. Define a game server container only when the container group type is
GAME_SERVER. Game server containers specify a container image with your game server build. You can pass in your container definitions as a JSON file. -
support_container_definitions(Optional[SupportContainerDefinitionInputList], default:None) –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.
-
operating_system(Optional[ContainerOperatingSystem], default:None) –The platform that all containers in the group use. Containers in a group must run on the same operating system.
Default value:
AMAZON_LINUX_2023Amazon 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.
-
version_description(Optional[NonZeroAndMaxString], default:None) –A description for the initial version of this container group definition.
-
tags(Optional[TagList], default:None) –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.
Raises:
-
ConflictException–The requested operation would cause a conflict with the current state of a service resource associated with the request. Resolve the conflict before retrying this request.
-
InternalServiceException–The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
-
InvalidRequestException–One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
-
LimitExceededException–The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.
-
TaggingFailedException–The requested tagging operation did not succeed. This may be due to invalid tag format or the maximum tag limit may have been exceeded. Resolve the issue before retrying.
-
UnauthorizedException–The client failed authentication. Clients should not retry such requests.
-
UnsupportedRegionException–The requested operation is not supported in the Region specified.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_gamelift/_services/async_game_lift.py
1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 | |