AWS::GameLift::Build - Amazon CloudFormation
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

AWS::GameLift::Build

The AWS::GameLift::Build resource creates a game server build that is installed and run on instances in an Amazon GameLift fleet. This resource points to an Amazon S3 location that contains a zip file with all of the components of the game server build.

Syntax

To declare this entity in your Amazon CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::GameLift::Build", "Properties" : { "Name" : String, "OperatingSystem" : String, "ServerSdkVersion" : String, "StorageLocation" : StorageLocation, "Version" : String } }

YAML

Type: AWS::GameLift::Build Properties: Name: String OperatingSystem: String ServerSdkVersion: String StorageLocation: StorageLocation Version: String

Properties

Name

A descriptive label that is associated with a build. Build names do not need to be unique.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

OperatingSystem

The operating system that your game server binaries run on. This value determines the type of fleet resources that you use for this build. If your game build contains multiple executables, they all must run on the same operating system. You must specify a valid operating system in this request. There is no default value. You can't change a build's operating system later.

Note

If you have active fleets using the Windows Server 2012 operating system, you can continue to create new builds using this OS until October 10, 2023, when Microsoft ends its support. All others must use Windows Server 2016 when creating new Windows-based builds.

Required: No

Type: String

Allowed values: AMAZON_LINUX | AMAZON_LINUX_2 | AMAZON_LINUX_2023 | WINDOWS_2012 | WINDOWS_2016

Update requires: Replacement

ServerSdkVersion

A server SDK version you used when integrating your game server build with Amazon GameLift. For more information see Integrate games with custom game servers. By default Amazon GameLift sets this value to 4.0.2.

Required: No

Type: String

Pattern: ^\d+\.\d+\.\d+$

Maximum: 128

Update requires: Replacement

StorageLocation

Information indicating where your game build files are stored. Use this parameter only when creating a build with files stored in an Amazon S3 bucket that you own. The storage location must specify an Amazon S3 bucket name and key. The location must also specify a role ARN that you set up to allow Amazon GameLift to access your Amazon S3 bucket. The S3 bucket and your new build must be in the same Region.

If a StorageLocation is specified, the size of your file can be found in your Amazon S3 bucket. Amazon GameLift will report a SizeOnDisk of 0.

Required: No

Type: StorageLocation

Update requires: Replacement

Version

Version information that is associated with this build. Version strings do not need to be unique.

Required: No

Type: String

Minimum: 1

Maximum: 1024

Update requires: No interruption

Return values

Ref

When you pass the logical ID of this resource to the intrinsic Ref function, Ref returns the build ID, such as build-1111aaaa-22bb-33cc-44dd-5555eeee66ff.

For more information about using the Ref function, see Ref.

Fn::GetAtt

The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.

For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.

BuildId

A unique identifier for the build.

Examples

Create a Custom Game Server Build

The following example creates a GameLift build named MyGameServerBuild. The build package is located in an S3 bucket, specified by the S3Bucket and S3Key input parameters. The example also creates the Amazon Identity and Access Management role that GameLift assumes so that it has permissions to download the build package files.

JSON

{ "Resources": { "IAMRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "cloudformation.amazonaws.com", "gamelift.amazonaws.com" ] }, "Action": "sts:AssumeRole" } ] }, "RoleName": "BuildIAMRole", "Policies": [ { "PolicyName": "gamelift-s3-access-policy", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:GetObjectVersion", "s3:GetObjectMetadata", "s3:*Object*" ], "Resource": [ "arn:aws:s3:::MyBucketName/*" ] } ] } } ] } }, "BuildResource": { "Type": "AWS::GameLift::Build", "Properties": { "Name": "MyGameServerBuild", "Version": "v1.0", "OperatingSystem": "WINDOWS_2012", "ServerSdkVersion: "5.0.0", "StorageLocation": { "Bucket": "MyBucketName", "Key": "MyGameBuildFiles.zip", "RoleArn": { "Fn::GetAtt": [ "IAMRole", "Arn" ] } } } } } }

YAML

Resources: IAMRole: Type: "AWS::IAM::Role" Properties: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: "Allow" Principal: Service: ["cloudformation.amazonaws.com", "gamelift.amazonaws.com"] Action: "sts:AssumeRole" RoleName: "BuildIAMRole" Policies: - PolicyName: gamelift-s3-access-policy PolicyDocument: Version: '2012-10-17' Statement: - Effect: Allow Action: - "s3:GetObject" - "s3:GetObjectVersion" - "s3:GetObjectMetadata" - "s3:*Object*" Resource: - "arn:aws:s3:::MyBucketName/*" BuildResource: Type: AWS::GameLift::Build Properties: Name: MyGameServerBuild Version: v1.0 OperatingSystem: WINDOWS_2012 ServerSdkVersion: 5.0.0 StorageLocation: Bucket: "MyBucketName" Key: "MyGameBuildFiles.zip" RoleArn: !GetAtt IAMRole.Arn

See also