CfnFleet
- class aws_cdk.aws_gamelift.CfnFleet(scope, id, *, name, anywhere_configuration=None, build_id=None, certificate_configuration=None, compute_type=None, description=None, desired_ec2_instances=None, ec2_inbound_permissions=None, ec2_instance_type=None, fleet_type=None, instance_role_arn=None, locations=None, max_size=None, metric_groups=None, min_size=None, new_game_session_protection_policy=None, peer_vpc_aws_account_id=None, peer_vpc_id=None, resource_creation_limit_policy=None, runtime_configuration=None, script_id=None)
Bases:
CfnResource
A CloudFormation
AWS::GameLift::Fleet
.The
AWS::GameLift::Fleet
resource creates an Amazon GameLift (GameLift) fleet to host custom game server or Realtime Servers. A fleet is a set of EC2 instances, configured with instructions to run game servers on each instance.- CloudformationResource:
AWS::GameLift::Fleet
- Link:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-gamelift-fleet.html
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift cfn_fleet = gamelift.CfnFleet(self, "MyCfnFleet", name="name", # the properties below are optional anywhere_configuration=gamelift.CfnFleet.AnywhereConfigurationProperty( cost="cost" ), build_id="buildId", certificate_configuration=gamelift.CfnFleet.CertificateConfigurationProperty( certificate_type="certificateType" ), compute_type="computeType", description="description", desired_ec2_instances=123, ec2_inbound_permissions=[gamelift.CfnFleet.IpPermissionProperty( from_port=123, ip_range="ipRange", protocol="protocol", to_port=123 )], ec2_instance_type="ec2InstanceType", fleet_type="fleetType", instance_role_arn="instanceRoleArn", locations=[gamelift.CfnFleet.LocationConfigurationProperty( location="location", # the properties below are optional location_capacity=gamelift.CfnFleet.LocationCapacityProperty( desired_ec2_instances=123, max_size=123, min_size=123 ) )], max_size=123, metric_groups=["metricGroups"], min_size=123, new_game_session_protection_policy="newGameSessionProtectionPolicy", peer_vpc_aws_account_id="peerVpcAwsAccountId", peer_vpc_id="peerVpcId", resource_creation_limit_policy=gamelift.CfnFleet.ResourceCreationLimitPolicyProperty( new_game_sessions_per_creator=123, policy_period_in_minutes=123 ), runtime_configuration=gamelift.CfnFleet.RuntimeConfigurationProperty( game_session_activation_timeout_seconds=123, max_concurrent_game_session_activations=123, server_processes=[gamelift.CfnFleet.ServerProcessProperty( concurrent_executions=123, launch_path="launchPath", # the properties below are optional parameters="parameters" )] ), script_id="scriptId" )
Create a new
AWS::GameLift::Fleet
.- Parameters:
scope (
Construct
) –scope in which this resource is defined.
id (
str
) –scoped id of the resource.
name (
str
) – A descriptive label that is associated with a fleet. Fleet names do not need to be unique.anywhere_configuration (
Union
[IResolvable
,AnywhereConfigurationProperty
,Dict
[str
,Any
],None
]) –AWS::GameLift::Fleet.AnywhereConfiguration
.build_id (
Optional
[str
]) – A unique identifier for a build to be deployed on the new fleet. If you are deploying the fleet with a custom game build, you must specify this property. The build must have been successfully uploaded to Amazon GameLift and be in aREADY
status. This fleet setting cannot be changed once the fleet is created.certificate_configuration (
Union
[IResolvable
,CertificateConfigurationProperty
,Dict
[str
,Any
],None
]) – Prompts Amazon GameLift to generate a TLS/SSL certificate for the fleet. Amazon GameLift uses the certificates to encrypt traffic between game clients and the game servers running on Amazon GameLift. By default, theCertificateConfiguration
isDISABLED
. You can’t change this property after you create the fleet. AWS Certificate Manager (ACM) certificates expire after 13 months. Certificate expiration can cause fleets to fail, preventing players from connecting to instances in the fleet. We recommend you replace fleets before 13 months, consider using fleet aliases for a smooth transition. .. epigraph:: ACM isn’t available in all AWS regions. A fleet creation request with certificate generation enabled in an unsupported Region, fails with a 4xx error. For more information about the supported Regions, see Supported Regions in the AWS Certificate Manager User Guide .compute_type (
Optional
[str
]) – The type of compute resource used to host your game servers. You can use your own compute resources with Amazon GameLift Anywhere or use Amazon EC2 instances with managed Amazon GameLift.description (
Optional
[str
]) – A description for the fleet.desired_ec2_instances (
Union
[int
,float
,None
]) – The number of EC2 instances that you want this fleet to host. When creating a new fleet, GameLift automatically sets this value to “1” and initiates a single instance. Once the fleet is active, update this value to trigger GameLift to add or remove instances from the fleet.ec2_inbound_permissions (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,IpPermissionProperty
,Dict
[str
,Any
]]],None
]) – The allowed IP address ranges and port settings that allow inbound traffic to access game sessions on this fleet. If the fleet is hosting a custom game build, this property must be set before players can connect to game sessions. For Realtime Servers fleets, Amazon GameLift automatically sets TCP and UDP ranges.ec2_instance_type (
Optional
[str
]) – The Amazon GameLift-supported Amazon EC2 instance type to use for all fleet instances. Instance type determines the computing resources that will be used to host your game servers, including CPU, memory, storage, and networking capacity. See Amazon Elastic Compute Cloud Instance Types for detailed descriptions of Amazon EC2 instance types.fleet_type (
Optional
[str
]) – Indicates whether to use On-Demand or Spot instances for this fleet. By default, this property is set toON_DEMAND
. Learn more about when to use On-Demand versus Spot Instances . This property cannot be changed after the fleet is created.instance_role_arn (
Optional
[str
]) – A unique identifier for an IAM role that manages access to your AWS services. With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role’s ARN by using the IAM dashboard in the AWS Management Console . Learn more about using on-box credentials for your game servers at Access external resources from a game server . This property cannot be changed after the fleet is created.locations (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,LocationConfigurationProperty
,Dict
[str
,Any
]]],None
]) – A set of remote locations to deploy additional instances to and manage as part of the fleet. This parameter can only be used when creating fleets in AWS Regions that support multiple locations. You can add any Amazon GameLift-supported AWS Region as a remote location, in the form of an AWS Region code such asus-west-2
. To create a fleet with instances in the home Region only, don’t use this parameter. To use this parameter, Amazon GameLift requires you to use your home location in the request.max_size (
Union
[int
,float
,None
]) – The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 1.metric_groups (
Optional
[Sequence
[str
]]) – The name of an AWS CloudWatch metric group to add this fleet to. A metric group is used to aggregate the metrics for multiple fleets. You can specify an existing metric group name or set a new name to create a new metric group. A fleet can be included in only one metric group at a time.min_size (
Union
[int
,float
,None
]) – The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 0.new_game_session_protection_policy (
Optional
[str
]) – The status of termination protection for active game sessions on the fleet. By default, this property is set toNoProtection
. - NoProtection - Game sessions can be terminated during active gameplay as a result of a scale-down event. - FullProtection - Game sessions inACTIVE
status cannot be terminated during a scale-down event.peer_vpc_aws_account_id (
Optional
[str
]) – Used when peering your Amazon GameLift fleet with a VPC, the unique identifier for the AWS account that owns the VPC. You can find your account ID in the AWS Management Console under account settings.peer_vpc_id (
Optional
[str
]) – A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet. The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the AWS Management Console . Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets .resource_creation_limit_policy (
Union
[IResolvable
,ResourceCreationLimitPolicyProperty
,Dict
[str
,Any
],None
]) – A policy that limits the number of game sessions that an individual player can create on instances in this fleet within a specified span of time.runtime_configuration (
Union
[IResolvable
,RuntimeConfigurationProperty
,Dict
[str
,Any
],None
]) – Instructions for how to launch and maintain server processes on instances in the fleet. The runtime configuration defines one or more server process configurations, each identifying a build executable or Realtime script file and the number of processes of that type to run concurrently. .. epigraph:: TheRuntimeConfiguration
parameter is required unless the fleet is being configured using the older parametersServerLaunchPath
andServerLaunchParameters
, which are still supported for backward compatibility.script_id (
Optional
[str
]) – The unique identifier for a Realtime configuration script to be deployed on fleet instances. You can use either the script ID or ARN. Scripts must be uploaded to Amazon GameLift prior to creating the fleet. This fleet property cannot be changed later. .. epigraph:: You can’t use the!Ref
command to reference a script created with a CloudFormation template for the fleet propertyScriptId
. Instead, useFn::GetAtt Script.Arn
orFn::GetAtt Script.Id
to retrieve either of these properties as input forScriptId
. Alternatively, enter aScriptId
string manually.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_depends_on(target)
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.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
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.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
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:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
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.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermdediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
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
).- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resoure, please consult that specific resource’s documentation.
- Return type:
None
- get_att(attribute_name)
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.- Parameters:
attribute_name (
str
) – The name of the attribute.- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
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)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) –tree inspector to collect and process attributes.
- Return type:
None
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::GameLift::Fleet'
- anywhere_configuration
AWS::GameLift::Fleet.AnywhereConfiguration
.
- attr_fleet_id
A unique identifier for the fleet.
- CloudformationAttribute:
FleetId
- build_id
A unique identifier for a build to be deployed on the new fleet.
If you are deploying the fleet with a custom game build, you must specify this property. The build must have been successfully uploaded to Amazon GameLift and be in a
READY
status. This fleet setting cannot be changed once the fleet is created.
- certificate_configuration
Prompts Amazon GameLift to generate a TLS/SSL certificate for the fleet.
Amazon GameLift uses the certificates to encrypt traffic between game clients and the game servers running on Amazon GameLift. By default, the
CertificateConfiguration
isDISABLED
. You can’t change this property after you create the fleet.AWS Certificate Manager (ACM) certificates expire after 13 months. Certificate expiration can cause fleets to fail, preventing players from connecting to instances in the fleet. We recommend you replace fleets before 13 months, consider using fleet aliases for a smooth transition. .. epigraph:
ACM isn't available in all AWS regions. A fleet creation request with certificate generation enabled in an unsupported Region, fails with a 4xx error. For more information about the supported Regions, see `Supported Regions <https://docs.aws.amazon.com/acm/latest/userguide/acm-regions.html>`_ in the *AWS Certificate Manager User Guide* .
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- compute_type
The type of compute resource used to host your game servers.
You can use your own compute resources with Amazon GameLift Anywhere or use Amazon EC2 instances with managed Amazon GameLift.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- description
A description for the fleet.
- desired_ec2_instances
The number of EC2 instances that you want this fleet to host.
When creating a new fleet, GameLift automatically sets this value to “1” and initiates a single instance. Once the fleet is active, update this value to trigger GameLift to add or remove instances from the fleet.
- ec2_inbound_permissions
The allowed IP address ranges and port settings that allow inbound traffic to access game sessions on this fleet.
If the fleet is hosting a custom game build, this property must be set before players can connect to game sessions. For Realtime Servers fleets, Amazon GameLift automatically sets TCP and UDP ranges.
- ec2_instance_type
The Amazon GameLift-supported Amazon EC2 instance type to use for all fleet instances.
Instance type determines the computing resources that will be used to host your game servers, including CPU, memory, storage, and networking capacity. See Amazon Elastic Compute Cloud Instance Types for detailed descriptions of Amazon EC2 instance types.
- fleet_type
Indicates whether to use On-Demand or Spot instances for this fleet.
By default, this property is set to
ON_DEMAND
. Learn more about when to use On-Demand versus Spot Instances . This property cannot be changed after the fleet is created.
- instance_role_arn
A unique identifier for an IAM role that manages access to your AWS services.
With an instance role ARN set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes). Create a role or look up a role’s ARN by using the IAM dashboard in the AWS Management Console . Learn more about using on-box credentials for your game servers at Access external resources from a game server . This property cannot be changed after the fleet is created.
- locations
A set of remote locations to deploy additional instances to and manage as part of the fleet.
This parameter can only be used when creating fleets in AWS Regions that support multiple locations. You can add any Amazon GameLift-supported AWS Region as a remote location, in the form of an AWS Region code such as
us-west-2
. To create a fleet with instances in the home Region only, don’t use this parameter.To use this parameter, Amazon GameLift requires you to use your home location in the request.
- logical_id
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)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- max_size
The maximum number of instances that are allowed in the specified fleet location.
If this parameter is not set, the default is 1.
- metric_groups
The name of an AWS CloudWatch metric group to add this fleet to.
A metric group is used to aggregate the metrics for multiple fleets. You can specify an existing metric group name or set a new name to create a new metric group. A fleet can be included in only one metric group at a time.
- min_size
The minimum number of instances that are allowed in the specified fleet location.
If this parameter is not set, the default is 0.
- name
A descriptive label that is associated with a fleet.
Fleet names do not need to be unique.
- new_game_session_protection_policy
The status of termination protection for active game sessions on the fleet.
By default, this property is set to
NoProtection
.NoProtection - Game sessions can be terminated during active gameplay as a result of a scale-down event.
FullProtection - Game sessions in
ACTIVE
status cannot be terminated during a scale-down event.
- node
The construct tree node associated with this construct.
- peer_vpc_aws_account_id
Used when peering your Amazon GameLift fleet with a VPC, the unique identifier for the AWS account that owns the VPC.
You can find your account ID in the AWS Management Console under account settings.
- peer_vpc_id
A unique identifier for a VPC with resources to be accessed by your Amazon GameLift fleet.
The VPC must be in the same Region as your fleet. To look up a VPC ID, use the VPC Dashboard in the AWS Management Console . Learn more about VPC peering in VPC Peering with Amazon GameLift Fleets .
- ref
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 })
.
- resource_creation_limit_policy
A policy that limits the number of game sessions that an individual player can create on instances in this fleet within a specified span of time.
- runtime_configuration
Instructions for how to launch and maintain server processes on instances in the fleet.
The runtime configuration defines one or more server process configurations, each identifying a build executable or Realtime script file and the number of processes of that type to run concurrently. .. epigraph:
The ``RuntimeConfiguration`` parameter is required unless the fleet is being configured using the older parameters ``ServerLaunchPath`` and ``ServerLaunchParameters`` , which are still supported for backward compatibility.
- script_id
The unique identifier for a Realtime configuration script to be deployed on fleet instances.
You can use either the script ID or ARN. Scripts must be uploaded to Amazon GameLift prior to creating the fleet. This fleet property cannot be changed later. .. epigraph:
You can't use the ``!Ref`` command to reference a script created with a CloudFormation template for the fleet property ``ScriptId`` . Instead, use ``Fn::GetAtt Script.Arn`` or ``Fn::GetAtt Script.Id`` to retrieve either of these properties as input for ``ScriptId`` . Alternatively, enter a ``ScriptId`` string manually.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(construct)
Check whether the given construct is a CfnResource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_construct(x)
Return whether the given object is a Construct.
- Parameters:
x (
Any
) –- Return type:
bool
AnywhereConfigurationProperty
- class CfnFleet.AnywhereConfigurationProperty(*, cost)
Bases:
object
Amazon GameLift Anywhere configuration options for your Anywhere fleets.
- Parameters:
cost (
str
) – The cost to run your fleet per hour. Amazon GameLift uses the provided cost of your fleet to balance usage in queues. For more information about queues, see Setting up queues in the Amazon GameLift Developer Guide .- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift anywhere_configuration_property = gamelift.CfnFleet.AnywhereConfigurationProperty( cost="cost" )
Attributes
- cost
The cost to run your fleet per hour.
Amazon GameLift uses the provided cost of your fleet to balance usage in queues. For more information about queues, see Setting up queues in the Amazon GameLift Developer Guide .
CertificateConfigurationProperty
- class CfnFleet.CertificateConfigurationProperty(*, certificate_type)
Bases:
object
Determines whether a TLS/SSL certificate is generated for a fleet.
This feature must be enabled when creating the fleet. All instances in a fleet share the same certificate. The certificate can be retrieved by calling the GameLift Server SDK operation
GetInstanceCertificate
.- Parameters:
certificate_type (
str
) – Indicates whether a TLS/SSL certificate is generated for a fleet. Valid values include: - GENERATED - Generate a TLS/SSL certificate for this fleet. - DISABLED - (default) Do not generate a TLS/SSL certificate for this fleet.- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift certificate_configuration_property = gamelift.CfnFleet.CertificateConfigurationProperty( certificate_type="certificateType" )
Attributes
- certificate_type
Indicates whether a TLS/SSL certificate is generated for a fleet.
Valid values include:
GENERATED - Generate a TLS/SSL certificate for this fleet.
DISABLED - (default) Do not generate a TLS/SSL certificate for this fleet.
IpPermissionProperty
- class CfnFleet.IpPermissionProperty(*, from_port, ip_range, protocol, to_port)
Bases:
object
A range of IP addresses and port settings that allow inbound traffic to connect to server processes on an instance in a fleet.
New game sessions are assigned an IP address/port number combination, which must fall into the fleet’s allowed ranges. Fleets with custom game builds must have permissions explicitly set. For Realtime Servers fleets, GameLift automatically opens two port ranges, one for TCP messaging and one for UDP.
- Parameters:
from_port (
Union
[int
,float
]) – A starting value for a range of allowed port numbers. For fleets using Linux builds, only ports22
and1026-60000
are valid. For fleets using Windows builds, only ports1026-60000
are valid.ip_range (
str
) – A range of allowed IP addresses. This value must be expressed in CIDR notation. Example: ”000.000.000.000/[subnet mask]
” or optionally the shortened version ”0.0.0.0/[subnet mask]
“.protocol (
str
) – The network communication protocol used by the fleet.to_port (
Union
[int
,float
]) – An ending value for a range of allowed port numbers. Port numbers are end-inclusive. This value must be equal to or greater thanFromPort
. For fleets using Linux builds, only ports22
and1026-60000
are valid. For fleets using Windows builds, only ports1026-60000
are valid.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift ip_permission_property = gamelift.CfnFleet.IpPermissionProperty( from_port=123, ip_range="ipRange", protocol="protocol", to_port=123 )
Attributes
- from_port
A starting value for a range of allowed port numbers.
For fleets using Linux builds, only ports
22
and1026-60000
are valid.For fleets using Windows builds, only ports
1026-60000
are valid.
- ip_range
A range of allowed IP addresses.
This value must be expressed in CIDR notation. Example: ”
000.000.000.000/[subnet mask]
” or optionally the shortened version ”0.0.0.0/[subnet mask]
“.
- protocol
The network communication protocol used by the fleet.
- to_port
An ending value for a range of allowed port numbers.
Port numbers are end-inclusive. This value must be equal to or greater than
FromPort
.For fleets using Linux builds, only ports
22
and1026-60000
are valid.For fleets using Windows builds, only ports
1026-60000
are valid.
LocationCapacityProperty
- class CfnFleet.LocationCapacityProperty(*, desired_ec2_instances, max_size, min_size)
Bases:
object
Current resource capacity settings in a specified fleet or location.
The location value might refer to a fleet’s remote location or its home Region.
Related actions
DescribeFleetCapacity | DescribeFleetLocationCapacity | UpdateFleetCapacity
- Parameters:
desired_ec2_instances (
Union
[int
,float
]) – The number of Amazon EC2 instances you want to maintain in the specified fleet location. This value must fall between the minimum and maximum size limits.max_size (
Union
[int
,float
]) – The maximum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 1.min_size (
Union
[int
,float
]) – The minimum number of instances that are allowed in the specified fleet location. If this parameter is not set, the default is 0.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift location_capacity_property = gamelift.CfnFleet.LocationCapacityProperty( desired_ec2_instances=123, max_size=123, min_size=123 )
Attributes
- desired_ec2_instances
The number of Amazon EC2 instances you want to maintain in the specified fleet location.
This value must fall between the minimum and maximum size limits.
- max_size
The maximum number of instances that are allowed in the specified fleet location.
If this parameter is not set, the default is 1.
- min_size
The minimum number of instances that are allowed in the specified fleet location.
If this parameter is not set, the default is 0.
LocationConfigurationProperty
- class CfnFleet.LocationConfigurationProperty(*, location, location_capacity=None)
Bases:
object
A remote location where a multi-location fleet can deploy game servers for game hosting.
- Parameters:
location (
str
) – An AWS Region code, such asus-west-2
.location_capacity (
Union
[IResolvable
,LocationCapacityProperty
,Dict
[str
,Any
],None
]) –Current resource capacity settings in a specified fleet or location. The location value might refer to a fleet’s remote location or its home Region. Related actions DescribeFleetCapacity | DescribeFleetLocationCapacity | UpdateFleetCapacity
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift location_configuration_property = gamelift.CfnFleet.LocationConfigurationProperty( location="location", # the properties below are optional location_capacity=gamelift.CfnFleet.LocationCapacityProperty( desired_ec2_instances=123, max_size=123, min_size=123 ) )
Attributes
- location
An AWS Region code, such as
us-west-2
.
- location_capacity
Current resource capacity settings in a specified fleet or location.
The location value might refer to a fleet’s remote location or its home Region.
Related actions
DescribeFleetCapacity | DescribeFleetLocationCapacity | UpdateFleetCapacity
ResourceCreationLimitPolicyProperty
- class CfnFleet.ResourceCreationLimitPolicyProperty(*, new_game_sessions_per_creator=None, policy_period_in_minutes=None)
Bases:
object
A policy that limits the number of game sessions a player can create on the same fleet.
This optional policy gives game owners control over how players can consume available game server resources. A resource creation policy makes the following statement: “An individual player can create a maximum number of new game sessions within a specified time period”.
The policy is evaluated when a player tries to create a new game session. For example, assume you have a policy of 10 new game sessions and a time period of 60 minutes. On receiving a
CreateGameSession
request, Amazon GameLift checks that the player (identified byCreatorId
) has created fewer than 10 game sessions in the past 60 minutes.- Parameters:
new_game_sessions_per_creator (
Union
[int
,float
,None
]) – A policy that puts limits on the number of game sessions that a player can create within a specified span of time. With this policy, you can control players’ ability to consume available resources. The policy is evaluated when a player tries to create a new game session. On receiving aCreateGameSession
request, Amazon GameLift checks that the player (identified byCreatorId
) has created fewer than game session limit in the specified time period.policy_period_in_minutes (
Union
[int
,float
,None
]) – The time span used in evaluating the resource creation limit policy.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift resource_creation_limit_policy_property = gamelift.CfnFleet.ResourceCreationLimitPolicyProperty( new_game_sessions_per_creator=123, policy_period_in_minutes=123 )
Attributes
- new_game_sessions_per_creator
A policy that puts limits on the number of game sessions that a player can create within a specified span of time.
With this policy, you can control players’ ability to consume available resources.
The policy is evaluated when a player tries to create a new game session. On receiving a
CreateGameSession
request, Amazon GameLift checks that the player (identified byCreatorId
) has created fewer than game session limit in the specified time period.
- policy_period_in_minutes
The time span used in evaluating the resource creation limit policy.
RuntimeConfigurationProperty
- class CfnFleet.RuntimeConfigurationProperty(*, game_session_activation_timeout_seconds=None, max_concurrent_game_session_activations=None, server_processes=None)
Bases:
object
A collection of server process configurations that describe the set of processes to run on each instance in a fleet.
Server processes run either an executable in a custom game build or a Realtime Servers script. GameLift launches the configured processes, manages their life cycle, and replaces them as needed. Each instance checks regularly for an updated runtime configuration.
A GameLift instance is limited to 50 processes running concurrently. To calculate the total number of processes in a runtime configuration, add the values of the
ConcurrentExecutions
parameter for each ServerProcess. Learn more about Running Multiple Processes on a Fleet .- Parameters:
game_session_activation_timeout_seconds (
Union
[int
,float
,None
]) – The maximum amount of time (in seconds) allowed to launch a new game session and have it report ready to host players. During this time, the game session is in statusACTIVATING
. If the game session does not become active before the timeout, it is ended and the game session status is changed toTERMINATED
.max_concurrent_game_session_activations (
Union
[int
,float
,None
]) – The number of game sessions in statusACTIVATING
to allow on an instance. This setting limits the instance resources that can be used for new game activations at any one time.server_processes (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,ServerProcessProperty
,Dict
[str
,Any
]]],None
]) – A collection of server process configurations that identify what server processes to run on each instance in a fleet.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift runtime_configuration_property = gamelift.CfnFleet.RuntimeConfigurationProperty( game_session_activation_timeout_seconds=123, max_concurrent_game_session_activations=123, server_processes=[gamelift.CfnFleet.ServerProcessProperty( concurrent_executions=123, launch_path="launchPath", # the properties below are optional parameters="parameters" )] )
Attributes
- game_session_activation_timeout_seconds
The maximum amount of time (in seconds) allowed to launch a new game session and have it report ready to host players.
During this time, the game session is in status
ACTIVATING
. If the game session does not become active before the timeout, it is ended and the game session status is changed toTERMINATED
.
- max_concurrent_game_session_activations
The number of game sessions in status
ACTIVATING
to allow on an instance.This setting limits the instance resources that can be used for new game activations at any one time.
- server_processes
A collection of server process configurations that identify what server processes to run on each instance in a fleet.
ServerProcessProperty
- class CfnFleet.ServerProcessProperty(*, concurrent_executions, launch_path, parameters=None)
Bases:
object
A set of instructions for launching server processes on each instance in a fleet.
Server processes run either an executable in a custom game build or a Realtime Servers script.
- Parameters:
concurrent_executions (
Union
[int
,float
]) – The number of server processes using this configuration that run concurrently on each instance.launch_path (
str
) – The location of a game build executable or the Realtime script file that contains theInit()
function. Game builds and Realtime scripts are installed on instances at the root: - Windows (custom game builds only):C:\game
. Example: ”C:\game\MyGame\server.exe
” - Linux:/local/game
. Examples: ”/local/game/MyGame/server.exe
” or ”/local/game/MyRealtimeScript.js
“parameters (
Optional
[str
]) – An optional list of parameters to pass to the server executable or Realtime script on launch.
- Link:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. import aws_cdk.aws_gamelift as gamelift server_process_property = gamelift.CfnFleet.ServerProcessProperty( concurrent_executions=123, launch_path="launchPath", # the properties below are optional parameters="parameters" )
Attributes
- concurrent_executions
The number of server processes using this configuration that run concurrently on each instance.
- launch_path
The location of a game build executable or the Realtime script file that contains the
Init()
function.Game builds and Realtime scripts are installed on instances at the root:
Windows (custom game builds only):
C:\game
. Example: ”C:\game\MyGame\server.exe
“Linux:
/local/game
. Examples: ”/local/game/MyGame/server.exe
” or ”/local/game/MyRealtimeScript.js
“
- parameters
An optional list of parameters to pass to the server executable or Realtime script on launch.