How to use @aws-cdk/assets - 1 common examples

To help you get started, we’ve selected a few @aws-cdk/assets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-s3-assets / lib / asset.ts View on Github external
constructor(scope: cdk.Construct, id: string, props: AssetProps) {
    super(scope, id);

    // stage the asset source (conditionally).
    const staging = new assets.Staging(this, 'Stage', {
      ...props,
      sourcePath: path.resolve(props.path),
    });

    this.sourceHash = props.sourceHash || staging.sourceHash;

    this.assetPath = staging.stagedPath;

    const packaging = determinePackaging(staging.sourcePath);

    // sets isZipArchive based on the type of packaging and file extension
    this.isZipArchive = packaging === cdk.FileAssetPackaging.ZIP_DIRECTORY
      ? true
      : ARCHIVE_EXTENSIONS.some(ext => staging.sourcePath.toLowerCase().endsWith(ext));

    const stack = cdk.Stack.of(this);

@aws-cdk/assets

This module is deprecated. All types are now available under the core module

Apache-2.0
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis

Popular @aws-cdk/assets functions