Skip to content

Commit

Permalink
Merge branch 'main' into awsmjs-patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
kaizencc authored Dec 8, 2023
2 parents 1e3a8c2 + 020bf18 commit 93c6957
Show file tree
Hide file tree
Showing 14 changed files with 459 additions and 458 deletions.
61 changes: 30 additions & 31 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/alias.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@ import { CfnAlias } from 'aws-cdk-lib/aws-gamelift';
* Represents a Gamelift Alias for a Gamelift fleet destination.
*/
export interface IAlias extends cdk.IResource, IGameSessionQueueDestination {

/**
* The Identifier of the alias.
*
* @attribute
*/
* The Identifier of the alias.
*
* @attribute
*/
readonly aliasId: string;

/**
Expand All @@ -29,10 +28,10 @@ export interface IAlias extends cdk.IResource, IGameSessionQueueDestination {
*/
export interface AliasOptions {
/**
* Description for the alias
*
* @default No description
*/
* Description for the alias
*
* @default No description
*/
readonly description?: string;
}

Expand All @@ -41,21 +40,21 @@ export interface AliasOptions {
*/
export interface AliasAttributes {
/**
* The ARN of the alias
*
* At least one of `aliasArn` and `aliasId` must be provided.
*
* @default derived from `aliasId`.
*/
* The ARN of the alias
*
* At least one of `aliasArn` and `aliasId` must be provided.
*
* @default derived from `aliasId`.
*/
readonly aliasArn?: string;

/**
* The identifier of the alias
*
* At least one of `aliasId` and `aliasArn` must be provided.
*
* @default derived from `aliasArn`.
*/
* The identifier of the alias
*
* At least one of `aliasId` and `aliasArn` must be provided.
*
* @default derived from `aliasArn`.
*/
readonly aliasId?: string;
}

Expand All @@ -64,15 +63,15 @@ export interface AliasAttributes {
*/
export interface AliasProps {
/**
* Name of this alias
*/
* Name of this alias
*/
readonly aliasName: string;

/**
* A human-readable description of the alias
*
* @default no description
*/
* A human-readable description of the alias
*
* @default no description
*/
readonly description?: string;

/**
Expand Down Expand Up @@ -100,13 +99,15 @@ export interface AliasProps {
*/
export abstract class AliasBase extends cdk.Resource implements IAlias {
/**
* The Identifier of the alias.
*/
* The Identifier of the alias.
*/
public abstract readonly aliasId: string;

/**
* The ARN of the alias
*/
public abstract readonly aliasArn: string;

/**
* The ARN to put into the destination field of a game session queue
*/
Expand All @@ -132,7 +133,6 @@ export abstract class AliasBase extends cdk.Resource implements IAlias {
* @resource AWS::GameLift::Alias
*/
export class Alias extends AliasBase {

/**
* Import an existing alias from its identifier.
*/
Expand Down Expand Up @@ -248,4 +248,3 @@ export class Alias extends AliasBase {
};
}
}

13 changes: 6 additions & 7 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/build-fleet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,12 @@ export interface IBuildFleet extends IFleet {}
* Properties for a new Gamelift build fleet
*/
export interface BuildFleetProps extends FleetProps {

/**
* A build to be deployed on the fleet.
* The build must have been successfully uploaded to Amazon GameLift and be in a `READY` status.
*
* This fleet setting cannot be changed once the fleet is created.
*/
* A build to be deployed on the fleet.
* The build must have been successfully uploaded to Amazon GameLift and be in a `READY` status.
*
* This fleet setting cannot be changed once the fleet is created.
*/
readonly content: IBuild;

/**
Expand Down Expand Up @@ -201,4 +200,4 @@ export class BuildFleet extends FleetBase implements IBuildFleet {
};
}
}
}
}
111 changes: 55 additions & 56 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import { CfnBuild } from 'aws-cdk-lib/aws-gamelift';
* @see https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html
*/
export interface IBuild extends cdk.IResource, iam.IGrantable {

/**
* The Identifier of the build.
*
Expand All @@ -37,12 +36,13 @@ export interface IBuild extends cdk.IResource, iam.IGrantable {
*/
export abstract class BuildBase extends cdk.Resource implements IBuild {
/**
* The Identifier of the build.
*/
* The Identifier of the build.
*/
public abstract readonly buildId: string;

/**
* The ARN of the build.
*/
* The ARN of the build.
*/
public abstract readonly buildArn: string;

public abstract readonly grantPrincipal: iam.IPrincipal;
Expand Down Expand Up @@ -87,21 +87,21 @@ export enum OperatingSystem {
*/
export interface BuildAttributes {
/**
* The ARN of the build
*
* At least one of `buildArn` and `buildId` must be provided.
*
* @default derived from `buildId`.
*/
* The ARN of the build
*
* At least one of `buildArn` and `buildId` must be provided.
*
* @default derived from `buildId`.
*/
readonly buildArn?: string;

/**
* The identifier of the build
*
* At least one of `buildId` and `buildArn` must be provided.
*
* @default derived from `buildArn`.
*/
* The identifier of the build
*
* At least one of `buildId` and `buildArn` must be provided.
*
* @default derived from `buildArn`.
*/
readonly buildId?: string;
/**
* The IAM role assumed by GameLift to access server build in S3.
Expand All @@ -115,52 +115,52 @@ export interface BuildAttributes {
*/
export interface BuildProps {
/**
* Name of this build
*
* @default No name
*/
* Name of this build
*
* @default No name
*/
readonly buildName?: string;

/**
* Version of this build
*
* @default No version
*/
* Version of this build
*
* @default No version
*/
readonly buildVersion?: string;

/**
* The operating system that the game server binaries are built to run on.
*
* @default No version
*/
* The operating system that the game server binaries are built to run on.
*
* @default No version
*/
readonly operatingSystem?: OperatingSystem;

/**
* The game build file storage
*/
* The game build file storage
*/
readonly content: Content;

/**
* The IAM role assumed by GameLift to access server build in S3.
* If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com) and be granted sufficient permissions
* to have Read access to a specific key content into a specific S3 bucket.
* Below an example of required permission:
* {
* "Version": "2012-10-17",
* "Statement": [{
* "Effect": "Allow",
* "Action": [
* "s3:GetObject",
* "s3:GetObjectVersion"
* ],
* "Resource": "arn:aws:s3:::bucket-name/object-name"
* }]
*}
*
* @see https://docs.aws.amazon.com/gamelift/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-access-storage-loc
*
* @default - a role will be created with default permissions.
*/
* The IAM role assumed by GameLift to access server build in S3.
* If providing a custom role, it needs to trust the GameLift service principal (gamelift.amazonaws.com) and be granted sufficient permissions
* to have Read access to a specific key content into a specific S3 bucket.
* Below an example of required permission:
* {
* "Version": "2012-10-17",
* "Statement": [{
* "Effect": "Allow",
* "Action": [
* "s3:GetObject",
* "s3:GetObjectVersion"
* ],
* "Resource": "arn:aws:s3:::bucket-name/object-name"
* }]
* }
*
* @see https://docs.aws.amazon.com/gamelift/latest/developerguide/security_iam_id-based-policy-examples.html#security_iam_id-based-policy-examples-access-storage-loc
*
* @default - a role will be created with default permissions.
*/
readonly role?: iam.IRole;

/**
Expand All @@ -182,7 +182,6 @@ export interface BuildProps {
* @resource AWS::GameLift::Build
*/
export class Build extends BuildBase {

/**
* Create a new Build from s3 content
*/
Expand All @@ -202,15 +201,15 @@ export class Build extends BuildBase {
}

/**
* Import a build into CDK using its identifier
*/
* Import a build into CDK using its identifier
*/
static fromBuildId(scope: Construct, id: string, buildId: string): IBuild {
return this.fromBuildAttributes(scope, id, { buildId });
}

/**
* Import a build into CDK using its ARN
*/
* Import a build into CDK using its ARN
*/
static fromBuildArn(scope: Construct, id: string, buildArn: string): IBuild {
return this.fromBuildAttributes(scope, id, { buildArn });
}
Expand Down
24 changes: 11 additions & 13 deletions packages/@aws-cdk/aws-gamelift-alpha/lib/content.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,29 +10,28 @@ import { Construct } from 'constructs';
*/
export abstract class Content {
/**
* Game content as an S3 object.
* @param bucket The S3 bucket
* @param key The object key
* @param objectVersion Optional S3 ob ject version
*/
* Game content as an S3 object.
* @param bucket The S3 bucket
* @param key The object key
* @param objectVersion Optional S3 ob ject version
*/
public static fromBucket(bucket: s3.IBucket, key: string, objectVersion?: string): S3Content {
return new S3Content(bucket, key, objectVersion);
}

/**
* Loads the game content from a local disk path.
*
* @param path Either a directory with the game content bundle or a .zip file
*/
* Loads the game content from a local disk path.
*
* @param path Either a directory with the game content bundle or a .zip file
*/
public static fromAsset(path: string, options?: s3_assets.AssetOptions): AssetContent {
return new AssetContent(path, options);
}

/**
* Called when the Build is initialized to allow this object to bind
*/
* Called when the Build is initialized to allow this object to bind
*/
public abstract bind(scope: Construct, role: iam.IRole): ContentConfig;

}

/**
Expand All @@ -49,7 +48,6 @@ export interface ContentConfig {
* Game content from an S3 archive.
*/
export class S3Content extends Content {

constructor(private readonly bucket: s3.IBucket, private key: string, private objectVersion?: string) {
super();
if (!bucket.bucketName) {
Expand Down
Loading

0 comments on commit 93c6957

Please sign in to comment.