UpdateContainerFleet
Updates the properties of a managed container fleet. Depending on the properties being updated, this operation might initiate a fleet deployment. You can track deployments for a fleet using https://docs.aws.amazon.com/gamelift/latest/apireference/API_DescribeFleetDeployment.html.
Request options
As with CreateContainerFleet, many fleet properties use common defaults or are calculated based on the fleet's container group definitions.
-
Update fleet properties that result in a fleet deployment. Include only those properties that you want to change. Specify deployment configuration settings.
-
Update fleet properties that don't result in a fleet deployment. Include only those properties that you want to change.
Changes to the following properties initiate a fleet deployment:
-
GameServerContainerGroupDefinition
-
PerInstanceContainerGroupDefinition
-
GameServerContainerGroupsPerInstance
-
InstanceInboundPermissions
-
InstanceConnectionPortRange
-
LogConfiguration
Results
If successful, this operation updates the container fleet resource, and might initiate
a new deployment of fleet resources using the deployment configuration provided. A
deployment replaces existing fleet instances with new instances that are deployed with
the updated fleet properties. The fleet is placed in UPDATING
status until
the deployment is complete, then return to ACTIVE
.
You can have only one update deployment active at a time for a fleet. If a second update request initiates a deployment while another deployment is in progress, the first deployment is cancelled.
Request Syntax
{
"DeploymentConfiguration": {
"ImpairmentStrategy": "string
",
"MinimumHealthyPercentage": number
,
"ProtectionStrategy": "string
"
},
"Description": "string
",
"FleetId": "string
",
"GameServerContainerGroupDefinitionName": "string
",
"GameServerContainerGroupsPerInstance": number
,
"GameSessionCreationLimitPolicy": {
"NewGameSessionsPerCreator": number
,
"PolicyPeriodInMinutes": number
},
"InstanceConnectionPortRange": {
"FromPort": number
,
"ToPort": number
},
"InstanceInboundPermissionAuthorizations": [
{
"FromPort": number
,
"IpRange": "string
",
"Protocol": "string
",
"ToPort": number
}
],
"InstanceInboundPermissionRevocations": [
{
"FromPort": number
,
"IpRange": "string
",
"Protocol": "string
",
"ToPort": number
}
],
"LogConfiguration": {
"LogDestination": "string
",
"LogGroupArn": "string
",
"S3BucketName": "string
"
},
"MetricGroups": [ "string
" ],
"NewGameSessionProtectionPolicy": "string
",
"PerInstanceContainerGroupDefinitionName": "string
",
"RemoveAttributes": [ "string
" ]
}
Request Parameters
For information about the parameters that are common to all actions, see Common Parameters.
The request accepts the following data in JSON format.
Note
In the following list, the required parameters are described first.
- FleetId
-
A unique identifier for the container fleet to update. You can use either the fleet ID or ARN value.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
^[a-z]*fleet-[a-zA-Z0-9\-]+$|^arn:.*:[a-z]*fleet\/[a-z]*fleet-[a-zA-Z0-9\-]+$
Required: Yes
- DeploymentConfiguration
-
Instructions for how to deploy updates to a container fleet, if the fleet update initiates a deployment. The deployment configuration lets you determine how to replace fleet instances and what actions to take if the deployment fails.
Type: DeploymentConfiguration object
Required: No
- Description
-
A meaningful description of the container fleet.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 1024.
Required: No
- GameServerContainerGroupDefinitionName
-
The name or ARN value of a new game server container group definition to deploy on the fleet. If you're updating the fleet to a specific version of a container group definition, use the ARN value and include the version number. If you're updating the fleet to the latest version of a container group definition, you can use the name value. You can't remove a fleet's game server container group definition, you can only update or replace it with another definition.
Update a container group definition by calling UpdateContainerGroupDefinition. This operation creates a ContainerGroupDefinition resource with an incremented version.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
^[a-zA-Z0-9\-]+$|^arn:.*:containergroupdefinition\/[a-zA-Z0-9\-]+(:[0-9]+)?$
Required: No
- GameServerContainerGroupsPerInstance
-
The number of times to replicate the game server container group on each fleet instance. By default, Amazon GameLift calculates the maximum number of game server container groups that can fit on each instance. You can remove this property value to use the calculated value, or set it manually. If you set this number manually, Amazon GameLift uses your value as long as it's less than the calculated maximum.
Type: Integer
Valid Range: Minimum value of 1. Maximum value of 5000.
Required: No
- GameSessionCreationLimitPolicy
-
A policy that limits the number of game sessions that each individual player can create on instances in this fleet. The limit applies for a specified span of time.
Type: GameSessionCreationLimitPolicy object
Required: No
- InstanceConnectionPortRange
-
A revised set of port numbers to open on each fleet instance. By default, Amazon GameLift calculates an optimal port range based on your fleet configuration. If you previously set this parameter manually, you can't reset this to use the calculated settings.
Type: ConnectionPortRange object
Required: No
- InstanceInboundPermissionAuthorizations
-
A set of ports to add to the container fleet's inbound permissions.
Type: Array of IpPermission objects
Array Members: Maximum number of 50 items.
Required: No
- InstanceInboundPermissionRevocations
-
A set of ports to remove from the container fleet's inbound permissions.
Type: Array of IpPermission objects
Array Members: Maximum number of 50 items.
Required: No
- LogConfiguration
-
The method for collecting container logs for the fleet.
Type: LogConfiguration object
Required: No
- MetricGroups
-
The name of an AWS CloudWatch metric group to add this fleet to.
Type: Array of strings
Array Members: Maximum number of 1 item.
Length Constraints: Minimum length of 1. Maximum length of 255.
Required: No
- NewGameSessionProtectionPolicy
-
The game session protection policy to apply to all new game sessions that are started in this fleet. Game sessions that already exist are not affected.
Type: String
Valid Values:
NoProtection | FullProtection
Required: No
- PerInstanceContainerGroupDefinitionName
-
The name or ARN value of a new per-instance container group definition to deploy on the fleet. If you're updating the fleet to a specific version of a container group definition, use the ARN value and include the version number. If you're updating the fleet to the latest version of a container group definition, you can use the name value.
Update a container group definition by calling UpdateContainerGroupDefinition. This operation creates a ContainerGroupDefinition resource with an incremented version.
To remove a fleet's per-instance container group definition, leave this parameter empty and use the parameter
RemoveAttributes
.Type: String
Length Constraints: Minimum length of 1. Maximum length of 512.
Pattern:
^[a-zA-Z0-9\-]+$|^arn:.*:containergroupdefinition\/[a-zA-Z0-9\-]+(:[0-9]+)?$
Required: No
- RemoveAttributes
-
If set, this update removes a fleet's per-instance container group definition. You can't remove a fleet's game server container group definition.
Type: Array of strings
Array Members: Fixed number of 1 item.
Valid Values:
PER_INSTANCE_CONTAINER_GROUP_DEFINITION
Required: No
Response Syntax
{
"ContainerFleet": {
"BillingType": "string",
"CreationTime": number,
"DeploymentDetails": {
"LatestDeploymentId": "string"
},
"Description": "string",
"FleetArn": "string",
"FleetId": "string",
"FleetRoleArn": "string",
"GameServerContainerGroupDefinitionArn": "string",
"GameServerContainerGroupDefinitionName": "string",
"GameServerContainerGroupsPerInstance": number,
"GameSessionCreationLimitPolicy": {
"NewGameSessionsPerCreator": number,
"PolicyPeriodInMinutes": number
},
"InstanceConnectionPortRange": {
"FromPort": number,
"ToPort": number
},
"InstanceInboundPermissions": [
{
"FromPort": number,
"IpRange": "string",
"Protocol": "string",
"ToPort": number
}
],
"InstanceType": "string",
"LocationAttributes": [
{
"Location": "string",
"Status": "string"
}
],
"LogConfiguration": {
"LogDestination": "string",
"LogGroupArn": "string",
"S3BucketName": "string"
},
"MaximumGameServerContainerGroupsPerInstance": number,
"MetricGroups": [ "string" ],
"NewGameSessionProtectionPolicy": "string",
"PerInstanceContainerGroupDefinitionArn": "string",
"PerInstanceContainerGroupDefinitionName": "string",
"Status": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- ContainerFleet
-
A collection of container fleet objects for all fleets that match the request criteria.
Type: ContainerFleet object
Errors
For information about the errors that are common to all actions, see Common Errors.
- InternalServiceException
-
The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.
HTTP Status Code: 500
- InvalidRequestException
-
One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.
HTTP Status Code: 400
- LimitExceededException
-
The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying.
HTTP Status Code: 400
- NotFoundException
-
The requested resources was not found. The resource was either not created yet or deleted.
HTTP Status Code: 400
- NotReadyException
-
The operation failed because Amazon GameLift has not yet finished validating this compute. We recommend attempting 8 to 10 retries over 3 to 5 minutes with exponential backoffs and jitter
. HTTP Status Code: 400
- UnauthorizedException
-
The client failed authentication. Clients should not retry such requests.
HTTP Status Code: 400
- UnsupportedRegionException
-
The requested operation is not supported in the Region specified.
HTTP Status Code: 400
Examples
Update a single-region container fleet with a new game server container group
This example updates the fleet with a new version of the fleet's game server container group. No other fleet properties are changed. The update initiates a fleet deployment.
HTTP requests are authenticated using an AWS Signature Version 4 signature in the Authorization
header field.
Sample Request
{
"DeploymentConfiguration": {
"ImpairmentStrategy": "ROLLBACK",
"MinimumHealthyPercentage": 75,
"ProtectionStrategy": "WITH_PROTECTION"
},
"FleetId": "containerfleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa",
"GameServerContainerGroupDefinitionName": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyAdventureGameContainerGroup:2"
}
Sample Response
{
"ContainerFleet": {
"BillingType": ON_DEMAND,
"CreationTime": 1736365885.22,
"DeploymentDetails": {
"LatestDeploymentId": "deployment-2222bbbb-33cc-44dd-55ee-6666ffff77aa"
},
"FleetArn": "arn:aws:gamelift:us-west-2::containerfleet/containerfleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa",
"FleetId": "containerfleet-2222bbbb-33cc-44dd-55ee-6666ffff77aa",
"FleetRoleArn": "arn:aws:iam::MyAccount:role/MyRole",
"GameServerContainerGroupDefinitionArn": "arn:aws:gamelift:us-west-2:111122223333:containergroupdefinition/MyAdventureGameContainerGroup:2",
"GameServerContainerGroupDefinitionName": "MyAdventureGameContainerGroup",
"GameServerContainerGroupsPerInstance": number,
"InstanceConnectionPortRange": {
"FromPort": 4192,
"ToPort": 4242
},
"InstanceInboundPermissions": [
{
"FromPort": 4192,
"IpRange": "string",
"Protocol": "UDP",
"ToPort": 4242,
}
],
"InstanceType": "c5.large",
"LogConfiguration": {
"LogGroupArn": "arn:aws:logs:us-west-2:111222333444:log-group:customerLogs",
"LogDestination": "CLOUDWATCH"
},
"MaximumGameServerContainerGroupsPerInstance": 10,
"NewGameSessionProtectionPolicy": "NoProtection",
"Status": "UPDATING"
}
}
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: