awscdkgameliftalpha

package module
v2.53.0-alpha.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 29, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

README

Amazon GameLift Construct Library

---

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


Amazon GameLift is a service used to deploy, operate, and scale dedicated, low-cost servers in the cloud for session-based multiplayer games. Built on AWS global computing infrastructure, GameLift helps deliver high-performance, high-reliability game servers while dynamically scaling your resource usage to meet worldwide player demand.

GameLift is composed of three main components:

  • GameLift FlexMatch which is a customizable matchmaking service for multiplayer games. With FlexMatch, you can build a custom set of rules that defines what a multiplayer match looks like for your game, and determines how to evaluate and select compatible players for each match. You can also customize key aspects of the matchmaking process to fit your game, including fine-tuning the matching algorithm.
  • GameLift hosting for custom or realtime servers which helps you deploy, operate, and scale dedicated game servers. It regulates the resources needed to host games, finds available game servers to host new game sessions, and puts players into games.
  • GameLift FleetIQ to optimize the use of low-cost Amazon Elastic Compute Cloud (Amazon EC2) Spot Instances for cloud-based game hosting. With GameLift FleetIQ, you can work directly with your hosting resources in Amazon EC2 and Amazon EC2 Auto Scaling while taking advantage of GameLift optimizations to deliver inexpensive, resilient game hosting for your players

This module is part of the AWS Cloud Development Kit project. It allows you to define components for your matchmaking configuration or game server fleet management system.

GameLift Hosting

Uploading builds and scripts to GameLift

Before deploying your GameLift-enabled multiplayer game servers for hosting with the GameLift service, you need to upload your game server files. This section provides guidance on preparing and uploading custom game server build files or Realtime Servers server script files. When you upload files, you create a GameLift build or script resource, which you then deploy on fleets of hosting resources.

To troubleshoot fleet activation problems related to the server script, see Debug GameLift fleet issues.

Upload a custom server build to GameLift

Before uploading your configured game server to GameLift for hosting, package the game build files into a build directory. This directory must include all components required to run your game servers and host game sessions, including the following:

  • Game server binaries – The binary files required to run the game server. A build can include binaries for multiple game servers built to run on the same platform. For a list of supported platforms, see Download Amazon GameLift SDKs.
  • Dependencies – Any dependent files that your game server executables require to run. Examples include assets, configuration files, and dependent libraries.
  • Install script – A script file to handle tasks that are required to fully install your game build on GameLift hosting servers. Place this file at the root of the build directory. GameLift runs the install script as part of fleet creation.

You can set up any application in your build, including your install script, to access your resources securely on other AWS services.

var bucket bucket

gamelift.NewBuild(this, jsii.String("Build"), &buildProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})
Upload a realtime server Script

Your server script can include one or more files combined into a single .zip file for uploading. The .zip file must contain all files that your script needs to run.

You can store your zipped script files in either a local file directory or in an Amazon Simple Storage Service (Amazon S3) bucket or defines a directory asset which is archived as a .zip file and uploaded to S3 during deployment.

After you create the script resource, GameLift deploys the script with a new Realtime Servers fleet. GameLift installs your server script onto each instance in the fleet, placing the script files in /local/game.

var bucket bucket

gamelift.NewScript(this, jsii.String("Script"), &scriptProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})
Defining a GameLift Fleet
Creating a custom game server fleet

Your uploaded game servers are hosted on GameLift virtual computing resources, called instances. You set up your hosting resources by creating a fleet of instances and deploying them to run your game servers. You can design a fleet to fit your game's needs.

gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: gamelift.build.fromAsset(this, jsii.String("Build"), path.join(__dirname, jsii.String("CustomerGameServer"))),
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("test-launch-path"),
			},
		},
	},
})
Managing game servers launch configuration

GameLift uses a fleet's runtime configuration to determine the type and number of processes to run on each instance in the fleet. At a minimum, a runtime configuration contains one server process configuration that represents one game server executable. You can also define additional server process configurations to run other types of processes related to your game. Each server process configuration contains the following information:

  • The file name and path of an executable in your game build.
  • Optionally Parameters to pass to the process on launch.
  • The number of processes to run concurrently.

A GameLift instance is limited to 50 processes running concurrently.

var build build

// Server processes can be delcared in a declarative way through the constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
				parameters: jsii.String("-logFile /local/game/logs/myserver1935.log -port 1935"),
				concurrentExecutions: jsii.Number(100),
			},
		},
	},
})

See Managing how game servers are launched for hosting in the Amazon GameLift Developer Guide.

Defining an instance type

GameLift uses Amazon Elastic Compute Cloud (Amazon EC2) resources, called instances, to deploy your game servers and host game sessions for your players. When setting up a new fleet, you decide what type of instances your game needs and how to run game server processes on them (using a runtime configuration). All instances in a fleet use the same type of resources and the same runtime configuration. You can edit a fleet's runtime configuration and other fleet properties, but the type of resources cannot be changed.

var build build

gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
})
Using Spot instances

When setting up your hosting resources, you have the option of using Spot Instances, On-Demand Instances, or a combination.

By default, fleet are using on demand capacity.

var build build

gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	useSpot: jsii.Boolean(true),
})
Allowing Ingress traffic

The allowed IP address ranges and port settings that allow inbound traffic to access game sessions on this 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.

var build build


fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	ingressRules: []ingressRule{
		&ingressRule{
			source: gamelift.peer.anyIpv4(),
			port: gamelift.port.tcpRange(jsii.Number(100), jsii.Number(200)),
		},
	},
})
// Allowing a specific CIDR for port 1111 on UDP Protocol
fleet.addIngressRule(gamelift.peer.ipv4(jsii.String("1.2.3.4/32")), gamelift.port.udp(jsii.Number(1111)))
Managing locations

A single Amazon GameLift fleet has a home Region by default (the Region you deploy it to), but it can deploy resources to any number of GameLift supported Regions. Select Regions based on where your players are located and your latency needs.

By default, home region is used as default location but we can add new locations if needed and define desired capacity

var build build


// Locations can be added directly through constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	locations: []location{
		&location{
			region: jsii.String("eu-west-1"),
			capacity: &locationCapacity{
				desiredCapacity: jsii.Number(5),
				minSize: jsii.Number(2),
				maxSize: jsii.Number(10),
			},
		},
		&location{
			region: jsii.String("us-east-1"),
			capacity: &locationCapacity{
				desiredCapacity: jsii.Number(5),
				minSize: jsii.Number(2),
				maxSize: jsii.Number(10),
			},
		},
	},
})

// Or through dedicated methods
fleet.addLocation(jsii.String("ap-southeast-1"), jsii.Number(5), jsii.Number(2), jsii.Number(10))
Specifying an IAM role for a Fleet

Some GameLift features require you to extend limited access to your AWS resources. This is done by creating an AWS IAM role. The GameLift Fleet class automatically created an IAM role with all the minimum necessary permissions for GameLift to access your ressources. If you wish, you may specify your own IAM role.

var build build

role := iam.NewRole(this, jsii.String("Role"), &roleProps{
	assumedBy: iam.NewCompositePrincipal(iam.NewServicePrincipal(jsii.String("gamelift.amazonaws.com"))),
})
role.addManagedPolicy(iam.managedPolicy.fromAwsManagedPolicyName(jsii.String("CloudWatchAgentServerPolicy")))

fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	role: role,
})

// Actions can also be grantted through dedicated method
fleet.grant(role, jsii.String("gamelift:ListFleets"))
Monitoring your Fleet

GameLift is integrated with CloudWatch, so you can monitor the performance of your game servers via logs and metrics.

Metrics

GameLift Fleet sends metrics to CloudWatch so that you can collect and analyze the activity of your Fleet, including game and player sessions and server processes.

You can then use CloudWatch alarms to alert you, for example, when matches has been rejected (potential matches that were rejected by at least one player since the last report) exceed a certain thresold which could means that you may have an issue in your matchmaking rules.

CDK provides methods for accessing GameLift Fleet metrics with default configuration, such as metricActiveInstances, or metricIdleInstances (see IFleet for a full list). CDK also provides a generic metric method that can be used to produce metric configurations for any metric provided by GameLift Fleet, Game sessions or server processes; the configurations are pre-populated with the correct dimensions for the matchmaking configuration.

var fleet buildFleet

// Alarm that triggers when the per-second average of not used instances exceed 10%
instancesUsedRatio := cloudwatch.NewMathExpression(&mathExpressionProps{
	expression: jsii.String("1 - (activeInstances / idleInstances)"),
	usingMetrics: map[string]iMetric{
		"activeInstances": fleet.metric(jsii.String("ActiveInstances"), &MetricOptions{
			"statistic": cloudwatch.Statistic_SUM,
		}),
		"idleInstances": fleet.metricIdleInstances(),
	},
})
cloudwatch.NewAlarm(this, jsii.String("Alarm"), &alarmProps{
	metric: instancesUsedRatio,
	threshold: jsii.Number(0.1),
	evaluationPeriods: jsii.Number(3),
})

See: Monitoring Using CloudWatch Metrics in the Amazon GameLift Developer Guide.

GameLift FleetIQ

The GameLift FleetIQ solution is a game hosting layer that supplements the full set of computing resource management tools that you get with Amazon EC2 and Auto Scaling. This solution lets you directly manage your Amazon EC2 and Auto Scaling resources and integrate as needed with other AWS services.

Defining a Game Server Group

When using GameLift FleetIQ, you prepare to launch Amazon EC2 instances as usual: make an Amazon Machine Image (AMI) with your game server software, create an Amazon EC2 launch template, and define configuration settings for an Auto Scaling group. However, instead of creating an Auto Scaling group directly, you create a GameLift FleetIQ game server group with your Amazon EC2 and Auto Scaling resources and configuration. All game server groups must have at least two instance types defined for it.

