scripts
Creates, updates, deletes, gets or lists a scripts resource.
Overview
| Name | scripts |
| Type | Resource |
| Id | aws.gamelift.scripts |
Fields
The following fields are returned by SELECT queries:
- describe_script
- list_scripts
| Name | Datatype | Description |
|---|---|---|
creation_time | string (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"). |
name | string | A descriptive label that is associated with a script. Script names do not need to be unique. |
node_js_version | string | The 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_arn | string | The 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_id | string | A unique identifier for the Realtime script (pattern: <code>^script-\S+$</code>) |
size_on_disk | integer (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_location | object | 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. |
version | string | Version information that is associated with a build or script. Version strings do not need to be unique. |
| Name | Datatype | Description |
|---|---|---|
creation_time | string (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"). |
name | string | A descriptive label that is associated with a script. Script names do not need to be unique. |
node_js_version | string | The 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_arn | string | The 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_id | string | A unique identifier for the Realtime script (pattern: <code>^script-\S+$</code>) |
size_on_disk | integer (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_location | object | 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. |
version | string | Version 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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
describe_script | select | region | 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 | |
list_scripts | select | region | This 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_script | insert | region | 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 | |
update_script | update | region, ScriptId | 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 | |
delete_script | delete | region | 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 |
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.
| Name | Datatype | Description |
|---|---|---|
region | string | AWS region (default: us-east-1) |
SELECT examples
- describe_script
- list_scripts
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
;
This 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
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
- create_script
- Manifest
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
;
# Description fields are for documentation purposes
- name: scripts
props:
- name: region
value: "{{ region }}"
description: Required parameter for the scripts resource.
- name: Name
value: "{{ Name }}"
description: |
A descriptive label that is associated with a script. Script names do not need to be unique. You can use UpdateScript to change this value later.
- name: Version
value: "{{ Version }}"
description: |
Version information that is associated with a build or script. Version strings do not need to be unique. You can use UpdateScript to change this value later.
- name: StorageLocation
description: |
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.
value:
Bucket: "{{ Bucket }}"
Key: "{{ Key }}"
RoleArn: "{{ RoleArn }}"
ObjectVersion: "{{ ObjectVersion }}"
- name: ZipFile
value: "{{ ZipFile }}"
description: |
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. When using the Amazon Web Services CLI tool to create a script, this parameter is set to the zip file name. It must be prepended with the string "fileb://" to indicate that the file data is a binary object. For example: --zip-file fileb://myRealtimeScript.zip.
- name: Tags
description: |
A list of labels to assign to the new script resource. Tags are developer-defined key-value pairs. Tagging Amazon Web Services resources are useful for resource management, access management and cost allocation. For more information, see Tagging Amazon Web Services Resources in the Amazon Web Services 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 Amazon Web Services General Reference for actual tagging limits.
value:
- Key: "{{ Key }}"
Value: "{{ Value }}"
- name: NodeJsVersion
value: "{{ NodeJsVersion }}"
description: |
The 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.
UPDATE examples
- update_script
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
- delete_script
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
;