Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

UpdateScript - Amazon GameLift Servers
このページはお客様の言語に翻訳されていません。 翻訳のリクエスト

UpdateScript

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

Request Syntax

{ "Name": "string", "ScriptId": "string", "StorageLocation": { "Bucket": "string", "Key": "string", "ObjectVersion": "string", "RoleArn": "string" }, "Version": "string", "ZipFile": blob }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

ScriptId

A unique identifier for the Realtime script to update. You can use either the script ID or ARN value.

Type: String

Pattern: ^script-\S+|^arn:.*:script\/script-\S+

Required: Yes

Name

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

StorageLocation

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.

Type: S3Location object

Required: No

Version

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

Type: String

Length Constraints: Minimum length of 1. Maximum length of 1024.

Required: No

ZipFile

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 AWS 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.

Type: Base64-encoded binary data object

Length Constraints: Maximum length of 5000000.

Required: No

Response Syntax

{ "Script": { "CreationTime": number, "Name": "string", "ScriptArn": "string", "ScriptId": "string", "SizeOnDisk": number, "StorageLocation": { "Bucket": "string", "Key": "string", "ObjectVersion": "string", "RoleArn": "string" }, "Version": "string" } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Script

The newly created script record with a unique script ID. The new script's storage location reflects an Amazon S3 location: (1) If the script was uploaded from an S3 bucket under your account, the storage location reflects the information that was provided in the CreateScript request; (2) If the script file was uploaded from a local zip file, the storage location reflects an S3 location controls by the Amazon GameLift Servers service.

Type: Script object

Errors

For information about the errors that are common to all actions, see Common Errors.

InternalServiceException

The service encountered an unrecoverable internal failure while processing the request. Clients can retry such requests immediately or after a waiting period.

HTTP Status Code: 500

InvalidRequestException

One or more parameter values in the request are invalid. Correct the invalid parameter values before retrying.

HTTP Status Code: 400

NotFoundException

The requested resources was not found. The resource was either not created yet or deleted.

HTTP Status Code: 400

UnauthorizedException

The client failed authentication. Clients should not retry such requests.

HTTP Status Code: 400

Examples

Update a script from a local zip file

This example updates the Realtime script with a zip file that is stored locally.

Sample Request

{ "ScriptId": "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", "Version": "1.0.2", "ZipFile": <zip file data> } CLI syntax: aws gamelift update-script --script-id "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff" --script-version "1.0.2" --zip-file fileb://myrealtime_script.zip

Sample Response

{ "Script": { "CreationTime": 1496708916.18, "Name": "My_Realtime_Script_1", "ScriptArn": "arn:aws:gamelift:us-west-2::script/script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", "ScriptId": "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", "SizeOnDisk": 10000, "StorageLocation": { "Bucket": "prod-gamescale-scripts-us-west-2", "Key": "123456789012/script-1111aaaa-22bb-33cc-44dd-5555eeee66ff" }, "Version": "1.0.2" } }

Update a script with a file in Amazon S3

This example updates the Realtime server script with a zip file that is stored in an S3 account.

Sample Request

{ "ScriptId": "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", "Version": "1.0.2", "StorageLocation": { "Bucket": "my_realtime_script_files", "Key": "myRealtimeScript.zip", "RoleArn": "arn:aws:iam::111122223333:role/GameLiftAccess" } } CLI syntax: aws gamelift create-script --script-id "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff" --script-version "1.0.2" --storage-location "Bucket=my_realtime_script_files, Key=myRealtimeScript.zip, RoleArn=arn:aws:iam::123456789012:role/GameLiftAccess"

Sample Response

{ "Script": { "CreationTime": 1496708916.18, "Name": "My_Realtime_Script_1", "ScriptArn": "arn:aws:gamelift:us-west-2::script/script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", "ScriptId": "script-1111aaaa-22bb-33cc-44dd-5555eeee66ff", "SizeOnDisk": 0, "StorageLocation": { "Bucket": "my_realtime_script_files", "Key": "myRealtimeScript.zip" "RoleArn": "arn:aws:iam::111122223333:role/GameLiftAccess" "ObjectVersion": null }, "Version": "1.0.2" } }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.