AWS Fundamentals Logo
AWS Fundamentals
L1 ConstructAWS::GameLift::Script

CfnScript

The `AWS::GameLift::Script` resource creates a new script record for your Realtime Servers script. Realtime scripts are JavaScript that provide configuration settings and optional custom game logic for your game. The script is deployed when you create a Realtime Servers fleet to host your game sessions. Script logic is executed during an active game session.

Import

import { CfnScript } from 'aws-cdk-lib/aws-gamelift';

Or use the module namespace:

import * as gamelift from 'aws-cdk-lib/aws-gamelift';
// gamelift.CfnScript

Properties

Configuration passed to the constructor as CfnScriptProps.

storageLocationRequired
IResolvable | S3LocationProperty

The location of the Amazon S3 bucket where a zipped file containing your Realtime scripts is stored. The storage location must specify the Amazon S3 bucket name, the zip file name (the "key"), and a role ARN that allows Amazon GameLift Servers to access the Amazon S3 storage location. The S3 bucket must be in the same Region where you want to create a new script. By default, Amazon GameLift Servers uploads the latest version of the zip file; if you have S3 object versioning turned on, you can use the `ObjectVersion` parameter to specify an earlier version.

nameOptional
string

A descriptive label that is associated with a script. Script names do not need to be unique.

nodeJsVersionOptional
string

The Node.js version used for execution of the Realtime script.

tagsOptional
CfnTag[]

A list of labels to assign to the new script resource. Tags are developer-defined key-value pairs. Tagging AWS resources are useful for resource management, access management and cost allocation. For more information, see [Tagging AWS Resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *AWS 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 AWS General Reference for actual tagging limits.

versionOptional
string

The version that is associated with a build or script. Version strings do not need to be unique.

CloudFormation Resource

This L1 construct maps directly to the following CloudFormation resource type.

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter