Interface IAssetOptions
Inherited Members
Namespace: Amazon.CDK.AWS.S3.Assets
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface IAssetOptions : IAssetOptions, IFileCopyOptions
Syntax (vb)
Public Interface IAssetOptions
Inherits IAssetOptions, IFileCopyOptions
Remarks
ExampleMetadata: infused
Examples
new Function(this, "Function", new FunctionProps {
Code = Code.FromAsset(Join(__dirname, "my-python-handler"), new AssetOptions {
Bundling = new BundlingOptions {
Image = Runtime.PYTHON_3_9.BundlingImage,
Command = new [] { "bash", "-c", "pip install -r requirements.txt -t /asset-output && cp -au . /asset-output" }
}
}),
Runtime = Runtime.PYTHON_3_9,
Handler = "index.handler"
});
Synopsis
Properties
DeployTime | Whether or not the asset needs to exist beyond deployment time; |
Readers | A list of principals that should be able to read this asset from S3. |
Properties
DeployTime
Whether or not the asset needs to exist beyond deployment time;
virtual Nullable<bool> DeployTime { get; }
Property Value
System.Nullable<System.Boolean>
Remarks
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
Readers
A list of principals that should be able to read this asset from S3.
virtual IGrantable[] Readers { get; }
Property Value
Remarks
You can use asset.grantRead(principal)
to grant read permissions later.
Default: - No principals that can read file asset.