Skip to main content

scripts

Creates, updates, deletes, gets or lists a scripts resource.

Overview

Namescripts
TypeResource
Idaws.gamelift.scripts

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
creation_timestring (date-time)A time stamp indicating when this data object was created. Format is a number expressed in Unix time as milliseconds (for example "1469498468.057").
namestringA descriptive label that is associated with a script. Script names do not need to be unique.
node_js_versionstringThe Node.js version used for execution of your Realtime script. The valid values are 10.x | 24.x. By default, NodeJsVersion is 10.x. This value cannot be updated later. Node.js 10 will reach end of support on September 30, 2026. See more details in the Node.js 10 FAQs. For migration guidance, see Migrating from Node.js 10 to 24. (pattern: <code>^[0-9]+.(?:x|[0-9]+)$</code>)
script_arnstringThe Amazon Resource Name (ARN) that is assigned to a Amazon GameLift Servers script resource and uniquely identifies it. ARNs are unique across all Regions. In a GameLift script ARN, the resource ID matches the ScriptId value. (pattern: <code>^arn:.*:script/script-\S+$</code>)
script_idstringA unique identifier for the Realtime script (pattern: <code>^script-\S+$</code>)
size_on_diskinteger (int64)The file size of the uploaded Realtime script, expressed in bytes. When files are uploaded from an S3 location, this value remains at "0".
storage_locationobjectThe 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.
versionstringVersion information that is associated with a build or script. Version strings do not need to be unique.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_scriptselectregionThis API works with the following fleet types: EC2 Retrieves properties for a Realtime script. To request a script record, specify the script ID. If successful, an object containing the script properties is returned. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task
list_scriptsselectregionThis API works with the following fleet types: EC2 Retrieves script records for all Realtime scripts that are associated with the Amazon Web Services account in use. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task
create_scriptinsertregionThis API works with the following fleet types: EC2, Anywhere Creates a new script record for your Amazon GameLift Servers Realtime 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 Amazon GameLift Servers Realtime fleet to host your game sessions. Script logic is executed during an active game session. To create a new script record, specify a script name and provide the script file(s). The script files and all dependencies must be zipped into a single file. You can pull the zip file from either of these locations: A locally available directory. Use the ZipFile parameter for this option. An Amazon Simple Storage Service (Amazon S3) bucket under your Amazon Web Services account. Use the StorageLocation parameter for this option. You'll need to have an Identity Access Management (IAM) role that allows the Amazon GameLift Servers service to access your S3 bucket. If the call is successful, a new script record is created with a unique script ID. If the script file is provided as a local file, the file is uploaded to an Amazon GameLift Servers-owned S3 bucket and the script record's storage location reflects this location. If the script file is provided as an S3 bucket, Amazon GameLift Servers accesses the file at this storage location as needed for deployment. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Set Up a Role for Amazon GameLift Servers Access Related actions All APIs by task
update_scriptupdateregion, ScriptIdThis API works with the following fleet types: EC2 Updates Realtime script metadata and content. To update script metadata, specify the script ID and provide updated name and/or version values. To update script content, provide an updated zip file by pointing to either a local file or an Amazon S3 bucket location. You can use either method regardless of how the original script was uploaded. Use the Version parameter to track updates to the script. If the call is successful, the updated metadata is stored in the script record and a revised script is uploaded to the Amazon GameLift Servers service. Once the script is updated and acquired by a fleet instance, the new version is used for all new game sessions. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task
delete_scriptdeleteregionThis API works with the following fleet types: EC2 Deletes a Realtime script. This operation permanently deletes the script record. If script files were uploaded, they are also deleted (files stored in an S3 bucket are not deleted). To delete a script, specify the script ID. Before deleting a script, be sure to terminate all fleets that are deployed with the script being deleted. Fleet instances periodically check for script updates, and if the script record no longer exists, the instance will go into an error state and be unable to host game sessions. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
regionstringAWS region (default: us-east-1)

SELECT examples

This API works with the following fleet types: EC2 Retrieves properties for a Realtime script. To request a script record, specify the script ID. If successful, an object containing the script properties is returned. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task

SELECT
creation_time,
name,
node_js_version,
script_arn,
script_id,
size_on_disk,
storage_location,
version
FROM aws.gamelift.scripts
WHERE region = '{{ region }}' -- required
;

INSERT examples

This API works with the following fleet types: EC2, Anywhere Creates a new script record for your Amazon GameLift Servers Realtime 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 Amazon GameLift Servers Realtime fleet to host your game sessions. Script logic is executed during an active game session. To create a new script record, specify a script name and provide the script file(s). The script files and all dependencies must be zipped into a single file. You can pull the zip file from either of these locations: A locally available directory. Use the ZipFile parameter for this option. An Amazon Simple Storage Service (Amazon S3) bucket under your Amazon Web Services account. Use the StorageLocation parameter for this option. You'll need to have an Identity Access Management (IAM) role that allows the Amazon GameLift Servers service to access your S3 bucket. If the call is successful, a new script record is created with a unique script ID. If the script file is provided as a local file, the file is uploaded to an Amazon GameLift Servers-owned S3 bucket and the script record's storage location reflects this location. If the script file is provided as an S3 bucket, Amazon GameLift Servers accesses the file at this storage location as needed for deployment. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Set Up a Role for Amazon GameLift Servers Access Related actions All APIs by task

INSERT INTO aws.gamelift.scripts (
Name,
Version,
StorageLocation,
ZipFile,
Tags,
NodeJsVersion,
region
)
SELECT
'{{ Name }}',
'{{ Version }}',
'{{ StorageLocation }}',
'{{ ZipFile }}',
'{{ Tags }}',
'{{ NodeJsVersion }}',
'{{ region }}'
RETURNING
script
;

UPDATE examples

This API works with the following fleet types: EC2 Updates Realtime script metadata and content. To update script metadata, specify the script ID and provide updated name and/or version values. To update script content, provide an updated zip file by pointing to either a local file or an Amazon S3 bucket location. You can use either method regardless of how the original script was uploaded. Use the Version parameter to track updates to the script. If the call is successful, the updated metadata is stored in the script record and a revised script is uploaded to the Amazon GameLift Servers service. Once the script is updated and acquired by a fleet instance, the new version is used for all new game sessions. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task

UPDATE aws.gamelift.scripts
SET
ScriptId = '{{ ScriptId }}',
Name = '{{ Name }}',
Version = '{{ Version }}',
StorageLocation = '{{ StorageLocation }}',
ZipFile = '{{ ZipFile }}'
WHERE
region = '{{ region }}' --required
AND ScriptId = '{{ ScriptId }}' --required
RETURNING
script;

DELETE examples

This API works with the following fleet types: EC2 Deletes a Realtime script. This operation permanently deletes the script record. If script files were uploaded, they are also deleted (files stored in an S3 bucket are not deleted). To delete a script, specify the script ID. Before deleting a script, be sure to terminate all fleets that are deployed with the script being deleted. Fleet instances periodically check for script updates, and if the script record no longer exists, the instance will go into an error state and be unable to host game sessions. Learn more Amazon GameLift Servers Amazon GameLift Servers Realtime Related actions All APIs by task

DELETE FROM aws.gamelift.scripts
WHERE region = '{{ region }}' --required
;