AWS::GameLift::Build
The AWS::GameLift::Build resource creates a build that includes all of the
components to run your game server in an Amazon GameLift (GameLift) fleet.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::GameLift::Build", "Properties" : { "Name" :String, "StorageLocation" :StorageLocation, "Version" :String} }
YAML
Type: AWS::GameLift::Build Properties: Name:StringStorageLocation:StorageLocationVersion:String
Properties
Name-
An identifier to associate with this build. Build names don't need to be unique.
Required: No
Type: String
Update requires: No interruption
StorageLocation-
The Amazon Simple Storage Service (Amazon S3) location where your build package files are located.
Required: No, but we recommend that you specify a location. If you don't specify this property, you must manually upload your build package files to GameLift.
Type: Amazon GameLift Build StorageLocation
Update requires: Replacement
Version-
A version to associate with this build. Version is useful if you want to track updates to your build package files. Versions don't need to be unique.
Required: No
Type: String
Update requires: No interruption
Return Value
Ref
When the logical ID of this resource is provided to the Ref
intrinsic function, Ref returns the build ID, such as
mybuild-a01234b56-7890-1de2-f345-g67h8i901j2k.
For more information about using the Ref function, see Ref.
Example
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 AWS Identity and Access Management
(IAM) role
that GameLift assumes so that it has permissions to download the build package files.
JSON
"BuildResource": { "Type": "AWS::GameLift::Build", "Properties": { "Name": "MyGameServerBuild", "Version": "v15", "StorageLocation": { "Bucket": "mybucket", "Key": "buildpackagefiles/", "RoleArn": { "Fn::GetAtt": [ "IAMRole", "Arn" ] } } } }, "IAMRole": { "Type": "AWS::IAM::Role", "Properties": { "AssumeRolePolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "Service": [ "gamelift.amazonaws.com" ] }, "Action": [ "sts:AssumeRole" ] } ] }, "Path": "/", "Policies": [ { "PolicyName": "gamelift-s3-access-policy", "PolicyDocument": { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject" ], "Resource": [ "arn:aws:s3:::mybucket/*" ] } ] } } ] } }
YAML
BuildResource: Type: AWS::GameLift::Build Properties: Name: "MyGameServerBuild" Version: "v15" StorageLocation: Bucket: "mybucket" Key: "buildpackagefiles/" RoleArn: Fn::GetAtt: - "IAMRole" - "Arn" IAMRole: Type: AWS::IAM::Role Properties: AssumeRolePolicyDocument: Version: "2012-10-17" Statement: - Effect: "Allow" Principal: Service: - "gamelift.amazonaws.com" Action: - "sts:AssumeRole" Path: "/" Policies: - PolicyName: "gamelift-s3-access-policy" PolicyDocument: Version: "2012-10-17" Statement: - Effect: "Allow" Action: - "s3:GetObject" Resource: - "arn:aws:s3:::mybucket/*"
