Resource Type definition for AWS::GameLift::Build
IMPORTANT: The S3 permissions listed in the example are meant for testing purposes only. Restrict these permissions further for enhanced security. Currently the valid values for operating_system
are WINDOWS_2012
, AMAZON_LINUX
, or AMAZON_LINUX_2
.
To use awscc_gamelift_build to create a GameLift build:
resource "awscc_gamelift_build" "example" {
name = "example-build"
version = "1"
operating_system = "AMAZON_LINUX_2"
storage_location = {
bucket = "your-s3-bucket"
key = "your-s3-key"
role_arn = awscc_iam_role.example.arn
}
}
resource "awscc_iam_role" "example" {
role_name = "gamelift-s3-access"
description = "This IAM role grants Amazon GameLift access to the S3 bucket containing build files"
assume_role_policy_document = data.aws_iam_policy_document.instance_assume_role_policy.json
managed_policy_arns = [aws_iam_policy.example.arn]
max_session_duration = 7200
path = "/"
tags = [
{
key = "Environment"
value = "Development"
},
{
key = "Modified By"
value = "AWSCC"
}
]
}
data "aws_iam_policy_document" "instance_assume_role_policy" {
statement {
actions = ["sts:AssumeRole"]
principals {
type = "Service"
identifiers = ["gamelift.amazonaws.com"]
}
}
}
resource "aws_iam_policy" "example" {
name = "gamelift-s3-access-policy"
policy = jsonencode({
Version = "2012-10-17"
Statement = [
{
Effect = "Allow"
Action = ["s3:*"]
Resource = "*"
},
]
})
}
name
(String) A descriptive label that is associated with a build. Build names do not need to be unique.operating_system
(String) The 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.server_sdk_version
(String) A server SDK version you used when integrating your game server build with Amazon GameLift. By default Amazon GameLift sets this value to 4.0.2.storage_location
(Attributes) 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. (see below for nested schema)version
(String) Version information that is associated with this build. Version strings do not need to be unique.build_id
(String) A unique identifier for a build to be deployed on the new fleet. If you are deploying the fleet with a custom game build, you must specify this property. The build must have been successfully uploaded to Amazon GameLift and be in a READY status. This fleet setting cannot be changed once the fleet is created.id
(String) Uniquely identifies the resource.storage_location
Required:
bucket
(String) An Amazon S3 bucket identifier. This is the name of the S3 bucket.key
(String) The name of the zip file that contains the build files or script files.role_arn
(String) The Amazon Resource Name (ARN) for an IAM role that allows Amazon GameLift to access the S3 bucket.Optional:
object_version
(String) The version of the file, if object versioning is turned on for the bucket. Amazon GameLift uses this information when retrieving files from your S3 bucket. To retrieve a specific version of the file, provide an object version. To retrieve the latest version of the file, do not set this parameter.Import is supported using the following syntax:
$ terraform import awscc_gamelift_build.example <resource ID>