create_build
(**kwargs)¶Creates a new Amazon GameLift build resource for your game server binary files. Combine game server binaries into a zip file for use with Amazon GameLift.
Warning
When setting up a new game build for GameLift, we recommend using the CLI command upload-build . This helper command combines two tasks: (1) it uploads your build files from a file directory to a GameLift Amazon S3 location, and (2) it creates a new build resource.
You can use the operation in the following scenarios:
If successful, this operation creates a new build resource with a unique build ID and places it in INITIALIZED
status. A build must be in READY
status before you can create fleets with it.
See also: AWS API Documentation
Request Syntax
response = client.create_build(
Name='string',
Version='string',
StorageLocation={
'Bucket': 'string',
'Key': 'string',
'RoleArn': 'string',
'ObjectVersion': 'string'
},
OperatingSystem='WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
Tags=[
{
'Key': 'string',
'Value': 'string'
},
],
ServerSdkVersion='string'
)
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.
An Amazon S3 bucket identifier. Thename of the S3 bucket.
Note
GameLift doesn't support uploading from Amazon S3 buckets with names that contain a dot (.).
The name of the zip file that contains the build files or script files.
The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access the S3 bucket.
The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.
A list of labels to assign to the new build resource. Tags are developer defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services General Reference . Once the resource is created, you can use TagResource, UntagResource, and ListTagsForResource to add, remove, and view tags. The maximum tag limit may be lower than stated. See the Amazon Web Services General Reference for actual tagging limits.
A label that can be assigned to a GameLift resource.
Learn moreTagging Amazon Web Services Resources in the Amazon Web Services General Reference
Amazon Web Services Tagging Strategies
Related actions
The key for a developer-defined key:value pair for tagging an Amazon Web Services resource.
The value for a developer-defined key:value pair for tagging an Amazon Web Services resource.
dict
Response Syntax
{
'Build': {
'BuildId': 'string',
'BuildArn': 'string',
'Name': 'string',
'Version': 'string',
'Status': 'INITIALIZED'|'READY'|'FAILED',
'SizeOnDisk': 123,
'OperatingSystem': 'WINDOWS_2012'|'AMAZON_LINUX'|'AMAZON_LINUX_2',
'CreationTime': datetime(2015, 1, 1),
'ServerSdkVersion': 'string'
},
'UploadCredentials': {
'AccessKeyId': 'string',
'SecretAccessKey': 'string',
'SessionToken': 'string'
},
'StorageLocation': {
'Bucket': 'string',
'Key': 'string',
'RoleArn': 'string',
'ObjectVersion': 'string'
}
}
Response Structure
(dict) --
Build (dict) --
The newly created build resource, including a unique build IDs and status.
BuildId (string) --
A unique identifier for the build.
BuildArn (string) --
The Amazon Resource Name ( ARN ) assigned to a GameLift 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.
Name (string) --
A descriptive label associated with a build. Build names do not need to be unique. It can be set using CreateBuild or UpdateBuild.
Version (string) --
Version information associated with a build or script. Version strings do not need to be unique.
Status (string) --
Current status of the build.
Possible build statuses include the following:
SizeOnDisk (integer) --
File size of the uploaded game build, expressed in bytes. When the build status is INITIALIZED
or when using a custom Amazon S3 storage location, this value is 0.
OperatingSystem (string) --
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.
CreationTime (datetime) --
A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057"
).
ServerSdkVersion (string) --
The GameLift Server SDK version used to develop your game server.
UploadCredentials (dict) --
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.
AccessKeyId (string) --
Temporary key allowing access to the Amazon GameLift S3 account.
SecretAccessKey (string) --
Temporary secret key allowing access to the Amazon GameLift S3 account.
SessionToken (string) --
Token used to associate a specific build ID with the files uploaded using these credentials.
StorageLocation (dict) --
Amazon S3 location for your game build file, including bucket name and key.
Bucket (string) --
An Amazon S3 bucket identifier. Thename of the S3 bucket.
Note
GameLift doesn't support uploading from Amazon S3 buckets with names that contain a dot (.).
Key (string) --
The name of the zip file that contains the build files or script files.
RoleArn (string) --
The Amazon Resource Name ( ARN ) for an IAM role that allows Amazon GameLift to access the S3 bucket.
ObjectVersion (string) --
The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from an S3 bucket that you own. Use this parameter to specify a specific version of the file. If not set, the latest version of the file is retrieved.
Exceptions
GameLift.Client.exceptions.UnauthorizedException
GameLift.Client.exceptions.InvalidRequestException
GameLift.Client.exceptions.ConflictException
GameLift.Client.exceptions.TaggingFailedException
GameLift.Client.exceptions.InternalServiceException