Once a game server group and Auto Scaling group are up and running with instances deployed, when updating a Game Server Group instance, only certain properties in the Auto Scaling group may be overwrite. For all other Auto Scaling group properties, such as MinSize, MaxSize, and LaunchTemplate, you can modify these directly on the Auto Scaling group using the AWS Console or dedicated Api.

var launchTemplate iLaunchTemplate
var vpc iVpc


gamelift.NewGameServerGroup(this, jsii.String("Game server group"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
})

See Manage game server groups in the Amazon GameLift FleetIQ Developer Guide.

Scaling Policy

The scaling policy uses the metric PercentUtilizedGameServers to maintain a buffer of idle game servers that can immediately accommodate new games and players.

var launchTemplate iLaunchTemplate
var vpc iVpc


gamelift.NewGameServerGroup(this, jsii.String("Game server group"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
	autoScalingPolicy: &autoScalingPolicy{
		estimatedInstanceWarmup: awscdk.Duration.minutes(jsii.Number(5)),
		targetTrackingConfiguration: jsii.Number(5),
	},
})

See Manage game server groups in the Amazon GameLift FleetIQ Developer Guide.

Specifying an IAM role for GameLift

The GameLift FleetIQ class automatically creates an IAM role with all the minimum necessary permissions for GameLift to access your Amazon EC2 Auto Scaling groups. If you wish, you may specify your own IAM role. It must have the correct permissions, or FleetIQ creation or ressource usage may fail.

var launchTemplate iLaunchTemplate
var vpc iVpc


role := iam.NewRole(this, jsii.String("Role"), &roleProps{
	assumedBy: iam.NewCompositePrincipal(iam.NewServicePrincipal(jsii.String("gamelift.amazonaws.com")),
	iam.NewServicePrincipal(jsii.String("autoscaling.amazonaws.com"))),
})
role.addManagedPolicy(iam.managedPolicy.fromAwsManagedPolicyName(jsii.String("GameLiftGameServerGroupPolicy")))

gamelift.NewGameServerGroup(this, jsii.String("Game server group"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
	role: role,
})

See Controlling Access in the Amazon GameLift FleetIQ Developer Guide.

Specifying VPC Subnets

GameLift FleetIQ use by default, all supported GameLift FleetIQ Availability Zones in your chosen region. You can override this parameter to specify VPCs subnets that you've set up.

This property cannot be updated after the game server group is created, and the corresponding Auto Scaling group will always use the property value that is set with this request, even if the Auto Scaling group is updated directly.

var launchTemplate iLaunchTemplate
var vpc iVpc


gamelift.NewGameServerGroup(this, jsii.String("GameServerGroup"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
	vpcSubnets: &subnetSelection{
		subnetType: ec2.subnetType_PUBLIC,
	},
})
Monitoring

GameLift FleetIQ sends metrics to CloudWatch so that you can collect and analyze the activity of your Game server fleet, including the number of utilized game servers, and the number of game server interruption due to limited Spot availability.

You can then use CloudWatch alarms to alert you, for example, when the portion of game servers that are currently supporting game executions exceed a certain thresold which could means that your autoscaling policy need to be adjust to add more instances to match with player demand.

CDK provides a generic metric method that can be used to produce metric configurations for any metric provided by GameLift FleetIQ; the configurations are pre-populated with the correct dimensions for the matchmaking configuration.

var gameServerGroup iGameServerGroup

// Alarm that triggers when the percent of utilized game servers exceed 90%
// Alarm that triggers when the percent of utilized game servers exceed 90%
cloudwatch.NewAlarm(this, jsii.String("Alarm"), &alarmProps{
	metric: gameServerGroup.metric(jsii.String("UtilizedGameServers")),
	threshold: jsii.Number(0.9),
	evaluationPeriods: jsii.Number(2),
})

See: Monitoring with CloudWatch in the Amazon GameLift FleetIQ Developer Guide.

Documentation

Overview

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

The CDK Construct Library for AWS::GameLift

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildBase_IsConstruct

func BuildBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func BuildBase_IsOwnedResource

func BuildBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func BuildBase_IsResource

func BuildBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func BuildFleet_IsConstruct

func BuildFleet_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func BuildFleet_IsOwnedResource

func BuildFleet_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func BuildFleet_IsResource

func BuildFleet_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Build_IsConstruct

func Build_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func Build_IsOwnedResource

func Build_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func Build_IsResource

func Build_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func FleetBase_IsConstruct

func FleetBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func FleetBase_IsOwnedResource

func FleetBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func FleetBase_IsResource

func FleetBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func GameServerGroupBase_IsConstruct

func GameServerGroupBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func GameServerGroupBase_IsOwnedResource

func GameServerGroupBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func GameServerGroupBase_IsResource

func GameServerGroupBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func GameServerGroup_IsConstruct

func GameServerGroup_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func GameServerGroup_IsOwnedResource

func GameServerGroup_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func GameServerGroup_IsResource

func GameServerGroup_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func NewAssetContent_Override

func NewAssetContent_Override(a AssetContent, path *string, options *awss3assets.AssetOptions)

Experimental.

func NewBuildBase_Override

