TarballImageAsset

class aws_cdk.aws_ecr_assets.TarballImageAsset(scope, id, *, tarball_file)

Bases: Construct

An asset that represents a Docker image.

The image will loaded from an existing tarball and uploaded to an ECR repository.

ExampleMetadata:

infused

Example:

from aws_cdk.aws_ecr_assets import TarballImageAsset


asset = TarballImageAsset(self, "MyBuildImage",
    tarball_file="local-image.tar"
)
Parameters:
  • scope (Construct) –

  • id (str) –

  • tarball_file (str) – Absolute path to the tarball. It is recommended to to use the script running directory (e.g. __dirname in Node.js projects or dirname of __file__ in Python) if your tarball is located as a resource inside your project.

Methods

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

asset_hash

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.

image_uri

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

Use this reference to pull the asset.

node

The construct tree node associated with this construct.

repository

Repository where the image is stored.

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

Static Methods

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool