class Build (construct)
| Language | Type name |
|---|---|
.NET | Amazon.CDK.AWS.GameLift.Alpha.Build |
Go | github.com/aws/aws-cdk-go/awscdkgameliftalpha/v2#Build |
Java | software.amazon.awscdk.services.gamelift.alpha.Build |
Python | aws_cdk.aws_gamelift_alpha.Build |
TypeScript (source) | @aws-cdk/aws-gamelift-alpha ยป Build |
Implements
IConstruct, IDependable, IResource, IEnvironment, IBuild, IGrantable
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
declare const bucket: s3.Bucket;
const build = new gamelift.Build(this, 'Build', {
content: gamelift.Content.fromBucket(bucket, "sample-asset-key")
});
new CfnOutput(this, 'BuildArn', { value: build.buildArn });
new CfnOutput(this, 'BuildId', { value: build.buildId });
Initializer
new Build(scope: Construct, id: string, props: BuildProps)
Parameters
- scope
Construct - id
string - props
BuildProps
Construct Props
| Name | Type | Description |
|---|---|---|
| content | Content | The game build file storage. |
| build | string | Name of this build. |
| build | string | Version of this build. |
| operating | Operating | The operating system that the game server binaries are built to run on. |
| role? | IRole | The IAM role assumed by GameLift to access server build in S3. |
| server | string | A server SDK version you used when integrating your game server build with Amazon GameLift. |
content
Type:
Content
The game build file storage.
buildName?
Type:
string
(optional, default: No name)
Name of this build.
buildVersion?
Type:
string
(optional, default: No version)
Version of this build.
operatingSystem?
Type:
Operating
(optional, default: No version)
The operating system that the game server binaries are built to run on.
role?
Type:
IRole
(optional, default: a role will be created with default permissions.)
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" }] }
serverSdkVersion?
Type:
string
(optional, default: 4.0.2)
A server SDK version you used when integrating your game server build with Amazon GameLift.
Properties
| Name | Type | Description |
|---|---|---|
| build | string | The ARN of the build. |
| build | string | The Identifier of the build. |
| env | Resource | The environment this resource belongs to. |
| grant | IPrincipal | The principal this GameLift Build is using. |
| node | Node | The tree node. |
| role | IRole | The IAM role GameLift assumes to acccess server build content. |
| stack | Stack | The stack in which this resource is defined. |
| static PROPERTY_INJECTION_ID | string | Uniquely identifies this class. |
buildArn
Type:
string
The ARN of the build.
buildId
Type:
string
The Identifier of the build.
env
Type:
Resource
The environment this resource belongs to.
For resources that are created and managed in a Stack (those created by
creating new class instances like new Role(), new Bucket(), etc.), this
is always the same as the environment of the stack they belong to.
For referenced resources (those obtained from referencing methods like
Role.fromRoleArn(), Bucket.fromBucketName(), etc.), they might be
different than the stack they were imported into.
grantPrincipal
Type:
IPrincipal
The principal this GameLift Build is using.
node
Type:
Node
The tree node.
role
Type:
IRole
The IAM role GameLift assumes to acccess server build content.
stack
Type:
Stack
The stack in which this resource is defined.
static PROPERTY_INJECTION_ID
Type:
string
Uniquely identifies this class.
Methods
| Name | Description |
|---|---|
| apply | Apply the given removal policy to this resource. |
| to | Returns a string representation of this construct. |
| static from | Create a new Build from asset content. |
| static from | Create a new Build from s3 content. |
| static from | Import a build into CDK using its ARN. |
| static from | Import an existing build from its attributes. |
| static from | Import a build into CDK using its identifier. |
applyRemovalPolicy(policy)
public applyRemovalPolicy(policy: RemovalPolicy): void
Parameters
- policy
RemovalPolicy
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).
toString()
public toString(): string
Returns
string
Returns a string representation of this construct.
static fromAsset(scope, id, path, options?)
public static fromAsset(scope: Construct, id: string, path: string, options?: AssetOptions): Build
Parameters
- scope
Construct - id
string - path
string - options
AssetOptions
Returns
Create a new Build from asset content.
static fromBucket(scope, id, bucket, key, objectVersion?)
public static fromBucket(scope: Construct, id: string, bucket: IBucket, key: string, objectVersion?: string): Build
Parameters
Returns
Create a new Build from s3 content.
static fromBuildArn(scope, id, buildArn)
public static fromBuildArn(scope: Construct, id: string, buildArn: string): IBuild
Parameters
- scope
Construct - id
string - buildArn
string
Returns
Import a build into CDK using its ARN.
static fromBuildAttributes(scope, id, attrs)
public static fromBuildAttributes(scope: Construct, id: string, attrs: BuildAttributes): IBuild
Parameters
- scope
Construct - id
string - attrs
BuildAttributes
Returns
Import an existing build from its attributes.
static fromBuildId(scope, id, buildId)
public static fromBuildId(scope: Construct, id: string, buildId: string): IBuild
Parameters
- scope
Construct - id
string - buildId
string
Returns
Import a build into CDK using its identifier.

.NET
Go
Java
Python
TypeScript (