update_container_group_definition
async
¶
update_container_group_definition(
*,
config_overrides: Optional[AsyncGameLiftClientConfig] = None,
name: Optional[ContainerGroupDefinitionNameOrArn] = None,
game_server_container_definition: Optional[
GameServerContainerDefinitionInput
] = None,
support_container_definitions: Optional[SupportContainerDefinitionInputList] = None,
total_memory_limit_mebibytes: Optional[ContainerTotalMemoryLimit] = None,
total_vcpu_limit: Optional[ContainerTotalVcpuLimit] = None,
version_description: Optional[NonZeroAndMaxString] = None,
source_version_number: Optional[PositiveInteger] = None,
operating_system: Optional[ContainerOperatingSystem] = None,
remove_attributes: Optional[ContainerGroupDefinitionRemoveAttributeList] = None,
) -> UpdateContainerGroupDefinitionOutput
This API works with the following fleet types: Container
Updates properties in an existing container group definition. This operation doesn't replace the definition. Instead, it creates a new version of the definition and saves it separately. You can access all versions that you choose to retain.
The only property you can't update is the container group type.
Request options:
-
Update based on the latest version of the container group definition. Specify the container group definition name only, or use an ARN value without a version number. Provide updated values for the properties that you want to change only. All other values remain the same as the latest version.
-
Update based on a specific version of the container group definition. Specify the container group definition name and a source version number, or use an ARN value with a version number. Provide updated values for the properties that you want to change only. All other values remain the same as the source version.
-
Change a game server container definition. Provide a complete set of container definitions, including the updated definition.
-
Add or change a support container definition. Provide a complete set of container definitions, including the updated definition.
-
Remove a support container definition. Provide a complete set of container definitions, excluding the definition to remove. If the container group has only one support container definition, provide an empty set.
-
Remove the total vCPU limit from a game server container group so that its containers can use up to the instance's available vCPU. Set
RemoveAttributestoTOTAL_VCPU_LIMIT. The game server container must have aVcpuvalue, because a game server container group needs either a total vCPU limit or a game serverVcpuvalue.
Results:
If successful, this operation returns the complete properties of the new container group definition version.
If the container group definition version is used in an active fleet, the update automatically initiates a new fleet deployment of the new version. You can track a fleet's deployments using ListFleetDeployments.
Parameters:
-
name(Optional[ContainerGroupDefinitionNameOrArn], default:None) –A descriptive identifier for the container group definition. The name value must be unique in an Amazon Web Services Region.
-
game_server_container_definition(Optional[GameServerContainerDefinitionInput], default:None) –An updated definition for the game server container in this group. Define a game server container only when the container group type is
GAME_SERVER. You can pass in your container definitions as a JSON file. -
support_container_definitions(Optional[SupportContainerDefinitionInputList], default:None) –One or more definitions 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.
-
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.
-
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.For a game server container group, Amazon GameLift Servers requires either a total vCPU limit or a
Vcpuvalue for the game server container. If the container group has a total vCPU limit, Amazon GameLift Servers uses this value to calculate how many game server container groups fit on an instance. If the container group doesn't have a total vCPU limit, its 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. To remove the total vCPU limit, omit this parameter and setRemoveAttributestoTOTAL_VCPU_LIMIT. -
version_description(Optional[NonZeroAndMaxString], default:None) –A description for this update to the container group definition.
-
source_version_number(Optional[PositiveInteger], default:None) –The container group definition version to update. The new version starts with values from the source version, and then updates values included in this request.
-
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.
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.
-
remove_attributes(Optional[ContainerGroupDefinitionRemoveAttributeList], default:None) –If set, this update removes the container group's total vCPU limit, and the group's containers can use up to the instance's available vCPU. You can't remove the total vCPU limit from a per-instance container group. A game server container group needs either a total vCPU limit or a
Vcpuvalue for the game server container. You can't setTotalVcpuLimitin the same request.
Raises:
-
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.
-
NotFoundException–The requested resource was not found. The resource was either not created yet or deleted.
-
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
10385 10386 10387 10388 10389 10390 10391 10392 10393 10394 10395 10396 10397 10398 10399 10400 10401 10402 10403 10404 10405 10406 10407 10408 10409 10410 10411 10412 10413 10414 10415 10416 10417 10418 10419 10420 10421 10422 10423 10424 10425 10426 10427 10428 10429 10430 10431 10432 10433 10434 10435 10436 10437 10438 10439 10440 10441 10442 10443 10444 10445 10446 10447 10448 10449 10450 10451 10452 10453 10454 10455 10456 10457 10458 10459 10460 10461 10462 10463 10464 10465 10466 10467 10468 10469 10470 10471 10472 10473 10474 10475 10476 10477 10478 10479 10480 10481 10482 10483 10484 10485 10486 10487 10488 10489 10490 10491 10492 10493 10494 10495 10496 10497 10498 10499 10500 10501 10502 10503 10504 10505 10506 10507 10508 10509 10510 10511 10512 10513 10514 10515 10516 10517 10518 10519 10520 10521 | |