class CfnContainerFleet (construct)
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.GameLift.CfnContainerFleet |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsgamelift#CfnContainerFleet |
![]() | software.amazon.awscdk.services.gamelift.CfnContainerFleet |
![]() | aws_cdk.aws_gamelift.CfnContainerFleet |
![]() | aws-cdk-lib » aws_gamelift » CfnContainerFleet |
Implements
IConstruct
, IDependable
, IInspectable
, ITaggable
Describes an Amazon GameLift managed container fleet.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_gamelift as gamelift } from 'aws-cdk-lib';
const cfnContainerFleet = new gamelift.CfnContainerFleet(this, 'MyCfnContainerFleet', {
fleetRoleArn: 'fleetRoleArn',
// the properties below are optional
billingType: 'billingType',
deploymentConfiguration: {
impairmentStrategy: 'impairmentStrategy',
minimumHealthyPercentage: 123,
protectionStrategy: 'protectionStrategy',
},
description: 'description',
gameServerContainerGroupDefinitionName: 'gameServerContainerGroupDefinitionName',
gameServerContainerGroupsPerInstance: 123,
gameSessionCreationLimitPolicy: {
newGameSessionsPerCreator: 123,
policyPeriodInMinutes: 123,
},
instanceConnectionPortRange: {
fromPort: 123,
toPort: 123,
},
instanceInboundPermissions: [{
fromPort: 123,
ipRange: 'ipRange',
protocol: 'protocol',
toPort: 123,
}],
instanceType: 'instanceType',
locations: [{
location: 'location',
// the properties below are optional
locationCapacity: {
desiredEc2Instances: 123,
maxSize: 123,
minSize: 123,
},
stoppedActions: ['stoppedActions'],
}],
logConfiguration: {
logDestination: 'logDestination',
s3BucketName: 's3BucketName',
},
metricGroups: ['metricGroups'],
newGameSessionProtectionPolicy: 'newGameSessionProtectionPolicy',
perInstanceContainerGroupDefinitionName: 'perInstanceContainerGroupDefinitionName',
scalingPolicies: [{
metricName: 'metricName',
name: 'name',
// the properties below are optional
comparisonOperator: 'comparisonOperator',
evaluationPeriods: 123,
policyType: 'policyType',
scalingAdjustment: 123,
scalingAdjustmentType: 'scalingAdjustmentType',
targetConfiguration: {
targetValue: 123,
},
threshold: 123,
}],
tags: [{
key: 'key',
value: 'value',
}],
});
Initializer
new CfnContainerFleet(scope: Construct, id: string, props: CfnContainerFleetProps)
Parameters
- scope
Construct
— Scope in which this resource is defined. - id
string
— Construct identifier for this resource (unique in its scope). - props
Cfn
— Resource properties.Container Fleet Props
Construct Props
Name | Type | Description |
---|---|---|
fleet | string | The unique identifier for an AWS Identity and Access Management (IAM) role with permissions to run your containers on resources that are managed by Amazon GameLift. |
billing | string | Indicates whether the fleet uses On-Demand or Spot instances for this fleet. |
deployment | IResolvable | Deployment | Set of rules for processing a deployment for a container fleet update. |
description? | string | A meaningful description of the container fleet. |
game | string | The name of the fleet's game server container group definition, which describes how to deploy containers with your game server build and support software onto each fleet instance. |
game | number | The number of times to replicate the game server container group on each fleet instance. |
game | IResolvable | Game | A policy that limits the number of game sessions that each individual player can create on instances in this fleet. |
instance | IResolvable | Connection | The set of port numbers to open on each instance in a container fleet. |
instance | IResolvable | IResolvable | Ip [] | The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet. |
instance | string | The Amazon EC2 instance type to use for all instances in the fleet. |
locations? | IResolvable | IResolvable | Location [] | |
log | IResolvable | Log | The method that is used to collect container logs for the fleet. |
metric | string[] | The name of an AWS CloudWatch metric group to add this fleet to. |
new | string | Determines whether Amazon GameLift can shut down game sessions on the fleet that are actively running and hosting players. |
per | string | The name of the fleet's per-instance container group definition. |
scaling | IResolvable | IResolvable | Scaling [] | A list of rules that control how a fleet is scaled. |
tags? | Cfn [] | An array of key-value pairs to apply to this resource. |
fleetRoleArn
Type:
string
The unique identifier for an AWS Identity and Access Management (IAM) role with permissions to run your containers on resources that are managed by Amazon GameLift.
See Set up an IAM service role . This fleet property can't be changed.
billingType?
Type:
string
(optional)
Indicates whether the fleet uses On-Demand or Spot instances for this fleet.
Learn more about when to use On-Demand versus Spot Instances . You can't update this fleet property.
By default, this property is set to ON_DEMAND
.
deploymentConfiguration?
Type:
IResolvable
|
Deployment
(optional)
Set of rules for processing a deployment for a container fleet update.
description?
Type:
string
(optional)
A meaningful description of the container fleet.
gameServerContainerGroupDefinitionName?
Type:
string
(optional)
The name of the fleet's game server container group definition, which describes how to deploy containers with your game server build and support software onto each fleet instance.
gameServerContainerGroupsPerInstance?
Type:
number
(optional)
The number of times to replicate the game server container group on each fleet instance.
gameSessionCreationLimitPolicy?
Type:
IResolvable
|
Game
(optional)
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?
Type:
IResolvable
|
Connection
(optional)
The set of port numbers to open on each instance in a container fleet.
Connection ports are used by inbound traffic to connect with processes that are running in containers on the fleet.
instanceInboundPermissions?
Type:
IResolvable
|
IResolvable
|
Ip
[]
(optional)
The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet.
instanceType?
Type:
string
(optional)
The Amazon EC2 instance type to use for all instances in the fleet.
Instance type determines the computing resources and processing power that's available to host your game servers. This includes including CPU, memory, storage, and networking capacity. You can't update this fleet property.
locations?
Type:
IResolvable
|
IResolvable
|
Location
[]
(optional)
logConfiguration?
Type:
IResolvable
|
Log
(optional)
The method that is used to collect container logs for the fleet.
Amazon GameLift saves all standard output for each container in logs, including game session logs.
CLOUDWATCH
-- Send logs to an Amazon CloudWatch log group that you define. Each container emits a log stream, which is organized in the log group.S3
-- Store logs in an Amazon S3 bucket that you define.NONE
-- Don't collect container logs.
metricGroups?
Type:
string[]
(optional)
The name of an AWS CloudWatch metric group to add this fleet to.
Metric groups aggregate metrics for multiple fleets.
newGameSessionProtectionPolicy?
Type:
string
(optional)
Determines whether Amazon GameLift can shut down game sessions on the fleet that are actively running and hosting players.
Amazon GameLift might prompt an instance shutdown when scaling down fleet capacity or when retiring unhealthy instances. You can also set game session protection for individual game sessions using UpdateGameSession .
- NoProtection -- Game sessions can be shut down during active gameplay.
- FullProtection -- Game sessions in
ACTIVE
status can't be shut down.
perInstanceContainerGroupDefinitionName?
Type:
string
(optional)
The name of the fleet's per-instance container group definition.
scalingPolicies?
Type:
IResolvable
|
IResolvable
|
Scaling
[]
(optional)
A list of rules that control how a fleet is scaled.
tags?
Type:
Cfn
[]
(optional)
An array of key-value pairs to apply to this resource.
Properties
Name | Type | Description |
---|---|---|
attr | string | A time stamp indicating when this data object was created. |
attr | IResolvable | Provides information about the last deployment ID and its status. |
attr | string | The Amazon Resource Name ( ARN ) that is assigned to a Amazon GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912 . In a GameLift fleet ARN, the resource ID matches the FleetId value. |
attr | string | A unique identifier for the container fleet to retrieve. |
attr | string | The Amazon Resource Name ( ARN ) that is assigned to the fleet's game server container group. The ARN value also identifies the specific container group definition version in use. |
attr | number | The calculated maximum number of game server container group that can be deployed on each fleet instance. |
attr | string | The Amazon Resource Name ( ARN ) that is assigned to the fleet's per-instance container group. The ARN value also identifies the specific container group definition version in use. |
attr | string | The current status of the container fleet. |
cdk | Tag | Tag Manager which manages the tags for this resource. |
cfn | ICfn | Options for this resource, such as condition, update policy etc. |
cfn | { [string]: any } | |
cfn | string | AWS resource type. |
creation | string[] | |
fleet | string | The unique identifier for an AWS Identity and Access Management (IAM) role with permissions to run your containers on resources that are managed by Amazon GameLift. |
logical | string | The logical ID for this CloudFormation stack element. |
node | Node | The tree node. |
ref | string | Return a string that will be resolved to a CloudFormation { Ref } for this element. |
stack | Stack | The stack in which this element is defined. |
billing | string | Indicates whether the fleet uses On-Demand or Spot instances for this fleet. |
deployment | IResolvable | Deployment | Set of rules for processing a deployment for a container fleet update. |
description? | string | A meaningful description of the container fleet. |
game | string | The name of the fleet's game server container group definition, which describes how to deploy containers with your game server build and support software onto each fleet instance. |
game | number | The number of times to replicate the game server container group on each fleet instance. |
game | IResolvable | Game | A policy that limits the number of game sessions that each individual player can create on instances in this fleet. |
instance | IResolvable | Connection | The set of port numbers to open on each instance in a container fleet. |
instance | IResolvable | IResolvable | Ip [] | The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet. |
instance | string | The Amazon EC2 instance type to use for all instances in the fleet. |
locations? | IResolvable | IResolvable | Location [] | |
log | IResolvable | Log | The method that is used to collect container logs for the fleet. |
metric | string[] | The name of an AWS CloudWatch metric group to add this fleet to. |
new | string | Determines whether Amazon GameLift can shut down game sessions on the fleet that are actively running and hosting players. |
per | string | The name of the fleet's per-instance container group definition. |
scaling | IResolvable | IResolvable | Scaling [] | A list of rules that control how a fleet is scaled. |
tags? | Cfn [] | An array of key-value pairs to apply to this resource. |
static CFN_RESOURCE_TYPE_NAME | string | The CloudFormation resource type name for this resource class. |
attrCreationTime
Type:
string
A time stamp indicating when this data object was created.
Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"
).
attrDeploymentDetails
Type:
IResolvable
Provides information about the last deployment ID and its status.
attrFleetArn
Type:
string
The Amazon Resource Name ( ARN ) that is assigned to a Amazon GameLift fleet resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:<region>::fleet/fleet-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912
. In a GameLift fleet ARN, the resource ID matches the FleetId
value.
attrFleetId
Type:
string
A unique identifier for the container fleet to retrieve.
attrGameServerContainerGroupDefinitionArn
Type:
string
The Amazon Resource Name ( ARN ) that is assigned to the fleet's game server container group. The ARN value also identifies the specific container group definition version in use.
attrMaximumGameServerContainerGroupsPerInstance
Type:
number
The calculated maximum number of game server container group that can be deployed on each fleet instance.
The calculation depends on the resource needs of the container group and the CPU and memory resources of the fleet's instance type.
attrPerInstanceContainerGroupDefinitionArn
Type:
string
The Amazon Resource Name ( ARN ) that is assigned to the fleet's per-instance container group. The ARN value also identifies the specific container group definition version in use.
attrStatus
Type:
string
The current status of the container fleet.
PENDING
-- A new container fleet has been requested.CREATING
-- A new container fleet resource is being created.CREATED
-- A new container fleet resource has been created. No fleet instances have been deployed.ACTIVATING
-- New container fleet instances are being deployed.ACTIVE
-- The container fleet has been deployed and is ready to host game sessions.UPDATING
-- Updates to the container fleet is being updated. A deployment is in progress.
cdkTagManager
Type:
Tag
Tag Manager which manages the tags for this resource.
cfnOptions
Type:
ICfn
Options for this resource, such as condition, update policy etc.
cfnProperties
Type:
{ [string]: any }
cfnResourceType
Type:
string
AWS resource type.
creationStack
Type:
string[]
fleetRoleArn
Type:
string
The unique identifier for an AWS Identity and Access Management (IAM) role with permissions to run your containers on resources that are managed by Amazon GameLift.
logicalId
Type:
string
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use overrideLogicalId(newLogicalId)
.
node
Type:
Node
The tree node.
ref
Type:
string
Return a string that will be resolved to a CloudFormation { Ref }
for this element.
If, by any chance, the intrinsic reference of a resource is not a string, you could
coerce it to an IResolvable through Lazy.any({ produce: resource.ref })
.
stack
Type:
Stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
billingType?
Type:
string
(optional)
Indicates whether the fleet uses On-Demand or Spot instances for this fleet.
deploymentConfiguration?
Type:
IResolvable
|
Deployment
(optional)
Set of rules for processing a deployment for a container fleet update.
description?
Type:
string
(optional)
A meaningful description of the container fleet.
gameServerContainerGroupDefinitionName?
Type:
string
(optional)
The name of the fleet's game server container group definition, which describes how to deploy containers with your game server build and support software onto each fleet instance.
gameServerContainerGroupsPerInstance?
Type:
number
(optional)
The number of times to replicate the game server container group on each fleet instance.
gameSessionCreationLimitPolicy?
Type:
IResolvable
|
Game
(optional)
A policy that limits the number of game sessions that each individual player can create on instances in this fleet.
instanceConnectionPortRange?
Type:
IResolvable
|
Connection
(optional)
The set of port numbers to open on each instance in a container fleet.
instanceInboundPermissions?
Type:
IResolvable
|
IResolvable
|
Ip
[]
(optional)
The IP address ranges and port settings that allow inbound traffic to access game server processes and other processes on this fleet.
instanceType?
Type:
string
(optional)
The Amazon EC2 instance type to use for all instances in the fleet.
locations?
Type:
IResolvable
|
IResolvable
|
Location
[]
(optional)
logConfiguration?
Type:
IResolvable
|
Log
(optional)
The method that is used to collect container logs for the fleet.
metricGroups?
Type:
string[]
(optional)
The name of an AWS CloudWatch metric group to add this fleet to.
newGameSessionProtectionPolicy?
Type:
string
(optional)
Determines whether Amazon GameLift can shut down game sessions on the fleet that are actively running and hosting players.
perInstanceContainerGroupDefinitionName?
Type:
string
(optional)
The name of the fleet's per-instance container group definition.
scalingPolicies?
Type:
IResolvable
|
IResolvable
|
Scaling
[]
(optional)
A list of rules that control how a fleet is scaled.
tags?
Type:
Cfn
[]
(optional)
An array of key-value pairs to apply to this resource.
static CFN_RESOURCE_TYPE_NAME
Type:
string
The CloudFormation resource type name for this resource class.
Methods
Name | Description |
---|---|
add | Syntactic sugar for addOverride(path, undefined) . |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned. |
add | Add a value to the CloudFormation Resource Metadata. |
add | Adds an override to the synthesized CloudFormation resource. |
add | Adds an override that deletes the value of a property from the resource definition. |
add | Adds an override to a resource property. |
apply | Sets the deletion policy of the resource based on the removal policy specified. |
get | Returns a token for an runtime attribute of this resource. |
get | Retrieve a value value from the CloudFormation Resource Metadata. |
inspect(inspector) | Examines the CloudFormation resource and discloses attributes. |
obtain | Retrieves an array of resources this resource depends on. |
obtain | Get a shallow copy of dependencies between this resource and other resources in the same stack. |
override | Overrides the auto-generated logical ID with a specific ID. |
remove | Indicates that this resource no longer depends on another resource. |
replace | Replaces one dependency with another. |
to | Returns a string representation of this construct. |
protected render |
addDeletionOverride(path)
public addDeletionOverride(path: string): void
Parameters
- path
string
— The path of the value to delete.
Syntactic sugar for addOverride(path, undefined)
.
addDependency(target)
public addDependency(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
addDependsOn(target)
public addDependsOn(target: CfnResource): void
⚠️ Deprecated: use addDependency
Parameters
- target
Cfn
Resource
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
addMetadata(key, value)
public addMetadata(key: string, value: any): void
Parameters
- key
string
- value
any
Add a value to the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
addOverride(path, value)
public addOverride(path: string, value: any): void
Parameters
- path
string
— - The path of the property, you can use dot notation to override values in complex types. - value
any
— - The value.
Adds an override to the synthesized CloudFormation resource.
To add a
property override, either use addPropertyOverride
or prefix path
with
"Properties." (i.e. Properties.TopicName
).
If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal .
in the property name, prefix with a \
. In most
programming languages you will need to write this as "\\."
because the
\
itself will need to be escaped.
For example,
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes', ['myattribute']);
cfnResource.addOverride('Properties.GlobalSecondaryIndexes.1.ProjectionType', 'INCLUDE');
would add the overrides
"Properties": {
"GlobalSecondaryIndexes": [
{
"Projection": {
"NonKeyAttributes": [ "myattribute" ]
...
}
...
},
{
"ProjectionType": "INCLUDE"
...
},
]
...
}
The value
argument to addOverride
will not be processed or translated
in any way. Pass raw JSON values in here with the correct capitalization
for CloudFormation. If you pass CDK classes or structs, they will be
rendered with lowercased key names, and CloudFormation will reject the
template.
addPropertyDeletionOverride(propertyPath)
public addPropertyDeletionOverride(propertyPath: string): void
Parameters
- propertyPath
string
— The path to the property.
Adds an override that deletes the value of a property from the resource definition.
addPropertyOverride(propertyPath, value)
public addPropertyOverride(propertyPath: string, value: any): void
Parameters
- propertyPath
string
— The path of the property. - value
any
— The value.
Adds an override to a resource property.
Syntactic sugar for addOverride("Properties.<...>", value)
.
applyRemovalPolicy(policy?, options?)
public applyRemovalPolicy(policy?: RemovalPolicy, options?: RemovalPolicyOptions): void
Parameters
- policy
Removal
Policy - options
Removal
Policy Options
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you've removed it from the CDK application or because you've made a change that requires the resource to be replaced.
The resource can be deleted (RemovalPolicy.DESTROY
), or left in your AWS
account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some
cases, a snapshot can be taken of the resource prior to deletion
(RemovalPolicy.SNAPSHOT
). A list of resources that support this policy
can be found in the following link:
getAtt(attributeName, typeHint?)
public getAtt(attributeName: string, typeHint?: ResolutionTypeHint): Reference
Parameters
- attributeName
string
— The name of the attribute. - typeHint
Resolution
Type Hint
Returns
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g. resource.arn
), but this can be used for future compatibility
in case there is no generated attribute.
getMetadata(key)
public getMetadata(key: string): any
Parameters
- key
string
Returns
any
Retrieve a value value from the CloudFormation Resource Metadata.
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/metadata-section-structure.html
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.)
inspect(inspector)
public inspect(inspector: TreeInspector): void
Parameters
- inspector
Tree
— tree inspector to collect and process attributes.Inspector
Examines the CloudFormation resource and discloses attributes.
obtainDependencies()
public obtainDependencies(): Stack | CfnResource[]
Returns
Stack
|
Cfn
Resource []
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
obtainResourceDependencies()
public obtainResourceDependencies(): CfnResource[]
Returns
Get a shallow copy of dependencies between this resource and other resources in the same stack.
overrideLogicalId(newLogicalId)
public overrideLogicalId(newLogicalId: string): void
Parameters
- newLogicalId
string
— The new logical ID to use for this stack element.
Overrides the auto-generated logical ID with a specific ID.
removeDependency(target)
public removeDependency(target: CfnResource): void
Parameters
- target
Cfn
Resource
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
replaceDependency(target, newTarget)
public replaceDependency(target: CfnResource, newTarget: CfnResource): void
Parameters
- target
Cfn
— The dependency to replace.Resource - newTarget
Cfn
— The new dependency to add.Resource
Replaces one dependency with another.
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
protected renderProperties(props)
protected renderProperties(props: { [string]: any }): { [string]: any }
Parameters
- props
{ [string]: any }
Returns
{ [string]: any }