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).
Create a build with
files in Amazon S3
You can store your build files in Amazon S3 and upload them to Amazon GameLift Servers from there. When
you create you build, you specify the S3 bucket location, and Amazon GameLift Servers retrieves the
build files directly from Amazon S3.
To create a build resource
-
Store your build files in Amazon S3. Create a
.zip file containing the packaged build files and upload it to an S3 bucket
in your Amazon Web Services account. Take note of the bucket label and the file name,
you'll need these when creating a Amazon GameLift Servers build.
-
Give Amazon GameLift Servers access to your build files.
Create an IAM role by following the instructions in Access a
game build file in Amazon S3. After you've created the role, take note of the new role's Amazon
Resource Name (ARN), you'll need this when creating a build.
-
Create a build. Use the Amazon GameLift Servers console or
the Amazon CLI to create a new build record. You must have the
PassRole
permission, as described in IAM permission examples for Amazon GameLift Servers.
- Console
-
-
In the Amazon GameLift Servers
console, in the navigation pane, choose
Hosting,
Builds.
-
On the Builds page, choose
Create build.
-
On the Create build page, under
Build settings, do the
following:
-
For Name, enter a script
name.
-
For Version, enter a version.
Because you can update the content of a build, version
data can help you track updates.
-
For Operating system (OS), choose
the OS of your game server build. You can't update this
value later.
-
For Game server build, enter the
S3 URI of the build object that
you uploaded to Amazon S3, and choose the Object
version. If you don't remember the Amazon S3
URI and object version, choose Browse
S3 and search for the build
object.
-
For IAM role, choose the role
that you created that gives Amazon GameLift Servers access to your S3
bucket and build object.
-
(Optional) Under Tags, add tags to the
build by entering Key and
Value pairs.
-
Choose Create.
Amazon GameLift Servers assigns an ID to the new build and uploads the
designated .zip file. You can view the new build, including the
status, on the Builds page.
- Amazon CLI
-
To define the new build and upload your server build files, use
the create-build
command.
-
Open a command line window and switch to a directory where you
can use the Amazon CLI.
-
Enter the following create-build
command:
aws gamelift create-build \
--name user-defined name of build
\
--server-sdk-version server SDK for Amazon GameLift Servers version
\
--operating-system supported OS
\
--build-version user-defined build number
\
--storage-location "Bucket"=S3 bucket label
,"Key"=Build .zip file name
,"RoleArn"=Access role ARN
} \
--region region name
-
name – A descriptive name
for the new build.
-
server-sdk-version – The
version of the server SDK for Amazon GameLift Servers you used to integrate
your game server with Amazon GameLift Servers. If you don't provide a
value, Amazon GameLift Servers uses the default value
4.0.2
.
-
operating-system – The game
server build's runtime environment. You must specify an
OS value. You can't update this later.
-
build-version – The version
details for the build files. This information can be
useful because each new version of your game server
requires a new build resource.
-
storage-location
-
Bucket – The name of
the S3 bucket that contains your build. For
example, "my_build_files".
-
Key – The name of
the .zip file that contains your build files. For
example, "my_game_build_7.0.1, 7.0.2".
-
RoleARN – The ARN
assigned to the IAM role that you created. For
example,
"arn:aws-cn:iam::111122223333:role/GameLiftAccess".
For an example policy, see Access a
game build file in Amazon S3.
-
region – Create the build in
the Amazon Region where you plan to deploy fleets. If
you're deploying your game in multiple Regions, create a
build in each Region.
We recommend checking your current default Region
using the configure get
command. To change your default
Region, use the configure set
command.
Example
aws gamelift create-build \
--operating-system WINDOWS_2016 \
--storage-location "Bucket"="my_game_build_files","Key"="mygame_build_101.zip","RoleArn"="arn:aws:iam::111122223333:role/gamelift" \
--name "My Game Nightly Build" \
--build-version "build 101" \
--region us-west-2
-
To view the new build, use the describe-build
command.