func NewBuildBase_Override(b BuildBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewBuildFleet_Override

func NewBuildFleet_Override(b BuildFleet, scope constructs.Construct, id *string, props *BuildFleetProps)

Experimental.

func NewBuild_Override

func NewBuild_Override(b Build, scope constructs.Construct, id *string, props *BuildProps)

Experimental.

func NewContent_Override

func NewContent_Override(c Content)

Experimental.

func NewFleetBase_Override

func NewFleetBase_Override(f FleetBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewGameServerGroupBase_Override

func NewGameServerGroupBase_Override(g GameServerGroupBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewGameServerGroup_Override

func NewGameServerGroup_Override(g GameServerGroup, scope constructs.Construct, id *string, props *GameServerGroupProps)

Experimental.

func NewPeer_Override

func NewPeer_Override(p Peer)

Experimental.

func NewPort_Override

func NewPort_Override(p Port, props *PortProps)

Experimental.

func NewS3Content_Override

func NewS3Content_Override(s S3Content, bucket awss3.IBucket, key *string, objectVersion *string)

Experimental.

func NewScriptBase_Override

func NewScriptBase_Override(s ScriptBase, scope constructs.Construct, id *string, props *awscdk.ResourceProps)

Experimental.

func NewScript_Override

func NewScript_Override(s Script, scope constructs.Construct, id *string, props *ScriptProps)

Experimental.

func ScriptBase_IsConstruct

func ScriptBase_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func ScriptBase_IsOwnedResource

func ScriptBase_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func ScriptBase_IsResource

func ScriptBase_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

func Script_IsConstruct

func Script_IsConstruct(x interface{}) *bool

Checks if `x` is a construct.

Use this method instead of `instanceof` to properly detect `Construct` instances, even when the construct library is symlinked.

Explanation: in JavaScript, multiple copies of the `constructs` library on disk are seen as independent, completely different libraries. As a consequence, the class `Construct` in each copy of the `constructs` library is seen as a different class, and an instance of one class will not test as `instanceof` the other class. `npm install` will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of the `constructs` library can be accidentally installed, and `instanceof` will behave unpredictably. It is safest to avoid using `instanceof`, and using this type-testing method instead.

Returns: true if `x` is an object created from a class which extends `Construct`. Experimental.

func Script_IsOwnedResource

func Script_IsOwnedResource(construct constructs.IConstruct) *bool

Returns true if the construct was created by CDK, and false otherwise. Experimental.

func Script_IsResource

func Script_IsResource(construct constructs.IConstruct) *bool

Check whether the given construct is a Resource. Experimental.

Types

type AssetContent

type AssetContent interface {
	Content
	// The path to the asset file or directory.
	// Experimental.
	Path() *string
	// Called when the Build is initialized to allow this object to bind.
	// Experimental.
	Bind(scope constructs.Construct, role awsiam.IRole) *ContentConfig
}

Game content from a local directory.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var dockerImage dockerImage
var grantable iGrantable
var localBundling iLocalBundling

assetContent := gamelift_alpha.NewAssetContent(jsii.String("path"), &assetOptions{
	assetHash: jsii.String("assetHash"),
	assetHashType: cdk.assetHashType_SOURCE,
	bundling: &bundlingOptions{
		image: dockerImage,

		// the properties below are optional
		command: []*string{
			jsii.String("command"),
		},
		entrypoint: []*string{
			jsii.String("entrypoint"),
		},
		environment: map[string]*string{
			"environmentKey": jsii.String("environment"),
		},
		local: localBundling,
		network: jsii.String("network"),
		outputType: cdk.bundlingOutput_ARCHIVED,
		securityOpt: jsii.String("securityOpt"),
		user: jsii.String("user"),
		volumes: []dockerVolume{
			&dockerVolume{
				containerPath: jsii.String("containerPath"),
				hostPath: jsii.String("hostPath"),

				// the properties below are optional
				consistency: cdk.dockerVolumeConsistency_CONSISTENT,
			},
		},
		workingDirectory: jsii.String("workingDirectory"),
	},
	exclude: []*string{
		jsii.String("exclude"),
	},
	followSymlinks: cdk.symlinkFollowMode_NEVER,
	ignoreMode: cdk.ignoreMode_GLOB,
	readers: []*iGrantable{
		grantable,
	},
})

Experimental.

func AssetContent_FromAsset

func AssetContent_FromAsset(path *string, options *awss3assets.AssetOptions) AssetContent

Loads the game content from a local disk path. Experimental.

func Content_FromAsset

func Content_FromAsset(path *string, options *awss3assets.AssetOptions) AssetContent

Loads the game content from a local disk path. Experimental.

func NewAssetContent

func NewAssetContent(path *string, options *awss3assets.AssetOptions) AssetContent

Experimental.

func S3Content_FromAsset

func S3Content_FromAsset(path *string, options *awss3assets.AssetOptions) AssetContent

Loads the game content from a local disk path. Experimental.

type AutoScalingPolicy

type AutoScalingPolicy struct {
	// Settings for a target-based scaling policy applied to Auto Scaling group.
	//
	// These settings are used to create a target-based policy that tracks the GameLift FleetIQ metric `PercentUtilizedGameServers` and specifies a target value for the metric.
	//
	// As player usage changes, the policy triggers to adjust the game server group capacity so that the metric returns to the target value.
	// Experimental.
	TargetTrackingConfiguration *float64 `field:"required" json:"targetTrackingConfiguration" yaml:"targetTrackingConfiguration"`
	// Length of time, it takes for a new instance to start new game server processes and register with GameLift FleetIQ.
	//
	// Specifying a warm-up time can be useful, particularly with game servers that take a long time to start up, because it avoids prematurely starting new instances.
	// Experimental.
	EstimatedInstanceWarmup awscdk.Duration `field:"optional" json:"estimatedInstanceWarmup" yaml:"estimatedInstanceWarmup"`
}

Configuration settings for intelligent automatic scaling that uses target tracking.

After the Auto Scaling group is created, all updates to Auto Scaling policies, including changing this policy and adding or removing other policies, is done directly on the Auto Scaling group.

Example:

var launchTemplate iLaunchTemplate
var vpc iVpc

gamelift.NewGameServerGroup(this, jsii.String("Game server group"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
	autoScalingPolicy: &autoScalingPolicy{
		estimatedInstanceWarmup: awscdk.Duration.minutes(jsii.Number(5)),
		targetTrackingConfiguration: jsii.Number(5),
	},
})

Experimental.

type BalancingStrategy

type BalancingStrategy string

Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group. Experimental.

const (
	// Only Spot Instances are used in the game server group.
	//
	// If Spot Instances are unavailable or not viable for game hosting, the game server group provides no hosting capacity until Spot Instances can again be used.
	// Until then, no new instances are started, and the existing nonviable Spot Instances are terminated (after current gameplay ends) and are not replaced.
	// Experimental.
	BalancingStrategy_SPOT_ONLY BalancingStrategy = "SPOT_ONLY"
	// Spot Instances are used whenever available in the game server group.
	//
	// If Spot Instances are unavailable, the game server group continues to provide hosting capacity by falling back to On-Demand Instances.
	// Existing nonviable Spot Instances are terminated (after current gameplay ends) and are replaced with new On-Demand Instances.
	// Experimental.
	BalancingStrategy_SPOT_PREFERRED BalancingStrategy = "SPOT_PREFERRED"
	// Only On-Demand Instances are used in the game server group.
	//
	// No Spot Instances are used, even when available, while this balancing strategy is in force.
	// Experimental.
	BalancingStrategy_ON_DEMAND_ONLY BalancingStrategy = "ON_DEMAND_ONLY"
)

type Build

type Build interface {
	BuildBase
	// The Identifier of the build.
	// Experimental.
	BuildId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The principal this GameLift Build is using.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The IAM role GameLift assumes to acccess server build content.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

A GameLift build, that is installed and runs on instances in an Amazon GameLift fleet.

It consists of a zip file with all of the components of the game server build.

Example:

var bucket bucket

gamelift.NewBuild(this, jsii.String("Build"), &buildProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})

See: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html

Experimental.

func Build_FromAsset

func Build_FromAsset(scope constructs.Construct, id *string, path *string, options *awss3assets.AssetOptions) Build

Create a new Build from asset content. Experimental.

func Build_FromBucket

func Build_FromBucket(scope constructs.Construct, id *string, bucket awss3.IBucket, key *string, objectVersion *string) Build

Create a new Build from s3 content. Experimental.

func NewBuild

func NewBuild(scope constructs.Construct, id *string, props *BuildProps) Build

Experimental.

type BuildAttributes

type BuildAttributes struct {
	// The identifier of the build.
	// Experimental.
	BuildId *string `field:"required" json:"buildId" yaml:"buildId"`
	// The IAM role assumed by GameLift to access server build in S3.
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Represents a Build content defined outside of this stack.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var role role

buildAttributes := &buildAttributes{
	buildId: jsii.String("buildId"),

	// the properties below are optional
	role: role,
}

Experimental.

type BuildBase

type BuildBase interface {
	awscdk.Resource
	IBuild
	// The Identifier of the build.
	// Experimental.
	BuildId() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The principal to grant permissions to.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Base class for new and imported GameLift server build. Experimental.

type BuildFleet

type BuildFleet interface {
	FleetBase
	IBuildFleet
	// The build content of the fleet.
	// Experimental.
	Content() IBuild
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the fleet.
	// Experimental.
	FleetArn() *string
	// The Identifier of the fleet.
	// Experimental.
	FleetId() *string
	// The principal this GameLift fleet is using.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The IAM role GameLift assumes by fleet instances to access AWS ressources.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Adds an ingress rule to allow inbound traffic to access game sessions on this fleet.
	// Experimental.
	AddIngressRule(source IPeer, port Port)
	// Adds a remote locations to deploy additional instances to and manage as part of the fleet.
	// Experimental.
	AddInternalLocation(location *Location)
	// Adds a remote locations to deploy additional instances to and manage as part of the fleet.
	// Experimental.
	AddLocation(region *string, desiredCapacity *float64, minSize *float64, maxSize *float64)
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the `grantee` identity permissions to perform `actions`.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Return the given named metric for this fleet.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Instances with `ACTIVE` status, which means they are running active server processes.
	//
	// The count includes idle instances and those that are hosting one or more game sessions.
	// This metric measures current total instance capacity.
	//
	// This metric can be used with automatic scaling.
	// Experimental.
	MetricActiveInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Target number of active instances that GameLift is working to maintain in the fleet.
	//
	// With automatic scaling, this value is determined based on the scaling policies currently in force.
	// Without automatic scaling, this value is set manually.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricDesiredInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Active instances that are currently hosting zero (0) game sessions.
	//
	// This metric measures capacity that is available but unused.
	// This metric can be used with automatic scaling.
	// Experimental.
	MetricIdleInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Number of spot instances that have been interrupted.
	// Experimental.
	MetricInstanceInterruptions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Maximum number of instances that are allowed for the fleet.
	//
	// A fleet's instance maximum determines the capacity ceiling during manual or automatic scaling up.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricMaxInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Minimum number of instances allowed for the fleet.
	//
	// A fleet's instance minimum determines the capacity floor during manual or automatic scaling down.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricMinInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Percentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances).
	//
	// This metric can be used for automatic scaling.
	// Experimental.
	MetricPercentIdleInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Experimental.
	ParseLocationCapacity(capacity *LocationCapacity) *awsgamelift.CfnFleet_LocationCapacityProperty
	// Experimental.
	ParseLocations() *[]*awsgamelift.CfnFleet_LocationConfigurationProperty
	// Experimental.
	ParseResourceCreationLimitPolicy(props *FleetProps) *awsgamelift.CfnFleet_ResourceCreationLimitPolicyProperty
	// Experimental.
	ParseRuntimeConfiguration(props *FleetProps) *awsgamelift.CfnFleet_RuntimeConfigurationProperty
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Experimental.
	WarnVpcPeeringAuthorizations(scope constructs.Construct)
}

A fleet contains Amazon Elastic Compute Cloud (Amazon EC2) instances that GameLift hosts.

A fleet uses the configuration and scaling logic that you define to run your game server build. You can use a fleet directly without a queue. You can also associate multiple fleets with a GameLift queue.

For example, you can use Spot Instance fleets configured with your preferred locations, along with a backup On-Demand Instance fleet with the same locations. Using multiple Spot Instance fleets of different instance types reduces the chance of needing On-Demand Instance placement.

Example:

var build build

// Server processes can be delcared in a declarative way through the constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
				parameters: jsii.String("-logFile /local/game/logs/myserver1935.log -port 1935"),
				concurrentExecutions: jsii.Number(100),
			},
		},
	},
})

Experimental.

func NewBuildFleet

func NewBuildFleet(scope constructs.Construct, id *string, props *BuildFleetProps) BuildFleet

Experimental.

type BuildFleetProps

