Build
- class aws_cdk.aws_gamelift_alpha.Build(scope, id, *, content, build_name=None, build_version=None, operating_system=None, role=None, server_sdk_version=None)
Bases:
BuildBase
(experimental) A GameLift build, that is installed and runs on instances in an Amazon GameLift fleet.
It consists of a zip file with all of the components of the game server build.
- See:
https://docs.aws.amazon.com/gamelift/latest/developerguide/gamelift-build-cli-uploading.html
- Stability:
experimental
- Resource:
AWS::GameLift::Build
- ExampleMetadata:
infused
Example:
# bucket: s3.Bucket build = gamelift.Build(self, "Build", content=gamelift.Content.from_bucket(bucket, "sample-asset-key") ) CfnOutput(self, "BuildArn", value=build.build_arn) CfnOutput(self, "BuildId", value=build.build_id)
- Parameters:
scope (
Construct
) –id (
str
) –content (
Content
) – (experimental) The game build file storage.build_name (
Optional
[str
]) – (experimental) Name of this build. Default: No namebuild_version (
Optional
[str
]) – (experimental) Version of this build. Default: No versionoperating_system (
Optional
[OperatingSystem
]) – (experimental) The operating system that the game server binaries are built to run on. Default: No versionrole (
Optional
[IRole
]) – (experimental) 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” }] } Default: - a role will be created with default permissions.server_sdk_version (
Optional
[str
]) – (experimental) A server SDK version you used when integrating your game server build with Amazon GameLift. Default: - 4.0.2
- Stability:
experimental
Methods
- apply_removal_policy(policy)
Apply the given removal policy to this resource.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
).- Parameters:
policy (
RemovalPolicy
) –- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
Attributes
- build_arn
(experimental) The ARN of the build.
- Stability:
experimental
- build_id
(experimental) The Identifier of the build.
- Stability:
experimental
- env
The environment this resource belongs to.
For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.
- grant_principal
(experimental) The principal this GameLift Build is using.
- Stability:
experimental
- node
The tree node.
- role
(experimental) The IAM role GameLift assumes to acccess server build content.
- Stability:
experimental
- stack
The stack in which this resource is defined.
Static Methods
- classmethod from_asset(scope, id, path, *, deploy_time=None, readers=None, source_kms_key=None, asset_hash=None, asset_hash_type=None, bundling=None, exclude=None, follow_symlinks=None, ignore_mode=None)
(experimental) Create a new Build from asset content.
- Parameters:
scope (
Construct
) –id (
str
) –path (
str
) –deploy_time (
Optional
[bool
]) – Whether or not the asset needs to exist beyond deployment time; i.e. are copied over to a different location and not needed afterwards. Setting this property to true has an impact on the lifecycle of the asset, because we will assume that it is safe to delete after the CloudFormation deployment succeeds. For example, Lambda Function assets are copied over to Lambda during deployment. Therefore, it is not necessary to store the asset in S3, so we consider those deployTime assets. Default: falsereaders (
Optional
[Sequence
[IGrantable
]]) – A list of principals that should be able to read this asset from S3. You can useasset.grantRead(principal)
to grant read permissions later. Default: - No principals that can read file asset.source_kms_key (
Optional
[IKey
]) – The ARN of the KMS key used to encrypt the handler code. Default: - the default server-side encryption with Amazon S3 managed keys(SSE-S3) key will be used.asset_hash (
Optional
[str
]) – Specify a custom hash for this asset. IfassetHashType
is set it must be set toAssetHashType.CUSTOM
. For consistency, this custom hash will be SHA256 hashed and encoded as hex. The resulting hash will be the asset hash. NOTE: the hash is used in order to identify a specific revision of the asset, and used for optimizing and caching deployment activities related to this asset such as packaging, uploading to Amazon S3, etc. If you chose to customize the hash, you will need to make sure it is updated every time the asset changes, or otherwise it is possible that some deployments will not be invalidated. Default: - based onassetHashType
asset_hash_type (
Optional
[AssetHashType
]) – Specifies the type of hash to calculate for this asset. IfassetHash
is configured, this option must beundefined
orAssetHashType.CUSTOM
. Default: - the default isAssetHashType.SOURCE
, but ifassetHash
is explicitly specified this value defaults toAssetHashType.CUSTOM
.bundling (
Union
[BundlingOptions
,Dict
[str
,Any
],None
]) – Bundle the asset by executing a command in a Docker container or a custom bundling provider. The asset path will be mounted at/asset-input
. The Docker container is responsible for putting content at/asset-output
. The content at/asset-output
will be zipped and used as the final asset. Default: - uploaded as-is to S3 if the asset is a regular file or a .zip file, archived into a .zip file and uploaded to S3 otherwiseexclude (
Optional
[Sequence
[str
]]) – File paths matching the patterns will be excluded. SeeignoreMode
to set the matching behavior. Has no effect on Assets bundled using thebundling
property. Default: - nothing is excludedfollow_symlinks (
Optional
[SymlinkFollowMode
]) – A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVERignore_mode (
Optional
[IgnoreMode
]) – The ignore behavior to use forexclude
patterns. Default: IgnoreMode.GLOB
- Stability:
experimental
- Return type:
- classmethod from_bucket(scope, id, bucket, key, object_version=None)
(experimental) Create a new Build from s3 content.
- classmethod from_build_arn(scope, id, build_arn)
(experimental) Import a build into CDK using its ARN.
- classmethod from_build_attributes(scope, id, *, build_arn=None, build_id=None, role=None)
(experimental) Import an existing build from its attributes.
- Parameters:
scope (
Construct
) –id (
str
) –build_arn (
Optional
[str
]) – (experimental) The ARN of the build. At least one ofbuildArn
andbuildId
must be provided. Default: derived frombuildId
.build_id (
Optional
[str
]) – (experimental) The identifier of the build. At least one ofbuildId
andbuildArn
must be provided. Default: derived frombuildArn
.role (
Optional
[IRole
]) – (experimental) The IAM role assumed by GameLift to access server build in S3. Default: the imported fleet cannot be granted access to other resources as aniam.IGrantable
.
- Stability:
experimental
- Return type:
- classmethod from_build_id(scope, id, build_id)
(experimental) Import a build into CDK using its identifier.
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
- classmethod is_owned_resource(construct)
Returns true if the construct was created by CDK, and false otherwise.
- Parameters:
construct (
IConstruct
) –- Return type:
bool
- classmethod is_resource(construct)
Check whether the given construct is a Resource.
- Parameters:
construct (
IConstruct
) –- Return type:
bool