Staging

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

Bases: AssetStaging

(deprecated) Deprecated.

Deprecated:

use core.AssetStaging

Stability:

deprecated

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.assets as assets
import aws_cdk.core as cdk

staging = assets.Staging(self, "MyStaging",
    source_path="sourcePath",

    # the properties below are optional
    exclude=["exclude"],
    extra_hash="extraHash",
    follow=assets.FollowMode.NEVER,
    ignore_mode=cdk.IgnoreMode.GLOB
)
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.

asset_hash

A cryptographic hash of the asset.

is_archive

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

node

The construct tree node associated with this construct.

packaging

How this asset should be packaged.

source_hash

(deprecated) A cryptographic hash of the asset.

Deprecated:

see assetHash.

Stability:

deprecated

source_path

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

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

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