type BuildFleetProps struct {
	// A descriptive label that is associated with a fleet.
	//
	// Fleet names do not need to be unique.
	// Experimental.
	FleetName *string `field:"required" json:"fleetName" yaml:"fleetName"`
	// The 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: http://aws.amazon.com/ec2/instance-types/ for detailed descriptions of Amazon EC2 instance types.
	//
	// Experimental.
	InstanceType awsec2.InstanceType `field:"required" json:"instanceType" yaml:"instanceType"`
	// 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.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html
	//
	// Experimental.
	RuntimeConfiguration *RuntimeConfiguration `field:"required" json:"runtimeConfiguration" yaml:"runtimeConfiguration"`
	// A human-readable description of the fleet.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// 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.
	// Experimental.
	DesiredCapacity *float64 `field:"optional" json:"desiredCapacity" yaml:"desiredCapacity"`
	// 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 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, omit this parameter.
	// Experimental.
	Locations *[]*Location `field:"optional" json:"locations" yaml:"locations"`
	// The maximum number of instances that are allowed in the specified fleet location.
	// Experimental.
	MaxSize *float64 `field:"optional" json:"maxSize" yaml:"maxSize"`
	// 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.
	// Experimental.
	MetricGroup *string `field:"optional" json:"metricGroup" yaml:"metricGroup"`
	// The minimum number of instances that are allowed in the specified fleet location.
	// Experimental.
	MinSize *float64 `field:"optional" json:"minSize" yaml:"minSize"`
	// A VPC peering connection between your GameLift-hosted game servers and your other non-GameLift resources.
	//
	// Use Amazon Virtual Private Cloud (VPC) peering connections to enable your game servers to communicate directly and privately with your other AWS resources, such as a web service or a repository.
	// You can establish VPC peering with any resources that run on AWS and are managed by an AWS account that you have access to.
	// The VPC must be in the same Region as your fleet.
	//
	// Warning:
	// Be sure to create a VPC Peering authorization through Gamelift Service API.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html
	//
	// Experimental.
	PeerVpc awsec2.IVpc `field:"optional" json:"peerVpc" yaml:"peerVpc"`
	// The status of termination protection for active game sessions on the fleet.
	//
	// By default, new game sessions are protected and cannot be terminated during a scale-down event.
	// Experimental.
	ProtectNewGameSession *bool `field:"optional" json:"protectNewGameSession" yaml:"protectNewGameSession"`
	// 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.
	// Experimental.
	ResourceCreationLimitPolicy *ResourceCreationLimitPolicy `field:"optional" json:"resourceCreationLimitPolicy" yaml:"resourceCreationLimitPolicy"`
	// The IAM role assumed by GameLift fleet instances to access AWS ressources.
	//
	// With a role set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes).
	// If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com).
	// No permission is required by default.
	//
	// This property cannot be changed after the fleet is created.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html
	//
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
	// Prompts GameLift to generate a TLS/SSL certificate for the fleet.
	//
	// GameLift uses the certificates to encrypt traffic between game clients and the game servers running on GameLift.
	//
	// You can't change this property after you create the fleet.
	//
	// Additionnal info:
	// 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.
	// Experimental.
	UseCertificate *bool `field:"optional" json:"useCertificate" yaml:"useCertificate"`
	// Indicates whether to use On-Demand or Spot instances for this fleet. By default, fleet use on demand capacity.
	//
	// This property cannot be changed after the fleet is created.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot
	//
	// Experimental.
	UseSpot *bool `field:"optional" json:"useSpot" yaml:"useSpot"`
	// A build to be deployed on the fleet.
	//
	// 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.
	// Experimental.
	Content IBuild `field:"required" json:"content" yaml:"content"`
	// The allowed IP address ranges and port settings that allow inbound traffic to access game sessions on this fleet.
	//
	// This property must be set before players can connect to game sessions.
	// Experimental.
	IngressRules *[]*IngressRule `field:"optional" json:"ingressRules" yaml:"ingressRules"`
}

Properties for a new Gamelift build fleet.

Example:

var build build

// Server processes can be delcared in a declarative way through the constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
				parameters: jsii.String("-logFile /local/game/logs/myserver1935.log -port 1935"),
				concurrentExecutions: jsii.Number(100),
			},
		},
	},
})

Experimental.

type BuildProps

type BuildProps struct {
	// The game build file storage.
	// Experimental.
	Content Content `field:"required" json:"content" yaml:"content"`
	// Name of this build.
	// Experimental.
	BuildName *string `field:"optional" json:"buildName" yaml:"buildName"`
	// Version of this build.
	// Experimental.
	BuildVersion *string `field:"optional" json:"buildVersion" yaml:"buildVersion"`
	// The operating system that the game server binaries are built to run on.
	// Experimental.
	OperatingSystem OperatingSystem `field:"optional" json:"operatingSystem" yaml:"operatingSystem"`
	// The IAM role assumed by GameLift to access server build in S3.
	//
	// If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com) and be granted sufficient permissions
	// to have Read access to a specific key content into a specific S3 bucket.
	// Below an example of required permission:
	// {
	//   "Version": "2012-10-17",
	//   "Statement": [{
	//         "Effect": "Allow",
	//         "Action": [
	//             "s3:GetObject",
	//             "s3:GetObjectVersion"
	//         ],
	//         "Resource": "arn:aws:s3:::bucket-name/object-name"
	//   }]
	// }.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-access-storage-loc
	//
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Properties for a new build.

Example:

var bucket bucket

gamelift.NewBuild(this, jsii.String("Build"), &buildProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})

Experimental.

type Content

type Content interface {
	// Called when the Build is initialized to allow this object to bind.
	// Experimental.
	Bind(scope constructs.Construct, role awsiam.IRole) *ContentConfig
}

Before deploying your GameLift-enabled multiplayer game servers for hosting with the GameLift service, you need to upload your game server files.

The class helps you on preparing and uploading custom game server build files or Realtime Servers server script files.

Example:

var bucket bucket

gamelift.NewBuild(this, jsii.String("Build"), &buildProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})

Experimental.

type ContentConfig

type ContentConfig struct {
	// The location of the content in S3.
	// Experimental.
	S3Location *awss3.Location `field:"required" json:"s3Location" yaml:"s3Location"`
}

Result of binding `Content` into a `Build`.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"

contentConfig := &contentConfig{
	s3Location: &location{
		bucketName: jsii.String("bucketName"),
		objectKey: jsii.String("objectKey"),

		// the properties below are optional
		objectVersion: jsii.String("objectVersion"),
	},
}

Experimental.

type DeleteOption

type DeleteOption string

The type of delete to perform.

To delete a game server group, specify the DeleteOption. Experimental.

const (
	// Terminates the game server group and Amazon EC2 Auto Scaling group only when it has no game servers that are in UTILIZED status.
	// Experimental.
	DeleteOption_SAFE_DELETE DeleteOption = "SAFE_DELETE"
	// Terminates the game server group, including all active game servers regardless of their utilization status, and the Amazon EC2 Auto Scaling group.
	// Experimental.
	DeleteOption_FORCE_DELETE DeleteOption = "FORCE_DELETE"
	// Does a safe delete of the game server group but retains the Amazon EC2 Auto Scaling group as is.
	// Experimental.
	DeleteOption_RETAIN DeleteOption = "RETAIN"
)

type FleetAttributes

