1. Packages
  2. AWS
  3. API Docs
  4. gamelift
  5. Script
AWS v6.77.0 published on Wednesday, Apr 9, 2025 by Pulumi

aws.gamelift.Script

Explore with Pulumi AI

Provides an GameLift Script resource.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";

const example = new aws.gamelift.Script("example", {
    name: "example-script",
    storageLocation: {
        bucket: exampleAwsS3Bucket.id,
        key: exampleAwsS3Object.key,
        roleArn: exampleAwsIamRole.arn,
    },
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.gamelift.Script("example",
    name="example-script",
    storage_location={
        "bucket": example_aws_s3_bucket["id"],
        "key": example_aws_s3_object["key"],
        "role_arn": example_aws_iam_role["arn"],
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/gamelift"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := gamelift.NewScript(ctx, "example", &gamelift.ScriptArgs{
			Name: pulumi.String("example-script"),
			StorageLocation: &gamelift.ScriptStorageLocationArgs{
				Bucket:  pulumi.Any(exampleAwsS3Bucket.Id),
				Key:     pulumi.Any(exampleAwsS3Object.Key),
				RoleArn: pulumi.Any(exampleAwsIamRole.Arn),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = new Aws.GameLift.Script("example", new()
    {
        Name = "example-script",
        StorageLocation = new Aws.GameLift.Inputs.ScriptStorageLocationArgs
        {
            Bucket = exampleAwsS3Bucket.Id,
            Key = exampleAwsS3Object.Key,
            RoleArn = exampleAwsIamRole.Arn,
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.gamelift.Script;
import com.pulumi.aws.gamelift.ScriptArgs;
import com.pulumi.aws.gamelift.inputs.ScriptStorageLocationArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var example = new Script("example", ScriptArgs.builder()
            .name("example-script")
            .storageLocation(ScriptStorageLocationArgs.builder()
                .bucket(exampleAwsS3Bucket.id())
                .key(exampleAwsS3Object.key())
                .roleArn(exampleAwsIamRole.arn())
                .build())
            .build());

    }
}
Copy
resources:
  example:
    type: aws:gamelift:Script
    properties:
      name: example-script
      storageLocation:
        bucket: ${exampleAwsS3Bucket.id}
        key: ${exampleAwsS3Object.key}
        roleArn: ${exampleAwsIamRole.arn}
Copy

Create Script Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Script(name: string, args?: ScriptArgs, opts?: CustomResourceOptions);
@overload
def Script(resource_name: str,
           args: Optional[ScriptArgs] = None,
           opts: Optional[ResourceOptions] = None)

@overload
def Script(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           name: Optional[str] = None,
           storage_location: Optional[ScriptStorageLocationArgs] = None,
           tags: Optional[Mapping[str, str]] = None,
           version: Optional[str] = None,
           zip_file: Optional[str] = None)
func NewScript(ctx *Context, name string, args *ScriptArgs, opts ...ResourceOption) (*Script, error)
public Script(string name, ScriptArgs? args = null, CustomResourceOptions? opts = null)
public Script(String name, ScriptArgs args)
public Script(String name, ScriptArgs args, CustomResourceOptions options)
type: aws:gamelift:Script
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args ScriptArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args ScriptArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args ScriptArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args ScriptArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ScriptArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var scriptResource = new Aws.GameLift.Script("scriptResource", new()
{
    Name = "string",
    StorageLocation = new Aws.GameLift.Inputs.ScriptStorageLocationArgs
    {
        Bucket = "string",
        Key = "string",
        RoleArn = "string",
        ObjectVersion = "string",
    },
    Tags = 
    {
        { "string", "string" },
    },
    Version = "string",
    ZipFile = "string",
});
Copy
example, err := gamelift.NewScript(ctx, "scriptResource", &gamelift.ScriptArgs{
	Name: pulumi.String("string"),
	StorageLocation: &gamelift.ScriptStorageLocationArgs{
		Bucket:        pulumi.String("string"),
		Key:           pulumi.String("string"),
		RoleArn:       pulumi.String("string"),
		ObjectVersion: pulumi.String("string"),
	},
	Tags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	Version: pulumi.String("string"),
	ZipFile: pulumi.String("string"),
})
Copy
var scriptResource = new Script("scriptResource", ScriptArgs.builder()
    .name("string")
    .storageLocation(ScriptStorageLocationArgs.builder()
        .bucket("string")
        .key("string")
        .roleArn("string")
        .objectVersion("string")
        .build())
    .tags(Map.of("string", "string"))
    .version("string")
    .zipFile("string")
    .build());
Copy
script_resource = aws.gamelift.Script("scriptResource",
    name="string",
    storage_location={
        "bucket": "string",
        "key": "string",
        "role_arn": "string",
        "object_version": "string",
    },
    tags={
        "string": "string",
    },
    version="string",
    zip_file="string")
Copy
const scriptResource = new aws.gamelift.Script("scriptResource", {
    name: "string",
    storageLocation: {
        bucket: "string",
        key: "string",
        roleArn: "string",
        objectVersion: "string",
    },
    tags: {
        string: "string",
    },
    version: "string",
    zipFile: "string",
});
Copy
type: aws:gamelift:Script
properties:
    name: string
    storageLocation:
        bucket: string
        key: string
        objectVersion: string
        roleArn: string
    tags:
        string: string
    version: string
    zipFile: string
Copy

Script Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Script resource accepts the following input properties:

Name string
Name of the script
StorageLocation Changes to this property will trigger replacement. ScriptStorageLocation
Information indicating where your game script files are stored. See below.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Version string
Version that is associated with this script.
ZipFile string
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
Name string
Name of the script
StorageLocation Changes to this property will trigger replacement. ScriptStorageLocationArgs
Information indicating where your game script files are stored. See below.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
Version string
Version that is associated with this script.
ZipFile string
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
name String
Name of the script
storageLocation Changes to this property will trigger replacement. ScriptStorageLocation
Information indicating where your game script files are stored. See below.
tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
version String
Version that is associated with this script.
zipFile String
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
name string
Name of the script
storageLocation Changes to this property will trigger replacement. ScriptStorageLocation
Information indicating where your game script files are stored. See below.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
version string
Version that is associated with this script.
zipFile string
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
name str
Name of the script
storage_location Changes to this property will trigger replacement. ScriptStorageLocationArgs
Information indicating where your game script files are stored. See below.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
version str
Version that is associated with this script.
zip_file str
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
name String
Name of the script
storageLocation Changes to this property will trigger replacement. Property Map
Information indicating where your game script files are stored. See below.
tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
version String
Version that is associated with this script.
zipFile String
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.

Outputs

All input properties are implicitly available as output properties. Additionally, the Script resource produces the following output properties:

Arn string
GameLift Script ARN.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Arn string
GameLift Script ARN.
Id string
The provider-assigned unique ID for this managed resource.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
GameLift Script ARN.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn string
GameLift Script ARN.
id string
The provider-assigned unique ID for this managed resource.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn str
GameLift Script ARN.
id str
The provider-assigned unique ID for this managed resource.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

arn String
GameLift Script ARN.
id String
The provider-assigned unique ID for this managed resource.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Look up Existing Script Resource

Get an existing Script resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ScriptState, opts?: CustomResourceOptions): Script
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        arn: Optional[str] = None,
        name: Optional[str] = None,
        storage_location: Optional[ScriptStorageLocationArgs] = None,
        tags: Optional[Mapping[str, str]] = None,
        tags_all: Optional[Mapping[str, str]] = None,
        version: Optional[str] = None,
        zip_file: Optional[str] = None) -> Script
func GetScript(ctx *Context, name string, id IDInput, state *ScriptState, opts ...ResourceOption) (*Script, error)
public static Script Get(string name, Input<string> id, ScriptState? state, CustomResourceOptions? opts = null)
public static Script get(String name, Output<String> id, ScriptState state, CustomResourceOptions options)
resources:  _:    type: aws:gamelift:Script    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
Arn string
GameLift Script ARN.
Name string
Name of the script
StorageLocation Changes to this property will trigger replacement. ScriptStorageLocation
Information indicating where your game script files are stored. See below.
Tags Dictionary<string, string>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll Dictionary<string, string>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Version string
Version that is associated with this script.
ZipFile string
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
Arn string
GameLift Script ARN.
Name string
Name of the script
StorageLocation Changes to this property will trigger replacement. ScriptStorageLocationArgs
Information indicating where your game script files are stored. See below.
Tags map[string]string
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
TagsAll map[string]string
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

Version string
Version that is associated with this script.
ZipFile string
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
arn String
GameLift Script ARN.
name String
Name of the script
storageLocation Changes to this property will trigger replacement. ScriptStorageLocation
Information indicating where your game script files are stored. See below.
tags Map<String,String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String,String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

version String
Version that is associated with this script.
zipFile String
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
arn string
GameLift Script ARN.
name string
Name of the script
storageLocation Changes to this property will trigger replacement. ScriptStorageLocation
Information indicating where your game script files are stored. See below.
tags {[key: string]: string}
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll {[key: string]: string}
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

version string
Version that is associated with this script.
zipFile string
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
arn str
GameLift Script ARN.
name str
Name of the script
storage_location Changes to this property will trigger replacement. ScriptStorageLocationArgs
Information indicating where your game script files are stored. See below.
tags Mapping[str, str]
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tags_all Mapping[str, str]
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

version str
Version that is associated with this script.
zip_file str
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.
arn String
GameLift Script ARN.
name String
Name of the script
storageLocation Changes to this property will trigger replacement. Property Map
Information indicating where your game script files are stored. See below.
tags Map<String>
Key-value map of resource tags. If configured with a provider default_tags configuration block present, tags with matching keys will overwrite those defined at the provider-level.
tagsAll Map<String>
A map of tags assigned to the resource, including those inherited from the provider default_tags configuration block.

Deprecated: Please use tags instead.

version String
Version that is associated with this script.
zipFile String
A data object containing your Realtime scripts and dependencies as a zip file. The zip file can have one or multiple files. Maximum size of a zip file is 5 MB.

Supporting Types

ScriptStorageLocation
, ScriptStorageLocationArgs

Bucket This property is required. string
Name of your S3 bucket.
Key This property is required. string
Name of the zip file containing your script files.
RoleArn This property is required. string
ARN of the access role that allows Amazon GameLift to access your S3 bucket.
ObjectVersion string
A specific version of the file. If not set, the latest version of the file is retrieved.
Bucket This property is required. string
Name of your S3 bucket.
Key This property is required. string
Name of the zip file containing your script files.
RoleArn This property is required. string
ARN of the access role that allows Amazon GameLift to access your S3 bucket.
ObjectVersion string
A specific version of the file. If not set, the latest version of the file is retrieved.
bucket This property is required. String
Name of your S3 bucket.
key This property is required. String
Name of the zip file containing your script files.
roleArn This property is required. String
ARN of the access role that allows Amazon GameLift to access your S3 bucket.
objectVersion String
A specific version of the file. If not set, the latest version of the file is retrieved.
bucket This property is required. string
Name of your S3 bucket.
key This property is required. string
Name of the zip file containing your script files.
roleArn This property is required. string
ARN of the access role that allows Amazon GameLift to access your S3 bucket.
objectVersion string
A specific version of the file. If not set, the latest version of the file is retrieved.
bucket This property is required. str
Name of your S3 bucket.
key This property is required. str
Name of the zip file containing your script files.
role_arn This property is required. str
ARN of the access role that allows Amazon GameLift to access your S3 bucket.
object_version str
A specific version of the file. If not set, the latest version of the file is retrieved.
bucket This property is required. String
Name of your S3 bucket.
key This property is required. String
Name of the zip file containing your script files.
roleArn This property is required. String
ARN of the access role that allows Amazon GameLift to access your S3 bucket.
objectVersion String
A specific version of the file. If not set, the latest version of the file is retrieved.

Import

Using pulumi import, import GameLift Scripts using the ID. For example:

$ pulumi import aws:gamelift/script:Script example <script-id>
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.