Skip to content
v2.274.0

Experimental

@aws-cdk/aws-gamelift-alpha is an experimental (alpha) package: its API may change in any release, without a major version bump.

Content Class ​

Before deploying your GameLift-enabled multiplayer game servers for hosting with the GameLift service, you need to upload your game server files.

The class helps you on preparing and uploading custom game server build files or Realtime Servers server script files.

Example ​

ts
declare const bucket: s3.Bucket;
const build = new gamelift.Build(this, 'Build', {
  content: gamelift.Content.fromBucket(bucket, "sample-asset-key"),
  serverSdkVersion: '5.0.0',
});

Initializer ​

ts
new Content()
python
Content()
java
new Content()
csharp
new Content()
go
NewContent()

Methods ​

bind(scope: Construct, role: IRole): ContentConfigdef bind(self, scope: Construct, role: IRole) -> ContentConfigpublic ContentConfig bind(Construct scope, IRole role)public ContentConfig Bind(Construct scope, IRole role)func Bind(Scope Construct, Role IRole) ContentConfig#
Called when the Build is initialized to allow this object to bind.
fromAsset(path: string, options?: AssetOptions): AssetContent@staticmethod def from_asset(path: str, options: typing.Optional[AssetOptions] = None) -> AssetContentpublic static AssetContent fromAsset(String path, AssetOptions options)public static AssetContent FromAsset(string path, AssetOptions? options = null)func FromAsset(Path *string, Options AssetOptions) AssetContentstatic#
Loads the game content from a local disk path.
1 parameter

Parameters

  • pathpathpathpathPath — Either a directory with the game content bundle or a .zip file.
fromBucket(bucket: IBucket, key: string, objectVersion?: string): S3Content@staticmethod def from_bucket(bucket: IBucket, key: str, object_version: typing.Optional[str] = None) -> S3Contentpublic static S3Content fromBucket(IBucket bucket, String key, String objectVersion)public static S3Content FromBucket(IBucket bucket, string key, string? objectVersion = null)func FromBucket(Bucket IBucket, Key *string, ObjectVersion *string) S3Contentstatic#
Game content as an S3 object.
3 parameters

Parameters

  • bucketbucketbucketbucketBucket — The S3 bucket.
  • keykeykeykeyKey — The object key.
  • objectVersionobject_versionobjectVersionobjectVersionObjectVersion — Optional S3 ob ject version.