type FleetAttributes struct {
	// The ARN of the fleet.
	//
	// At least one of `fleetArn` and `fleetId` must be provided.
	// Experimental.
	FleetArn *string `field:"optional" json:"fleetArn" yaml:"fleetArn"`
	// The identifier of the fleet.
	//
	// At least one of `fleetId` and `fleetArn`  must be provided.
	// Experimental.
	FleetId *string `field:"optional" json:"fleetId" yaml:"fleetId"`
	// The IAM role assumed by GameLift fleet instances to access AWS ressources.
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

A full specification of a fleet that can be used to import it fluently into the CDK application.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var role role

fleetAttributes := &fleetAttributes{
	fleetArn: jsii.String("fleetArn"),
	fleetId: jsii.String("fleetId"),
	role: role,
}

Experimental.

type FleetBase

type FleetBase interface {
	awscdk.Resource
	IFleet
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the fleet.
	// Experimental.
	FleetArn() *string
	// The Identifier of the fleet.
	// Experimental.
	FleetId() *string
	// The principal this GameLift fleet is using.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Adds a remote locations to deploy additional instances to and manage as part of the fleet.
	// Experimental.
	AddInternalLocation(location *Location)
	// Adds a remote locations to deploy additional instances to and manage as part of the fleet.
	// Experimental.
	AddLocation(region *string, desiredCapacity *float64, minSize *float64, maxSize *float64)
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the `grantee` identity permissions to perform `actions`.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Return the given named metric for this fleet.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Instances with `ACTIVE` status, which means they are running active server processes.
	//
	// The count includes idle instances and those that are hosting one or more game sessions.
	// This metric measures current total instance capacity.
	//
	// This metric can be used with automatic scaling.
	// Experimental.
	MetricActiveInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Target number of active instances that GameLift is working to maintain in the fleet.
	//
	// With automatic scaling, this value is determined based on the scaling policies currently in force.
	// Without automatic scaling, this value is set manually.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricDesiredInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Active instances that are currently hosting zero (0) game sessions.
	//
	// This metric measures capacity that is available but unused.
	// This metric can be used with automatic scaling.
	// Experimental.
	MetricIdleInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Number of spot instances that have been interrupted.
	// Experimental.
	MetricInstanceInterruptions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Maximum number of instances that are allowed for the fleet.
	//
	// A fleet's instance maximum determines the capacity ceiling during manual or automatic scaling up.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricMaxInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Minimum number of instances allowed for the fleet.
	//
	// A fleet's instance minimum determines the capacity floor during manual or automatic scaling down.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricMinInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Percentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances).
	//
	// This metric can be used for automatic scaling.
	// Experimental.
	MetricPercentIdleInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Experimental.
	ParseLocationCapacity(capacity *LocationCapacity) *awsgamelift.CfnFleet_LocationCapacityProperty
	// Experimental.
	ParseLocations() *[]*awsgamelift.CfnFleet_LocationConfigurationProperty
	// Experimental.
	ParseResourceCreationLimitPolicy(props *FleetProps) *awsgamelift.CfnFleet_ResourceCreationLimitPolicyProperty
	// Experimental.
	ParseRuntimeConfiguration(props *FleetProps) *awsgamelift.CfnFleet_RuntimeConfigurationProperty
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
	// Experimental.
	WarnVpcPeeringAuthorizations(scope constructs.Construct)
}

Base class for new and imported GameLift fleet.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var role role

fleetBase := gamelift_alpha.fleetBase.fromFleetAttributes(this, jsii.String("MyFleetBase"), &fleetAttributes{
	fleetArn: jsii.String("fleetArn"),
	fleetId: jsii.String("fleetId"),
	role: role,
})

Experimental.

type FleetProps

type FleetProps struct {
	// A descriptive label that is associated with a fleet.
	//
	// Fleet names do not need to be unique.
	// Experimental.
	FleetName *string `field:"required" json:"fleetName" yaml:"fleetName"`
	// The 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: http://aws.amazon.com/ec2/instance-types/ for detailed descriptions of Amazon EC2 instance types.
	//
	// Experimental.
	InstanceType awsec2.InstanceType `field:"required" json:"instanceType" yaml:"instanceType"`
	// 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.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html
	//
	// Experimental.
	RuntimeConfiguration *RuntimeConfiguration `field:"required" json:"runtimeConfiguration" yaml:"runtimeConfiguration"`
	// A human-readable description of the fleet.
	// Experimental.
	Description *string `field:"optional" json:"description" yaml:"description"`
	// 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.
	// Experimental.
	DesiredCapacity *float64 `field:"optional" json:"desiredCapacity" yaml:"desiredCapacity"`
	// 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 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, omit this parameter.
	// Experimental.
	Locations *[]*Location `field:"optional" json:"locations" yaml:"locations"`
	// The maximum number of instances that are allowed in the specified fleet location.
	// Experimental.
	MaxSize *float64 `field:"optional" json:"maxSize" yaml:"maxSize"`
	// 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.
	// Experimental.
	MetricGroup *string `field:"optional" json:"metricGroup" yaml:"metricGroup"`
	// The minimum number of instances that are allowed in the specified fleet location.
	// Experimental.
	MinSize *float64 `field:"optional" json:"minSize" yaml:"minSize"`
	// A VPC peering connection between your GameLift-hosted game servers and your other non-GameLift resources.
	//
	// Use Amazon Virtual Private Cloud (VPC) peering connections to enable your game servers to communicate directly and privately with your other AWS resources, such as a web service or a repository.
	// You can establish VPC peering with any resources that run on AWS and are managed by an AWS account that you have access to.
	// The VPC must be in the same Region as your fleet.
	//
	// Warning:
	// Be sure to create a VPC Peering authorization through Gamelift Service API.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/vpc-peering.html
	//
	// Experimental.
	PeerVpc awsec2.IVpc `field:"optional" json:"peerVpc" yaml:"peerVpc"`
	// The status of termination protection for active game sessions on the fleet.
	//
	// By default, new game sessions are protected and cannot be terminated during a scale-down event.
	// Experimental.
	ProtectNewGameSession *bool `field:"optional" json:"protectNewGameSession" yaml:"protectNewGameSession"`
	// 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.
	// Experimental.
	ResourceCreationLimitPolicy *ResourceCreationLimitPolicy `field:"optional" json:"resourceCreationLimitPolicy" yaml:"resourceCreationLimitPolicy"`
	// The IAM role assumed by GameLift fleet instances to access AWS ressources.
	//
	// With a role set, any application that runs on an instance in this fleet can assume the role, including install scripts, server processes, and daemons (background processes).
	// If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com).
	// No permission is required by default.
	//
	// This property cannot be changed after the fleet is created.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-sdk-server-resources.html
	//
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
	// Prompts GameLift to generate a TLS/SSL certificate for the fleet.
	//
	// GameLift uses the certificates to encrypt traffic between game clients and the game servers running on GameLift.
	//
	// You can't change this property after you create the fleet.
	//
	// Additionnal info:
	// 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.
	// Experimental.
	UseCertificate *bool `field:"optional" json:"useCertificate" yaml:"useCertificate"`
	// Indicates whether to use On-Demand or Spot instances for this fleet. By default, fleet use on demand capacity.
	//
	// This property cannot be changed after the fleet is created.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-ec2-instances.html#gamelift-ec2-instances-spot
	//
	// Experimental.
	UseSpot *bool `field:"optional" json:"useSpot" yaml:"useSpot"`
}

Properties for a new Gamelift fleet.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

var instanceType instanceType
var role role
var vpc vpc

fleetProps := &fleetProps{
	fleetName: jsii.String("fleetName"),
	instanceType: instanceType,
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("launchPath"),

				// the properties below are optional
				concurrentExecutions: jsii.Number(123),
				parameters: jsii.String("parameters"),
			},
		},

		// the properties below are optional
		gameSessionActivationTimeout: cdk.duration.minutes(jsii.Number(30)),
		maxConcurrentGameSessionActivations: jsii.Number(123),
	},

	// the properties below are optional
	description: jsii.String("description"),
	desiredCapacity: jsii.Number(123),
	locations: []location{
		&location{
			region: jsii.String("region"),

			// the properties below are optional
			capacity: &locationCapacity{
				desiredCapacity: jsii.Number(123),
				maxSize: jsii.Number(123),
				minSize: jsii.Number(123),
			},
		},
	},
	maxSize: jsii.Number(123),
	metricGroup: jsii.String("metricGroup"),
	minSize: jsii.Number(123),
	peerVpc: vpc,
	protectNewGameSession: jsii.Boolean(false),
	resourceCreationLimitPolicy: &resourceCreationLimitPolicy{
		newGameSessionsPerCreator: jsii.Number(123),
		policyPeriod: cdk.*duration.minutes(jsii.Number(30)),
	},
	role: role,
	useCertificate: jsii.Boolean(false),
	useSpot: jsii.Boolean(false),
}

Experimental.

type GameServerGroup

