Staging

class aws_cdk.assets.Staging(scope, id, *, source_path, extra_hash=None, exclude=None, follow=None, ignore_mode=None)

Bases: aws_cdk.core.AssetStaging

(deprecated) Deprecated.

Deprecated

use core.AssetStaging

Stability

deprecated

Parameters
  • scope (Construct) –

  • id (str) –

  • source_path (str) – (deprecated) Local file or directory to stage.

  • extra_hash (Optional[str]) – (deprecated) Extra information to encode into the fingerprint (e.g. build instructions and other inputs). Default: - hash is only based on source content

  • exclude (Optional[Sequence[str]]) – (deprecated) Glob patterns to exclude from the copy. Default: nothing is excluded

  • follow (Optional[FollowMode]) – (deprecated) A strategy for how to handle symlinks. Default: Never

  • ignore_mode (Optional[IgnoreMode]) – (deprecated) The ignore behavior to use for exclude patterns. Default: - GLOB for file assets, DOCKER or GLOB for docker assets depending on whether the ‘

Stability

deprecated

Methods

relative_staged_path(stack)

Return the path to the staged asset, relative to the Cloud Assembly (manifest) directory of the given stack.

Only returns a relative path if the asset was staged, returns an absolute path if it was not staged.

A bundled asset might end up in the outDir and still not count as “staged”; if asset staging is disabled we’re technically expected to reference source directories, but we don’t have a source directory for the bundled outputs (as the bundle output is written to a temporary directory). Nevertheless, we will still return an absolute path.

A non-obvious directory layout may look like this:

CLOUD ASSEMBLY ROOT
  +-- asset.12345abcdef/
  +-- assembly-Stage
        +-- MyStack.template.json
        +-- MyStack.assets.json <- will contain { "path": "../asset.12345abcdef" }
Parameters

stack (Stack) –

Return type

str

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

BUNDLING_INPUT_DIR = '/asset-input'
BUNDLING_OUTPUT_DIR = '/asset-output'
absolute_staged_path

Absolute path to the asset data.

If asset staging is disabled, this will just be the source path or a temporary directory used for bundling.

If asset staging is enabled it will be the staged path.

IMPORTANT: If you are going to call addFileAsset(), use relativeStagedPath() instead.

Return type

str

asset_hash

A cryptographic hash of the asset.

Return type

str

is_archive

Whether this asset is an archive (zip or jar).

Return type

bool

node

The construct tree node associated with this construct.

Return type

ConstructNode

packaging

How this asset should be packaged.

Return type

FileAssetPackaging

source_hash

(deprecated) A cryptographic hash of the asset.

Deprecated

see assetHash.

Stability

deprecated

Return type

str

source_path

The absolute path of the asset as it was referenced by the user.

Return type

str

staged_path

(deprecated) Absolute path to the asset data.

If asset staging is disabled, this will just be the source path or a temporary directory used for bundling.

If asset staging is enabled it will be the staged path.

IMPORTANT: If you are going to call addFileAsset(), use relativeStagedPath() instead.

Deprecated
  • Use absoluteStagedPath instead.

Stability

deprecated

Return type

str

Static Methods

classmethod clear_asset_hash_cache()

Clears the asset hash cache.

Return type

None

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool