awscdkgameliftalpha

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

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

Go to latest
Published: Nov 1, 2022 License: Apache-2.0 Imports: 10 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

Defining a GameLift Fleet

GameLift helps you deploy, operate, and scale dedicated game servers for session-based multiplayer games. It helps you regulate the resources needed to host your games, finds available game servers to host new game sessions, and puts players into games.

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")),
})

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

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 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 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 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 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, grantable awsiam.IGrantable) *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 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 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, grantable awsiam.IGrantable) *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 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 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 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 S3Content

type S3Content interface {
	Content
	// Called when the Build is initialized to allow this object to bind.
	// Experimental.
	Bind(_scope constructs.Construct, grantable awsiam.IGrantable) *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.

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