type GameServerGroup interface {
	GameServerGroupBase
	// The ARN of the generated AutoScaling group.
	// Experimental.
	AutoScalingGroupArn() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the game server group.
	// Experimental.
	GameServerGroupArn() *string
	// The name of the game server group.
	// Experimental.
	GameServerGroupName() *string
	// The principal this GameLift game server group is using.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.
	// Experimental.
	Role() awsiam.IRole
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// The VPC network to place the game server group in.
	// Experimental.
	Vpc() awsec2.IVpc
	// The game server group's subnets.
	// Experimental.
	VpcSubnets() *awsec2.SubnetSelection
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the `grantee` identity permissions to perform `actions`.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Return the given named metric for this fleet.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Experimental.
	ParseAutoScalingPolicy(props *GameServerGroupProps) *awsgamelift.CfnGameServerGroup_AutoScalingPolicyProperty
	// Experimental.
	ParseInstanceDefinitions(props *GameServerGroupProps) *[]*awsgamelift.CfnGameServerGroup_InstanceDefinitionProperty
	// Experimental.
	ParseLaunchTemplate(props *GameServerGroupProps) *awsgamelift.CfnGameServerGroup_LaunchTemplateProperty
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Creates a GameLift FleetIQ game server group for managing game hosting on a collection of Amazon EC2 instances for game hosting.

This operation creates the game server group, creates an Auto Scaling group in your AWS account, and establishes a link between the two groups. You can view the status of your game server groups in the GameLift console. Game server group metrics and events are emitted to Amazon CloudWatch. Before creating a new game server group, you must have the following:

  • An Amazon EC2 launch template that specifies how to launch Amazon EC2 instances with your game server build.
  • An IAM role that extends limited access to your AWS account to allow GameLift FleetIQ to create and interact with the Auto Scaling group.

To create a new game server group, specify a unique group name, IAM role and Amazon EC2 launch template, and provide a list of instance types that can be used in the group. You must also set initial maximum and minimum limits on the group's instance count. You can optionally set an Auto Scaling policy with target tracking based on a GameLift FleetIQ metric.

Once the game server group and corresponding Auto Scaling group are created, you have full access to change the Auto Scaling group's configuration as needed. Several properties that are set when creating a game server group, including maximum/minimum size and auto-scaling policy settings, must be updated directly in the Auto Scaling group. Keep in mind that some Auto Scaling group properties are periodically updated by GameLift FleetIQ as part of its balancing activities to optimize for availability and cost.

Example:

var launchTemplate iLaunchTemplate
var vpc iVpc

gamelift.NewGameServerGroup(this, jsii.String("GameServerGroup"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
	vpcSubnets: &subnetSelection{
		subnetType: ec2.subnetType_PUBLIC,
	},
})

See: https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-intro.html

Experimental.

func NewGameServerGroup

func NewGameServerGroup(scope constructs.Construct, id *string, props *GameServerGroupProps) GameServerGroup

Experimental.

type GameServerGroupAttributes

type GameServerGroupAttributes struct {
	// The ARN of the generated AutoScaling group.
	// Experimental.
	AutoScalingGroupArn *string `field:"required" json:"autoScalingGroupArn" yaml:"autoScalingGroupArn"`
	// The ARN of the game server group.
	//
	// At least one of `gameServerGroupArn` and `gameServerGroupName` must be provided.
	// Experimental.
	GameServerGroupArn *string `field:"optional" json:"gameServerGroupArn" yaml:"gameServerGroupArn"`
	// The name of the game server group.
	//
	// At least one of `gameServerGroupArn` and `gameServerGroupName` must be provided.
	// Experimental.
	GameServerGroupName *string `field:"optional" json:"gameServerGroupName" yaml:"gameServerGroupName"`
	// The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Represents a GameServerGroup content defined outside of this stack.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var role role

gameServerGroupAttributes := &gameServerGroupAttributes{
	autoScalingGroupArn: jsii.String("autoScalingGroupArn"),

	// the properties below are optional
	gameServerGroupArn: jsii.String("gameServerGroupArn"),
	gameServerGroupName: jsii.String("gameServerGroupName"),
	role: role,
}

Experimental.

type GameServerGroupBase

type GameServerGroupBase interface {
	awscdk.Resource
	IGameServerGroup
	// The ARN of the generated AutoScaling group.
	// Experimental.
	AutoScalingGroupArn() *string
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The ARN of the game server group.
	// Experimental.
	GameServerGroupArn() *string
	// The name of the game server group.
	// Experimental.
	GameServerGroupName() *string
	// The principal this GameLift game server group is using.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Grant the `grantee` identity permissions to perform `actions`.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Return the given named metric for this fleet.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Base class for new and imported GameLift FleetIQ game server group. Experimental.

type GameServerGroupProps

type GameServerGroupProps struct {
	// A developer-defined identifier for the game server group.
	//
	// The name is unique for each Region in each AWS account.
	// Experimental.
	GameServerGroupName *string `field:"required" json:"gameServerGroupName" yaml:"gameServerGroupName"`
	// The set of Amazon EC2 instance types that GameLift FleetIQ can use when balancing and automatically scaling instances in the corresponding Auto Scaling group.
	// Experimental.
	InstanceDefinitions *[]*InstanceDefinition `field:"required" json:"instanceDefinitions" yaml:"instanceDefinitions"`
	// The Amazon EC2 launch template that contains configuration settings and game server code to be deployed to all instances in the game server group.
	//
	// After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.
	//
	// NOTE:
	// If you specify network interfaces in your launch template, you must explicitly set the property AssociatePublicIpAddress to `true`.
	// If no network interface is specified in the launch template, GameLift FleetIQ uses your account's default VPC.
	// See: https://docs.aws.amazon.com/autoscaling/ec2/userguide/create-launch-template.html
	//
	// Experimental.
	LaunchTemplate awsec2.ILaunchTemplate `field:"required" json:"launchTemplate" yaml:"launchTemplate"`
	// The VPC network to place the game server group in.
	//
	// By default, all GameLift FleetIQ-supported Availability Zones are used.
	//
	// You can use this parameter to specify VPCs that you've set up.
	//
	// This property cannot be updated after the game server group is created,
	// and the corresponding Auto Scaling group will always use the property value that is set with this request,
	// even if the Auto Scaling group is updated directly.
	// Experimental.
	Vpc awsec2.IVpc `field:"required" json:"vpc" yaml:"vpc"`
	// Configuration settings to define a scaling policy for the Auto Scaling group that is optimized for game hosting.
	//
	// The scaling policy uses the metric `PercentUtilizedGameServers` to maintain a buffer of idle game servers that can immediately accommodate new games and players.
	//
	// After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.
	// Experimental.
	AutoScalingPolicy *AutoScalingPolicy `field:"optional" json:"autoScalingPolicy" yaml:"autoScalingPolicy"`
	// Indicates how GameLift FleetIQ balances the use of Spot Instances and On-Demand Instances in the game server group.
	// Experimental.
	BalancingStrategy BalancingStrategy `field:"optional" json:"balancingStrategy" yaml:"balancingStrategy"`
	// The type of delete to perform.
	//
	// To delete a game server group, specify the DeleteOption.
	// Experimental.
	DeleteOption DeleteOption `field:"optional" json:"deleteOption" yaml:"deleteOption"`
	// The maximum number of instances allowed in the Amazon EC2 Auto Scaling group.
	//
	// During automatic scaling events, GameLift FleetIQ and EC2 do not scale up the group above this maximum.
	//
	// After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.
	// Experimental.
	MaxSize *float64 `field:"optional" json:"maxSize" yaml:"maxSize"`
	// The minimum number of instances allowed in the Amazon EC2 Auto Scaling group.
	//
	// During automatic scaling events, GameLift FleetIQ and Amazon EC2 do not scale down the group below this minimum.
	//
	// In production, this value should be set to at least 1.
	//
	// After the Auto Scaling group is created, update this value directly in the Auto Scaling group using the AWS console or APIs.
	// Experimental.
	MinSize *float64 `field:"optional" json:"minSize" yaml:"minSize"`
	// A flag that indicates whether instances in the game server group are protected from early termination.
	//
	// Unprotected instances that have active game servers running might be terminated during a scale-down event, causing players to be dropped from the game.
	// Protected instances cannot be terminated while there are active game servers running except in the event of a forced game server group deletion.
	//
	// An exception to this is with Spot Instances, which can be terminated by AWS regardless of protection status.
	// Experimental.
	ProtectGameServer *bool `field:"optional" json:"protectGameServer" yaml:"protectGameServer"`
	// The IAM role that allows Amazon GameLift to access your Amazon EC2 Auto Scaling groups.
	// See: https://docs.aws.amazon.com/gamelift/latest/fleetiqguide/gsg-iam-permissions-roles.html
	//
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
	// Game server group subnet selection.
	// Experimental.
	VpcSubnets *awsec2.SubnetSelection `field:"optional" json:"vpcSubnets" yaml:"vpcSubnets"`
}

Properties for a new Gamelift FleetIQ Game server group.

Example:

var launchTemplate iLaunchTemplate
var vpc iVpc

gamelift.NewGameServerGroup(this, jsii.String("GameServerGroup"), &gameServerGroupProps{
	gameServerGroupName: jsii.String("sample-gameservergroup-name"),
	instanceDefinitions: []instanceDefinition{
		&instanceDefinition{
			instanceType: ec2.instanceType.of(ec2.instanceClass_C5, ec2.instanceSize_LARGE),
		},
		&instanceDefinition{
			instanceType: ec2.*instanceType.of(ec2.*instanceClass_C4, ec2.*instanceSize_LARGE),
		},
	},
	launchTemplate: launchTemplate,
	vpc: vpc,
	vpcSubnets: &subnetSelection{
		subnetType: ec2.subnetType_PUBLIC,
	},
})

Experimental.

type IBuild

type IBuild interface {
	awsiam.IGrantable
	awscdk.IResource
	// The Identifier of the build.
	// Experimental.
	BuildId() *string
}

Your custom-built game server software that runs on GameLift and hosts game sessions for your players.

A game build represents the set of files that run your game server on a particular operating system. You can have many different builds, such as for different flavors of your game. The game build must be integrated with the GameLift service. You upload game build files to the GameLift service in the Regions where you plan to set up fleets. See: https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html

Experimental.

func Build_FromBuildAttributes

func Build_FromBuildAttributes(scope constructs.Construct, id *string, attrs *BuildAttributes) IBuild

Import an existing build from its attributes. Experimental.

func Build_FromBuildId

func Build_FromBuildId(scope constructs.Construct, id *string, buildId *string) IBuild

Import a build into CDK using its identifier. Experimental.

type IBuildFleet

type IBuildFleet interface {
	IFleet
}

Represents a GameLift Fleet used to run a custom game build. Experimental.

func BuildFleet_FromBuildFleetArn

func BuildFleet_FromBuildFleetArn(scope constructs.Construct, id *string, buildFleetArn *string) IBuildFleet

Import an existing fleet from its ARN. Experimental.

func BuildFleet_FromBuildFleetId

func BuildFleet_FromBuildFleetId(scope constructs.Construct, id *string, buildFleetId *string) IBuildFleet

Import an existing fleet from its identifier. Experimental.

type IFleet

type IFleet interface {
	awsiam.IGrantable
	awscdk.IResource
	// Grant the `grantee` identity permissions to perform `actions`.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Return the given named metric for this fleet.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Instances with `ACTIVE` status, which means they are running active server processes.
	//
	// The count includes idle instances and those that are hosting one or more game sessions.
	// This metric measures current total instance capacity.
	//
	// This metric can be used with automatic scaling.
	// Experimental.
	MetricActiveInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Target number of active instances that GameLift is working to maintain in the fleet.
	//
	// With automatic scaling, this value is determined based on the scaling policies currently in force.
	// Without automatic scaling, this value is set manually.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricDesiredInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Active instances that are currently hosting zero (0) game sessions.
	//
	// This metric measures capacity that is available but unused.
	// This metric can be used with automatic scaling.
	// Experimental.
	MetricIdleInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Number of spot instances that have been interrupted.
	// Experimental.
	MetricInstanceInterruptions(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Maximum number of instances that are allowed for the fleet.
	//
	// A fleet's instance maximum determines the capacity ceiling during manual or automatic scaling up.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricMaxInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Minimum number of instances allowed for the fleet.
	//
	// A fleet's instance minimum determines the capacity floor during manual or automatic scaling down.
	// This metric is not available when viewing data for fleet metric groups.
	// Experimental.
	MetricMinInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// Percentage of all active instances that are idle (calculated as IdleInstances / ActiveInstances).
	//
	// This metric can be used for automatic scaling.
	// Experimental.
	MetricPercentIdleInstances(props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The ARN of the fleet.
	// Experimental.
	FleetArn() *string
	// The Identifier of the fleet.
	// Experimental.
	FleetId() *string
}

Represents a Gamelift fleet. Experimental.

func BuildFleet_FromFleetAttributes

func BuildFleet_FromFleetAttributes(scope constructs.Construct, id *string, attrs *FleetAttributes) IFleet

Import an existing fleet from its attributes. Experimental.

func FleetBase_FromFleetAttributes

func FleetBase_FromFleetAttributes(scope constructs.Construct, id *string, attrs *FleetAttributes) IFleet

Import an existing fleet from its attributes. Experimental.

type IGameServerGroup

type IGameServerGroup interface {
	awsiam.IGrantable
	awscdk.IResource
	// Grant the `grantee` identity permissions to perform `actions`.
	// Experimental.
	Grant(grantee awsiam.IGrantable, actions ...*string) awsiam.Grant
	// Return the given named metric for this fleet.
	// Experimental.
	Metric(metricName *string, props *awscloudwatch.MetricOptions) awscloudwatch.Metric
	// The ARN of the generated AutoScaling group.
	// Experimental.
	AutoScalingGroupArn() *string
	// The ARN of the game server group.
	// Experimental.
	GameServerGroupArn() *string
	// The name of the game server group.
	// Experimental.
	GameServerGroupName() *string
}

Represent a GameLift FleetIQ game server group. Experimental.

func GameServerGroup_FromGameServerGroupAttributes

func GameServerGroup_FromGameServerGroupAttributes(scope constructs.Construct, id *string, attrs *GameServerGroupAttributes) IGameServerGroup

Import an existing game server group from its attributes. Experimental.

type IPeer

type IPeer interface {
	// Produce the ingress rule JSON for the given connection.
	// Experimental.
	ToJson() interface{}
	// A unique identifier for this connection peer.
	// Experimental.
	UniqueId() *string
}

Interface for classes that provide the peer-specification parts of an inbound permission. Experimental.

func Peer_AnyIpv4

func Peer_AnyIpv4() IPeer

Any IPv4 address. Experimental.

func Peer_Ipv4

func Peer_Ipv4(cidrIp *string) IPeer

Create an IPv4 peer from a CIDR. Experimental.

type IScript

type IScript interface {
	awsiam.IGrantable
	awscdk.IResource
	// The ARN of the realtime server script.
	// Experimental.
	ScriptArn() *string
	// The Identifier of the realtime server script.
	// Experimental.
	ScriptId() *string
}

Your configuration and custom game logic for use with Realtime Servers.

Realtime Servers are provided by GameLift to use instead of a custom-built game server. You configure Realtime Servers for your game clients by creating a script using JavaScript, and add custom game logic as appropriate to host game sessions for your players. You upload the Realtime script to the GameLift service in the Regions where you plan to set up fleets. See: https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-script-uploading.html

Experimental.

func Script_FromScriptArn

func Script_FromScriptArn(scope constructs.Construct, id *string, scriptArn *string) IScript

Import a script into CDK using its ARN. Experimental.

func Script_FromScriptAttributes

func Script_FromScriptAttributes(scope constructs.Construct, id *string, attrs *ScriptAttributes) IScript

Import an existing realtime server script from its attributes. Experimental.

type IngressRule

type IngressRule struct {
	// The port range used for ingress traffic.
	// Experimental.
	Port Port `field:"required" json:"port" yaml:"port"`
	// A range of allowed IP addresses .
	// Experimental.
	Source IPeer `field:"required" json:"source" yaml:"source"`
}

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.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"

var peer iPeer
var port port

ingressRule := &ingressRule{
	port: port,
	source: peer,
}

Experimental.

type InstanceDefinition

type InstanceDefinition struct {
	// An Amazon EC2 instance type designation.
	// Experimental.
	InstanceType awsec2.InstanceType `field:"required" json:"instanceType" yaml:"instanceType"`
	// Instance weighting that indicates how much this instance type contributes to the total capacity of a game server group.
	//
	// Instance weights are used by GameLift FleetIQ to calculate the instance type's cost per unit hour and better identify the most cost-effective options.
	// See: https://docs.aws.amazon.com/autoscaling/ec2/userguide/asg-instance-weighting.html
	//
	// Experimental.
	Weight *float64 `field:"optional" json:"weight" yaml:"weight"`
}

An allowed instance type for a game server group.

All game server groups must have at least two instance types defined for it. GameLift FleetIQ periodically evaluates each defined instance type for viability. It then updates the Auto Scaling group with the list of viable instance types.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var instanceType instanceType

instanceDefinition := &instanceDefinition{
	instanceType: instanceType,

	// the properties below are optional
	weight: jsii.Number(123),
}

Experimental.

type Location

type Location struct {
	// An AWS Region code.
	// Experimental.
	Region *string `field:"required" json:"region" yaml:"region"`
	// 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.
	// Experimental.
	Capacity *LocationCapacity `field:"optional" json:"capacity" yaml:"capacity"`
}

A remote location where a multi-location fleet can deploy EC2 instances for game hosting.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"

location := &location{
	region: jsii.String("region"),

	// the properties below are optional
	capacity: &locationCapacity{
		desiredCapacity: jsii.Number(123),
		maxSize: jsii.Number(123),
		minSize: jsii.Number(123),
	},
}

Experimental.

type LocationCapacity

type LocationCapacity struct {
	// 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.
	// Experimental.
	DesiredCapacity *float64 `field:"optional" json:"desiredCapacity" yaml:"desiredCapacity"`
	// The maximum number of instances that are allowed in the specified fleet location.
	// Experimental.
	MaxSize *float64 `field:"optional" json:"maxSize" yaml:"maxSize"`
	// The minimum number of instances that are allowed in the specified fleet location.
	// Experimental.
	MinSize *float64 `field:"optional" json:"minSize" yaml:"minSize"`
}

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.

Example:

var build build

// Locations can be added directly through constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	locations: []location{
		&location{
			region: jsii.String("eu-west-1"),
			capacity: &locationCapacity{
				desiredCapacity: jsii.Number(5),
				minSize: jsii.Number(2),
				maxSize: jsii.Number(10),
			},
		},
		&location{
			region: jsii.String("us-east-1"),
			capacity: &locationCapacity{
				desiredCapacity: jsii.Number(5),
				minSize: jsii.Number(2),
				maxSize: jsii.Number(10),
			},
		},
	},
})

// Or through dedicated methods
fleet.addLocation(jsii.String("ap-southeast-1"), jsii.Number(5), jsii.Number(2), jsii.Number(10))

Experimental.

type OperatingSystem

type OperatingSystem string

The operating system that the game server binaries are built to run on. Experimental.

const (
	// Experimental.
	OperatingSystem_AMAZON_LINUX OperatingSystem = "AMAZON_LINUX"
	// Experimental.
	OperatingSystem_AMAZON_LINUX_2 OperatingSystem = "AMAZON_LINUX_2"
	// Experimental.
	OperatingSystem_WINDOWS_2012 OperatingSystem = "WINDOWS_2012"
)

type Peer

type Peer interface {
}

Peer object factories.

The static methods on this object can be used to create peer objects which represent a connection partner in inbound permission rules.

Use this object if you need to represent connection partners using plain IP addresses.

Example:

var build build

fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	ingressRules: []ingressRule{
		&ingressRule{
			source: gamelift.peer.anyIpv4(),
			port: gamelift.port.tcpRange(jsii.Number(100), jsii.Number(200)),
		},
	},
})
// Allowing a specific CIDR for port 1111 on UDP Protocol
fleet.addIngressRule(gamelift.peer.ipv4(jsii.String("1.2.3.4/32")), gamelift.port.udp(jsii.Number(1111)))

