RequestUploadCredentials - Amazon GameLift Service
AWS services or capabilities described in AWS documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with AWS services in China.

RequestUploadCredentials

Retrieves a fresh set of credentials for use when uploading a new set of game build files to Amazon GameLift's Amazon S3. This is done as part of the build creation process; see CreateBuild.

To request new credentials, specify the build ID as returned with an initial CreateBuild request. If successful, a new set of credentials are returned, along with the S3 storage location associated with the build ID.

Learn more

Create a Build with Files in S3

Related operations

Request Syntax

{ "BuildId": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

BuildId

A unique identifier for a build to get credentials for. You can use either the build ID or ARN value.

Type: String

Pattern: ^build-\S+|^arn:.*:build\/build-\S+

Required: Yes

Response Syntax

{ "StorageLocation": { "Bucket": "string", "Key": "string", "ObjectVersion": "string", "RoleArn": "string" }, "UploadCredentials": { "AccessKeyId": "string", "SecretAccessKey": "string", "SessionToken": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

StorageLocation

Amazon S3 path and key, identifying where the game build files are stored.

Type: S3Location object

UploadCredentials

AWS credentials required when uploading a game build to the storage location. These credentials have a limited lifespan and are valid only for the build they were issued for.

Type: AwsCredentials object

Errors

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

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

NotFoundException

A service resource associated with the request could not be found. Clients should not retry such requests.

HTTP Status Code: 400

UnauthorizedException

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

HTTP Status Code: 400

Example

Refresh access credentials for uploading a build

This example obtains new, valid access credentials for uploading a build file to a GameLift S3 location. Credentials have a limited lift span. The build ID required for this operation is returned in response to the original CreateBuild request.

HTTP requests are authenticated using an AWS Signature Version 4 signature in the Authorization header field.

Sample Request

{ "BuildId": "build-1111aaaa-22bb-33cc-44dd-5555eeee66ff" }

Sample Response

{ "StorageLocation": { "Bucket": "gamelift-builds-us-west-2", "Key": "123456789012/build-1111aaaa-22bb-33cc-44dd-5555eeee66ff" }, "UploadCredentials": { "AccessKeyId": "AKIAIOSFODNN7EXAMPLE", "SecretAccessKey": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "SessionToken": "AgoGb3JpZ2luENz...EXAMPLETOKEN==" } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: