- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
UpdateContainerFleetCommand
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.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { GameLiftClient, UpdateContainerFleetCommand } from "@aws-sdk/client-gamelift"; // ES Modules import
// const { GameLiftClient, UpdateContainerFleetCommand } = require("@aws-sdk/client-gamelift"); // CommonJS import
const client = new GameLiftClient(config);
const input = { // UpdateContainerFleetInput
FleetId: "STRING_VALUE", // required
GameServerContainerGroupDefinitionName: "STRING_VALUE",
PerInstanceContainerGroupDefinitionName: "STRING_VALUE",
GameServerContainerGroupsPerInstance: Number("int"),
InstanceConnectionPortRange: { // ConnectionPortRange
FromPort: Number("int"), // required
ToPort: Number("int"), // required
},
InstanceInboundPermissionAuthorizations: [ // IpPermissionsList
{ // IpPermission
FromPort: Number("int"), // required
ToPort: Number("int"), // required
IpRange: "STRING_VALUE", // required
Protocol: "TCP" || "UDP", // required
},
],
InstanceInboundPermissionRevocations: [
{
FromPort: Number("int"), // required
ToPort: Number("int"), // required
IpRange: "STRING_VALUE", // required
Protocol: "TCP" || "UDP", // required
},
],
DeploymentConfiguration: { // DeploymentConfiguration
ProtectionStrategy: "WITH_PROTECTION" || "IGNORE_PROTECTION",
MinimumHealthyPercentage: Number("int"),
ImpairmentStrategy: "MAINTAIN" || "ROLLBACK",
},
Description: "STRING_VALUE",
MetricGroups: [ // MetricGroupList
"STRING_VALUE",
],
NewGameSessionProtectionPolicy: "NoProtection" || "FullProtection",
GameSessionCreationLimitPolicy: { // GameSessionCreationLimitPolicy
NewGameSessionsPerCreator: Number("int"),
PolicyPeriodInMinutes: Number("int"),
},
LogConfiguration: { // LogConfiguration
LogDestination: "NONE" || "CLOUDWATCH" || "S3",
S3BucketName: "STRING_VALUE",
LogGroupArn: "STRING_VALUE",
},
RemoveAttributes: [ // ContainerFleetRemoveAttributeList
"PER_INSTANCE_CONTAINER_GROUP_DEFINITION",
],
};
const command = new UpdateContainerFleetCommand(input);
const response = await client.send(command);
// { // UpdateContainerFleetOutput
// ContainerFleet: { // ContainerFleet
// FleetId: "STRING_VALUE",
// FleetArn: "STRING_VALUE",
// FleetRoleArn: "STRING_VALUE",
// GameServerContainerGroupDefinitionName: "STRING_VALUE",
// GameServerContainerGroupDefinitionArn: "STRING_VALUE",
// PerInstanceContainerGroupDefinitionName: "STRING_VALUE",
// PerInstanceContainerGroupDefinitionArn: "STRING_VALUE",
// InstanceConnectionPortRange: { // ConnectionPortRange
// FromPort: Number("int"), // required
// ToPort: Number("int"), // required
// },
// InstanceInboundPermissions: [ // IpPermissionsList
// { // IpPermission
// FromPort: Number("int"), // required
// ToPort: Number("int"), // required
// IpRange: "STRING_VALUE", // required
// Protocol: "TCP" || "UDP", // required
// },
// ],
// GameServerContainerGroupsPerInstance: Number("int"),
// MaximumGameServerContainerGroupsPerInstance: Number("int"),
// InstanceType: "STRING_VALUE",
// BillingType: "ON_DEMAND" || "SPOT",
// Description: "STRING_VALUE",
// CreationTime: new Date("TIMESTAMP"),
// MetricGroups: [ // MetricGroupList
// "STRING_VALUE",
// ],
// NewGameSessionProtectionPolicy: "NoProtection" || "FullProtection",
// GameSessionCreationLimitPolicy: { // GameSessionCreationLimitPolicy
// NewGameSessionsPerCreator: Number("int"),
// PolicyPeriodInMinutes: Number("int"),
// },
// Status: "PENDING" || "CREATING" || "CREATED" || "ACTIVATING" || "ACTIVE" || "UPDATING" || "DELETING",
// DeploymentDetails: { // DeploymentDetails
// LatestDeploymentId: "STRING_VALUE",
// },
// LogConfiguration: { // LogConfiguration
// LogDestination: "NONE" || "CLOUDWATCH" || "S3",
// S3BucketName: "STRING_VALUE",
// LogGroupArn: "STRING_VALUE",
// },
// LocationAttributes: [ // ContainerFleetLocationAttributesList
// { // ContainerFleetLocationAttributes
// Location: "STRING_VALUE",
// Status: "PENDING" || "CREATING" || "CREATED" || "ACTIVATING" || "ACTIVE" || "UPDATING" || "DELETING",
// },
// ],
// },
// };
UpdateContainerFleetCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
FleetId Required | string | undefined | A unique identifier for the container fleet to update. You can use either the fleet ID or ARN value. |
DeploymentConfiguration | DeploymentConfiguration | undefined | 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. |
Description | string | undefined | A meaningful description of the container fleet. |
GameServerContainerGroupDefinitionName | string | undefined | 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. |
GameServerContainerGroupsPerInstance | number | undefined | 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. |
GameSessionCreationLimitPolicy | GameSessionCreationLimitPolicy | undefined | 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. |
InstanceConnectionPortRange | ConnectionPortRange | undefined | 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. |
InstanceInboundPermissionAuthorizations | IpPermission[] | undefined | A set of ports to add to the container fleet's inbound permissions. |
InstanceInboundPermissionRevocations | IpPermission[] | undefined | A set of ports to remove from the container fleet's inbound permissions. |
LogConfiguration | LogConfiguration | undefined | The method for collecting container logs for the fleet. |
MetricGroups | string[] | undefined | The name of an Amazon Web Services CloudWatch metric group to add this fleet to. |
NewGameSessionProtectionPolicy | ProtectionPolicy | undefined | 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. |
PerInstanceContainerGroupDefinitionName | string | undefined | 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 | ContainerFleetRemoveAttribute[] | undefined | 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. |
UpdateContainerFleetCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
ContainerFleet | ContainerFleet | undefined | A collection of container fleet objects for all fleets that match the request criteria. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
InternalServiceException | server | The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period. |
InvalidRequestException | client | One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying. |
LimitExceededException | client | The requested operation would cause the resource to exceed the allowed service limit. Resolve the issue before retrying. |
NotFoundException | client | The requested resources was not found. The resource was either not created yet or deleted. |
NotReadyException | client | 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 . |
UnauthorizedException | client | The client failed authentication. Clients should not retry such requests. |
UnsupportedRegionException | client | The requested operation is not supported in the Region specified. |
GameLiftServiceException | Base exception class for all service exceptions from GameLift service. |