Experimental.

func NewPeer

func NewPeer() Peer

Experimental.

type Port

type Port interface {
	// Produce the ingress rule JSON for the given connection.
	// Experimental.
	ToJson() interface{}
}

Interface for classes that provide the connection-specification parts of a security group rule.

Example:

var build build

fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
			},
		},
	},
	ingressRules: []ingressRule{
		&ingressRule{
			source: gamelift.peer.anyIpv4(),
			port: gamelift.port.tcpRange(jsii.Number(100), jsii.Number(200)),
		},
	},
})
// Allowing a specific CIDR for port 1111 on UDP Protocol
fleet.addIngressRule(gamelift.peer.ipv4(jsii.String("1.2.3.4/32")), gamelift.port.udp(jsii.Number(1111)))

Experimental.

func NewPort

func NewPort(props *PortProps) Port

Experimental.

func Port_AllTcp

func Port_AllTcp() Port

Any TCP traffic. Experimental.

func Port_AllUdp

func Port_AllUdp() Port

Any UDP traffic. Experimental.

func Port_Tcp

func Port_Tcp(port *float64) Port

A single TCP port. Experimental.

func Port_TcpRange

func Port_TcpRange(startPort *float64, endPort *float64) Port

A TCP port range. Experimental.

func Port_Udp

func Port_Udp(port *float64) Port

A single UDP port. Experimental.

func Port_UdpRange

func Port_UdpRange(startPort *float64, endPort *float64) Port

A UDP port range. Experimental.

type PortProps

type PortProps struct {
	// A starting value for a range of allowed port numbers.
	//
	// For fleets using Windows and Linux builds, only ports 1026-60000 are valid.
	// Experimental.
	FromPort *float64 `field:"required" json:"fromPort" yaml:"fromPort"`
	// The protocol for the range.
	// Experimental.
	Protocol Protocol `field:"required" json:"protocol" yaml:"protocol"`
	// An ending value for a range of allowed port numbers.
	//
	// Port numbers are end-inclusive.
	// This value must be higher than `fromPort`.
	//
	// For fleets using Windows and Linux builds, only ports 1026-60000 are valid.
	// Experimental.
	ToPort *float64 `field:"optional" json:"toPort" yaml:"toPort"`
}

Properties to create a port range.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"

portProps := &portProps{
	fromPort: jsii.Number(123),
	protocol: gamelift_alpha.protocol_TCP,

	// the properties below are optional
	toPort: jsii.Number(123),
}

Experimental.

type Protocol

type Protocol string

Protocol for use in Connection Rules.

https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml Experimental.

const (
	// Experimental.
	Protocol_TCP Protocol = "TCP"
	// Experimental.
	Protocol_UDP Protocol = "UDP"
)

type ResourceCreationLimitPolicy

type ResourceCreationLimitPolicy struct {
	// The maximum number of game sessions that an individual can create during the policy period.
	// Experimental.
	NewGameSessionsPerCreator *float64 `field:"optional" json:"newGameSessionsPerCreator" yaml:"newGameSessionsPerCreator"`
	// The time span used in evaluating the resource creation limit policy.
	// Experimental.
	PolicyPeriod awscdk.Duration `field:"optional" json:"policyPeriod" yaml:"policyPeriod"`
}

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 by CreatorId) has created fewer than 10 game sessions in the past 60 minutes.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import cdk "github.com/aws/aws-cdk-go/awscdk"

