update_container_group_definition
¶
update_container_group_definition(
*,
config_overrides: Optional[GameLiftClientConfig] = 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/game_lift.py
8955 8956 8957 8958 8959 8960 8961 8962 8963 8964 8965 8966 8967 8968 8969 8970 8971 8972 8973 8974 8975 8976 8977 8978 8979 8980 8981 8982 8983 8984 8985 8986 8987 8988 8989 8990 8991 8992 8993 8994 8995 8996 8997 8998 8999 9000 9001 9002 9003 9004 9005 9006 9007 9008 9009 9010 9011 9012 9013 9014 9015 9016 9017 9018 9019 9020 9021 9022 9023 9024 9025 9026 9027 9028 9029 9030 9031 9032 9033 9034 9035 9036 9037 9038 9039 9040 9041 9042 9043 9044 9045 9046 9047 9048 9049 9050 9051 9052 9053 9054 9055 9056 9057 9058 9059 9060 9061 9062 9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 | |