选择您的 Cookie 首选项

我们使用必要 Cookie 和类似工具提供我们的网站和服务。我们使用性能 Cookie 收集匿名统计数据,以便我们可以了解客户如何使用我们的网站并进行改进。必要 Cookie 无法停用,但您可以单击“自定义”或“拒绝”来拒绝性能 Cookie。

如果您同意,AWS 和经批准的第三方还将使用 Cookie 提供有用的网站功能、记住您的首选项并显示相关内容,包括相关广告。要接受或拒绝所有非必要 Cookie,请单击“接受”或“拒绝”。要做出更详细的选择,请单击“自定义”。

AWS::GameLift::Build

聚焦模式
AWS::GameLift::Build - AWS CloudFormation
此页面尚未翻译为您的语言。 请求翻译
筛选器视图

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 AWS CloudFormation template, use the following syntax:

JSON

{ "Type" : "AWS::GameLift::Build", "Properties" : { "Name" : String, "OperatingSystem" : String, "ServerSdkVersion" : String, "StorageLocation" : StorageLocation, "Tags" : [ Tag, ... ], "Version" : String } }

YAML

Type: AWS::GameLift::Build Properties: Name: String OperatingSystem: String ServerSdkVersion: String StorageLocation: StorageLocation Tags: - Tag 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

Amazon Linux 2 (AL2) will reach end of support on 6/30/2025. See more details in the Amazon Linux 2 FAQs. For game servers that are hosted on AL2 and use server SDK version 4.x for Amazon GameLift Servers, first update the game server build to server SDK 5.x, and then deploy to AL2023 instances. See Migrate to server SDK version 5.

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 Servers. For more information see Integrate games with custom game servers. By default Amazon GameLift Servers 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 Servers 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 Servers will report a SizeOnDisk of 0.

Required: No

Type: StorageLocation

Update requires: Replacement

Tags

Property description not available.

Required: No

Type: Array of Tag

Maximum: 200

Update requires: No interruption

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.

BuildArn

The Amazon Resource Name (ARN) that is assigned to a Amazon GameLift Servers build resource and uniquely identifies it. ARNs are unique across all Regions. Format is arn:aws:gamelift:<region>::build/build-a1234567-b8c9-0d1e-2fa3-b45c6d7e8912. In a GameLift build ARN, the resource ID matches the BuildId value.

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 AWS 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:::amzn-s3-demo-bucket/*" ] } ] } } ] } }, "BuildResource": { "Type": "AWS::GameLift::Build", "Properties": { "Name": "MyGameServerBuild", "Version": "v1.0", "OperatingSystem": "WINDOWS_2012", "ServerSdkVersion: "5.0.0", "StorageLocation": { "Bucket": "amzn-s3-demo-bucket", "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:::amzn-s3-demo-bucket/*" BuildResource: Type: AWS::GameLift::Build Properties: Name: MyGameServerBuild Version: v1.0 OperatingSystem: WINDOWS_2012 ServerSdkVersion: 5.0.0 StorageLocation: Bucket: "amzn-s3-demo-bucket" Key: "MyGameBuildFiles.zip" RoleArn: !GetAtt IAMRole.Arn

See also

下一主题:

StorageLocation

上一主题:

Tag

本页内容

隐私网站条款Cookie 首选项
© 2025, Amazon Web Services, Inc. 或其附属公司。保留所有权利。