resourceCreationLimitPolicy := &resourceCreationLimitPolicy{
	newGameSessionsPerCreator: jsii.Number(123),
	policyPeriod: cdk.duration.minutes(jsii.Number(30)),
}

Experimental.

type RuntimeConfiguration

type RuntimeConfiguration struct {
	// A collection of server process configurations that identify what server processes to run on each instance in a fleet.
	// Experimental.
	ServerProcesses *[]*ServerProcess `field:"required" json:"serverProcesses" yaml:"serverProcesses"`
	// The maximum amount of time 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 to `TERMINATED`.
	// Experimental.
	GameSessionActivationTimeout awscdk.Duration `field:"optional" json:"gameSessionActivationTimeout" yaml:"gameSessionActivationTimeout"`
	// 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.
	// Experimental.
	MaxConcurrentGameSessionActivations *float64 `field:"optional" json:"maxConcurrentGameSessionActivations" yaml:"maxConcurrentGameSessionActivations"`
}

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`.

Example:

var build build

// Server processes can be delcared in a declarative way through the constructor
fleet := gamelift.NewBuildFleet(this, jsii.String("Game server fleet"), &buildFleetProps{
	fleetName: jsii.String("test-fleet"),
	content: build,
	instanceType: ec2.instanceType.of(ec2.instanceClass_C4, ec2.instanceSize_LARGE),
	runtimeConfiguration: &runtimeConfiguration{
		serverProcesses: []serverProcess{
			&serverProcess{
				launchPath: jsii.String("/local/game/GameLiftExampleServer.x86_64"),
				parameters: jsii.String("-logFile /local/game/logs/myserver1935.log -port 1935"),
				concurrentExecutions: jsii.Number(100),
			},
		},
	},
})

See: https://docs.aws.amazon.com/gamelift/latest/developerguide/fleets-multiprocess.html

Experimental.

type S3Content

type S3Content interface {
	Content
	// Called when the Build is initialized to allow this object to bind.
	// Experimental.
	Bind(_scope constructs.Construct, role awsiam.IRole) *ContentConfig
}

Game content from an S3 archive.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var bucket bucket

s3Content := gamelift_alpha.NewS3Content(bucket, jsii.String("key"), jsii.String("objectVersion"))

Experimental.

func AssetContent_FromBucket

func AssetContent_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Content

Game content as an S3 object. Experimental.

func Content_FromBucket

func Content_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Content

Game content as an S3 object. Experimental.

func NewS3Content

func NewS3Content(bucket awss3.IBucket, key *string, objectVersion *string) S3Content

Experimental.

func S3Content_FromBucket

func S3Content_FromBucket(bucket awss3.IBucket, key *string, objectVersion *string) S3Content

Game content as an S3 object. Experimental.

type Script

type Script interface {
	ScriptBase
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The principal this GameLift script is using.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The IAM role GameLift assumes to acccess server script content.
	// Experimental.
	Role() awsiam.IRole
	// The ARN of the realtime server script.
	// Experimental.
	ScriptArn() *string
	// The Identifier of the realtime server script.
	// Experimental.
	ScriptId() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

A GameLift script, that is installed and runs on instances in an Amazon GameLift fleet.

It consists of a zip file with all of the components of the realtime game server script.

Example:

var bucket bucket

gamelift.NewScript(this, jsii.String("Script"), &scriptProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})

See: https://docs.aws.amazon.com/gamelift/latest/developerguide/realtime-script-uploading.html

Experimental.

func NewScript

func NewScript(scope constructs.Construct, id *string, props *ScriptProps) Script

Experimental.

func Script_FromAsset

func Script_FromAsset(scope constructs.Construct, id *string, path *string, options *awss3assets.AssetOptions) Script

Create a new realtime server script from asset content. Experimental.

func Script_FromBucket

func Script_FromBucket(scope constructs.Construct, id *string, bucket awss3.IBucket, key *string, objectVersion *string) Script

Create a new realtime server script from s3 content. Experimental.

type ScriptAttributes

type ScriptAttributes struct {
	// The ARN of the realtime server script.
	// Experimental.
	ScriptArn *string `field:"required" json:"scriptArn" yaml:"scriptArn"`
	// The IAM role assumed by GameLift to access server script in S3.
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
}

Represents a Script content defined outside of this stack.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"
import "github.com/aws/aws-cdk-go/awscdk"

var role role

scriptAttributes := &scriptAttributes{
	scriptArn: jsii.String("scriptArn"),

	// the properties below are optional
	role: role,
}

Experimental.

type ScriptBase

type ScriptBase interface {
	awscdk.Resource
	IScript
	// The environment this resource belongs to.
	//
	// For resources that are created and managed by the CDK
	// (generally, those created by creating new class instances like Role, Bucket, etc.),
	// this is always the same as the environment of the stack they belong to;
	// however, for imported resources
	// (those obtained from static methods like fromRoleArn, fromBucketName, etc.),
	// that might be different than the stack they were imported into.
	// Experimental.
	Env() *awscdk.ResourceEnvironment
	// The principal to grant permissions to.
	// Experimental.
	GrantPrincipal() awsiam.IPrincipal
	// The tree node.
	// Experimental.
	Node() constructs.Node
	// Returns a string-encoded token that resolves to the physical name that should be passed to the CloudFormation resource.
	//
	// This value will resolve to one of the following:
	// - a concrete value (e.g. `"my-awesome-bucket"`)
	// - `undefined`, when a name should be generated by CloudFormation
	// - a concrete name generated automatically during synthesis, in
	//    cross-environment scenarios.
	// Experimental.
	PhysicalName() *string
	// The ARN of the realtime server script.
	// Experimental.
	ScriptArn() *string
	// The Identifier of the realtime server script.
	// Experimental.
	ScriptId() *string
	// The stack in which this resource is defined.
	// Experimental.
	Stack() awscdk.Stack
	// Apply the given removal policy to this resource.
	//
	// 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`).
	// Experimental.
	ApplyRemovalPolicy(policy awscdk.RemovalPolicy)
	// Experimental.
	GeneratePhysicalName() *string
	// Returns an environment-sensitive token that should be used for the resource's "ARN" attribute (e.g. `bucket.bucketArn`).
	//
	// Normally, this token will resolve to `arnAttr`, but if the resource is
	// referenced across environments, `arnComponents` will be used to synthesize
	// a concrete ARN with the resource's physical name. Make sure to reference
	// `this.physicalName` in `arnComponents`.
	// Experimental.
	GetResourceArnAttribute(arnAttr *string, arnComponents *awscdk.ArnComponents) *string
	// Returns an environment-sensitive token that should be used for the resource's "name" attribute (e.g. `bucket.bucketName`).
	//
	// Normally, this token will resolve to `nameAttr`, but if the resource is
	// referenced across environments, it will be resolved to `this.physicalName`,
	// which will be a concrete name.
	// Experimental.
	GetResourceNameAttribute(nameAttr *string) *string
	// Returns a string representation of this construct.
	// Experimental.
	ToString() *string
}

Base class for new and imported GameLift realtime server script. Experimental.

type ScriptProps

type ScriptProps struct {
	// The game content.
	// Experimental.
	Content Content `field:"required" json:"content" yaml:"content"`
	// The IAM role assumed by GameLift to access server script in S3.
	//
	// If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com) and be granted sufficient permissions
	// to have Read access to a specific key content into a specific S3 bucket.
	// Below an example of required permission:
	// {
	//   "Version": "2012-10-17",
	//   "Statement": [{
	//         "Effect": "Allow",
	//         "Action": [
	//             "s3:GetObject",
	//             "s3:GetObjectVersion"
	//         ],
	//         "Resource": "arn:aws:s3:::bucket-name/object-name"
	//   }]
	// }.
	// See: https://docs.aws.amazon.com/gamelift/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-access-storage-loc
	//
	// Experimental.
	Role awsiam.IRole `field:"optional" json:"role" yaml:"role"`
	// Name of this realtime server script.
	// Experimental.
	ScriptName *string `field:"optional" json:"scriptName" yaml:"scriptName"`
	// Version of this realtime server script.
	// Experimental.
	ScriptVersion *string `field:"optional" json:"scriptVersion" yaml:"scriptVersion"`
}

Properties for a new realtime server script.

Example:

var bucket bucket

gamelift.NewScript(this, jsii.String("Script"), &scriptProps{
	content: gamelift.content.fromBucket(bucket, jsii.String("sample-asset-key")),
})

Experimental.

type ServerProcess

type ServerProcess struct {
	// 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`
	// Experimental.
	LaunchPath *string `field:"required" json:"launchPath" yaml:"launchPath"`
	// The number of server processes using this configuration that run concurrently on each instance.
	//
	// Minimum is `1`.
	// Experimental.
	ConcurrentExecutions *float64 `field:"optional" json:"concurrentExecutions" yaml:"concurrentExecutions"`
	// An optional list of parameters to pass to the server executable or Realtime script on launch.
	// Experimental.
	Parameters *string `field:"optional" json:"parameters" yaml:"parameters"`
}

Configuration of a fleet server process.

Example:

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import gamelift_alpha "github.com/aws/aws-cdk-go/awscdkgameliftalpha"

serverProcess := &serverProcess{
	launchPath: jsii.String("launchPath"),

	// the properties below are optional
	concurrentExecutions: jsii.Number(123),
	parameters: jsii.String("parameters"),
}

Experimental.

Source Files

Directories

Path Synopsis
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.
Package jsii contains the functionaility needed for jsii packages to initialize their dependencies and themselves.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL