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
9063 9064 9065 9066 9067 9068 9069 9070 9071 9072 9073 9074 9075 9076 9077 9078 9079 9080 9081 9082 9083 9084 9085 9086 9087 9088 9089 9090 9091 9092 9093 9094 9095 9096 9097 9098 9099 9100 9101 9102 9103 9104 9105 9106 9107 9108 9109 9110 9111 9112 9113 9114 9115 9116 9117 9118 9119 9120 9121 9122 9123 9124 9125 9126 9127 9128 9129 9130 9131 9132 9133 9134 9135 9136 9137 9138 9139 9140 9141 9142 9143 9144 9145 9146 9147 9148 9149 9150 9151 9152 9153 9154 9155 9156 9157 9158 9159 9160 9161 9162 9163 9164 9165 9166 9167 9168 9169 9170 9171 9172 9173 9174 9175 9176 9177 9178 9179 9180 9181 9182 9183 9184 9185 9186 9187 | |