

Type of packaging to perform ( zip or file). When an asset is defined in a construct, a construct metadata entryĪws:cdk:asset is emitted with instructions on where to find the asset and what The following examples grants an IAM group read permissions on an asset: group = iam. To do that use the antRead(principal) method:

IAM roles, users or groups which need to be able to read assets in runtime will should be CfnOutput ( self, "S3ObjectURL", value = asset. CfnOutput ( self, "S3HttpURL", value = asset. CfnOutput ( self, "S3ObjectKey", value = asset. CfnOutput ( self, "S3BucketName", value = asset. join ( _dirname, "sample-asset-directory" ) ) cdk. Asset ( self, "SampleAsset", path = path. In the following example, the various asset attributes are exported as stack outputs: asset = assets.

The following JavaScript example defines an directory asset which is archived asĪ. Locations of the uploaded assets will be passed in as CloudFormation Parameters Will first upload all the assets to S3, and only then deploy the stacks. When deploying a CDK app that includes constructs with assets, the CDK toolkit A commonĮxample is a directory which contains the handler code for a Lambda function,īut assets can represent any artifact that is needed for the app's operation. Assets are local files or directories which are needed by a CDK app.
