DockerImageAsset

class aws_cdk.aws_ecr_assets.DockerImageAsset(scope, id, *, directory, build_args=None, file=None, repository_name=None, target=None, extra_hash=None, exclude=None, follow=None, ignore_mode=None, follow_symlinks=None)

Bases: aws_cdk.core.Construct

(experimental) An asset that represents a Docker image.

The image will be created in build time and uploaded to an ECR repository.

Stability

experimental

Parameters
  • scope (Construct) –

  • id (str) –

  • directory (str) – (experimental) The directory where the Dockerfile is stored.

  • build_args (Optional[Mapping[str, str]]) – (experimental) Build args to pass to the docker build command. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as lambda.functionArn or queue.queueUrl). Default: - no build args are passed

  • file (Optional[str]) – (experimental) Path to the Dockerfile (relative to the directory). Default: ‘Dockerfile’

  • repository_name (Optional[str]) – (deprecated) ECR repository name. Specify this property if you need to statically address the image, e.g. from a Kubernetes Pod. Note, this is only the repository name, without the registry and the tag parts. Default: - the default ECR repository for CDK assets

  • target (Optional[str]) – (experimental) Docker target to build to. Default: - no target

  • 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 ‘

  • follow_symlinks (Optional[SymlinkFollowMode]) – A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVER

Stability

experimental

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

asset_hash

(experimental) A hash of this asset, which is available at construction time.

As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.

Stability

experimental

Return type

str

image_uri

(experimental) The full URI of the image (including a tag).

Use this reference to pull the asset.

Stability

experimental

Return type

str

node

The construct tree node associated with this construct.

Return type

ConstructNode

repository

(experimental) Repository where the image is stored.

Stability

experimental

Return type

IRepository

source_hash

(deprecated) A hash of the source of this asset, which is available at construction time.

As this is a plain string, it can be used in construct IDs in order to enforce creation of a new resource when the content hash has changed.

Deprecated

use assetHash

Stability

deprecated

Return type

str

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool