ContainerImageAssetMetadataEntry

class aws_cdk.cloud_assembly_schema.ContainerImageAssetMetadataEntry(*, id, packaging, path, source_hash, build_args=None, file=None, image_name_parameter=None, image_tag=None, network_mode=None, platform=None, repository_name=None, target=None)

Bases: object

Metadata Entry spec for container images.

Parameters:
  • id (str) – Logical identifier for the asset.

  • packaging (str) – Type of asset.

  • path (str) – Path on disk to the asset.

  • source_hash (str) – The hash of the asset source.

  • build_args (Optional[Mapping[str, str]]) – Build args to pass to the docker build command. Default: no build args are passed

  • file (Optional[str]) – Path to the Dockerfile (relative to the directory). Default: - no file is passed

  • image_name_parameter (Optional[str]) – (deprecated) ECR Repository name and repo digest (separated by “@sha256:”) where this image is stored. Default: undefined If not specified, repositoryName and imageTag are required because otherwise how will the stack know where to find the asset, ha?

  • image_tag (Optional[str]) – The docker image tag to use for tagging pushed images. This field is required if imageParameterName is ommited (otherwise, the app won’t be able to find the image). Default: - this parameter is REQUIRED after 1.21.0

  • network_mode (Optional[str]) – Networking mode for the RUN commands during build. Default: - no networking mode specified

  • platform (Optional[str]) – Platform to build for. Requires Docker Buildx. Default: - current machine platform

  • repository_name (Optional[str]) – ECR repository name, if omitted a default name based on the asset’s ID is used instead. 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: - this parameter is REQUIRED after 1.21.0

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

ExampleMetadata:

fixture=_generated

Example:

# Example automatically generated from non-compiling source. May contain errors.
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.cloud_assembly_schema as cloud_assembly_schema

container_image_asset_metadata_entry = cloud_assembly_schema.ContainerImageAssetMetadataEntry(
    id="id",
    packaging="packaging",
    path="path",
    source_hash="sourceHash",

    # the properties below are optional
    build_args={
        "build_args_key": "buildArgs"
    },
    file="file",
    image_name_parameter="imageNameParameter",
    image_tag="imageTag",
    network_mode="networkMode",
    platform="platform",
    repository_name="repositoryName",
    target="target"
)

Attributes

build_args

Build args to pass to the docker build command.

Default:

no build args are passed

file

Path to the Dockerfile (relative to the directory).

Default:
  • no file is passed

id

Logical identifier for the asset.

image_name_parameter

“) where this image is stored.

Default:

undefined If not specified, repositoryName and imageTag are required because otherwise how will the stack know where to find the asset, ha?

Deprecated:

specify repositoryName and imageTag instead, and then you know where the image will go.

Stability:

deprecated

Type:

(deprecated) ECR Repository name and repo digest (separated by “@sha256

image_tag

The docker image tag to use for tagging pushed images.

This field is required if imageParameterName is ommited (otherwise, the app won’t be able to find the image).

Default:
  • this parameter is REQUIRED after 1.21.0

network_mode

Networking mode for the RUN commands during build.

Default:
  • no networking mode specified

packaging

Type of asset.

path

Path on disk to the asset.

platform

Platform to build for.

Requires Docker Buildx.

Default:
  • current machine platform

repository_name

ECR repository name, if omitted a default name based on the asset’s ID is used instead.

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:
  • this parameter is REQUIRED after 1.21.0

source_hash

The hash of the asset source.

target

Docker target to build to.

Default:

no build target