CreateBuild

Creates a new Amazon GameLift build record for your game server binary files and points
to
the location of your game server build files in an Amazon Simple Storage Service (Amazon
S3)
location.

Game server binaries must be combined into a .zip file for use with
Amazon GameLift.

Important

To create new builds quickly and easily, use the AWS CLI command upload-build. This helper command uploads your build and
creates a new build record in one step, and automatically handles the necessary
permissions.

The CreateBuild operation should be used only when you need to
manually upload your build files, as in the following scenarios:

Store a build file in an Amazon S3 bucket under your own AWS account. To use
this option, you must first give Amazon GameLift access to that Amazon S3 bucket.
To create a
new build record using files in your Amazon S3 bucket, call CreateBuild
and specify a build name, operating system, and the storage location of your
game build.

Upload a build file directly to Amazon GameLift's Amazon S3 account. To use this option,
you first call CreateBuild with a build name and operating system.
This action creates a new build record and returns an Amazon S3 storage location
(bucket and key only) and temporary access credentials. Use the credentials to
manually upload your build file to the storage location (see the Amazon S3 topic
Uploading Objects). You can upload files to a location only once.

If successful, this operation creates a new build record with a unique build ID and
places it in INITIALIZED status. You can use DescribeBuild to check the status of your build. A build must be in READY status
before it can be used to create fleets.

Operating system that the game server binaries are built to run on. This value
determines the type of fleet resources that you can use for this build. If your game
build contains multiple executables, they all must run on the same operating system.
If
an operating system is not specified when creating a build, Amazon GameLift uses the
default value (WINDOWS_2012). This value cannot be changed later.

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, as well as a the ARN for a
role that you set up
to allow Amazon GameLift to access your Amazon S3 bucket. The S3 bucket must be in
the same region
that you want to create a new build in.

This element is returned only when the operation is called without a storage
location. It contains credentials to use when you are uploading a build file to an
Amazon S3
bucket that is owned by Amazon GameLift. Credentials have a limited life span. To
refresh these
credentials, call RequestUploadCredentials.

Errors

For information about the errors that are common to all actions, see Common Errors.

ConflictException

The requested operation would cause a conflict with the current state of a service
resource associated with the request. Resolve the conflict before retrying this
request.

HTTP Status Code: 400

InternalServiceException

The service encountered an unrecoverable internal failure while processing the
request. Clients can retry such requests immediately or after a waiting
period.

HTTP Status Code: 500

InvalidRequestException

One or more parameter values in the request are invalid. Correct the invalid
parameter values before retrying.

HTTP Status Code: 400

UnauthorizedException

The client failed authentication. Clients should not retry such requests.

HTTP Status Code: 400

Examples

Create a build with files in your own S3 bucket

This example creates a new build record using a build file that is stored
in your own Amazon S3 bucket. The example assumes that you've already created a role
that gives Amazon GameLift permission to access your bucket. Once the build file
is successfully validated, the new build's status changes to READY. Notice that
the example request does not specify an operating system; in this scenario, the
new build defaults to WINDOWS_2012.

This example creates a new build record AND gets a storage location and
temporary credentials that allow you to manually upload a game build to
Amazon GameLift's Amazon S3 account. Once you've successfully uploaded your build,
the
Amazon GameLift service is notified and the new build's status changes to READY.