Interface AssetOptions
- All Superinterfaces:
AssetOptions
,FileCopyOptions
,software.amazon.jsii.JsiiSerializable
- All Known Subinterfaces:
AssetProps
,CustomCommandOptions
,InitFileAssetOptions
,InitSourceAssetOptions
- All Known Implementing Classes:
AssetOptions.Jsii$Proxy
,AssetProps.Jsii$Proxy
,CustomCommandOptions.Jsii$Proxy
,InitFileAssetOptions.Jsii$Proxy
,InitSourceAssetOptions.Jsii$Proxy
@Generated(value="jsii-pacmak/1.104.0 (build e79254c)",
date="2024-11-22T02:24:08.943Z")
@Stability(Stable)
public interface AssetOptions
extends software.amazon.jsii.JsiiSerializable, AssetOptions, FileCopyOptions
Example:
Function.Builder.create(this, "Function") .code(Code.fromAsset(join(__dirname, "my-python-handler"), AssetOptions.builder() .bundling(BundlingOptions.builder() .image(Runtime.PYTHON_3_9.getBundlingImage()) .command(List.of("bash", "-c", "pip install -r requirements.txt -t /asset-output && cp -au . /asset-output")) .build()) .build())) .runtime(Runtime.PYTHON_3_9) .handler("index.handler") .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forAssetOptions
static final class
An implementation forAssetOptions
-
Method Summary
Modifier and TypeMethodDescriptionstatic AssetOptions.Builder
builder()
default Boolean
Whether or not the asset needs to exist beyond deployment time;default List<IGrantable>
A list of principals that should be able to read this asset from S3.default IKey
The ARN of the KMS key used to encrypt the handler code.Methods inherited from interface software.amazon.awscdk.AssetOptions
getAssetHash, getAssetHashType, getBundling
Methods inherited from interface software.amazon.awscdk.FileCopyOptions
getExclude, getFollowSymlinks, getIgnoreMode
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getDeployTime
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: false
-
getReaders
A list of principals that should be able to read this asset from S3.You can use
asset.grantRead(principal)
to grant read permissions later.Default: - No principals that can read file asset.
-
getSourceKMSKey
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.
-
builder
- Returns:
- a
AssetOptions.Builder
ofAssetOptions
-