AssetImageProps¶
-
class
aws_cdk.aws_ecs.
AssetImageProps
(*, exclude=None, follow=None, ignore_mode=None, extra_hash=None, follow_symlinks=None, build_args=None, file=None, invalidation=None, network_mode=None, repository_name=None, target=None)¶ Bases:
aws_cdk.aws_ecr_assets.DockerImageAssetOptions
The properties for building an AssetImage.
- Parameters
exclude (
Optional
[Sequence
[str
]]) – Glob patterns to exclude from the copy. Default: - nothing is excludedfollow (
Optional
[FollowMode
]) – (deprecated) A strategy for how to handle symlinks. Default: Neverignore_mode (
Optional
[IgnoreMode
]) – The ignore behavior to use for exclude patterns. Default: IgnoreMode.GLOBextra_hash (
Optional
[str
]) – Extra information to encode into the fingerprint (e.g. build instructions and other inputs). Default: - hash is only based on source contentfollow_symlinks (
Optional
[SymlinkFollowMode
]) – A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVERbuild_args (
Optional
[Mapping
[str
,str
]]) – Build args to pass to thedocker build
command. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such aslambda.functionArn
orqueue.queueUrl
). Default: - no build args are passedfile (
Optional
[str
]) – Path to the Dockerfile (relative to the directory). Default: ‘Dockerfile’invalidation (
Optional
[DockerImageAssetInvalidationOptions
]) – Options to control which parameters are used to invalidate the asset hash. Default: - hash all parametersnetwork_mode (
Optional
[NetworkMode
]) – Networking mode for the RUN commands during build. Support docker API 1.25+. Default: - no networking mode specified (the default networking modeNetworkMode.DEFAULT
will be used)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 assetstarget (
Optional
[str
]) – Docker target to build to. Default: - no target
- 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.aws_ecr_assets as ecr_assets import aws_cdk.aws_ecs as ecs import aws_cdk.core as cdk # network_mode: ecr_assets.NetworkMode asset_image_props = ecs.AssetImageProps( build_args={ "build_args_key": "buildArgs" }, exclude=["exclude"], extra_hash="extraHash", file="file", follow=assets.FollowMode.NEVER, follow_symlinks=cdk.SymlinkFollowMode.NEVER, ignore_mode=cdk.IgnoreMode.GLOB, invalidation=ecr_assets.DockerImageAssetInvalidationOptions( build_args=False, extra_hash=False, file=False, network_mode=False, repository_name=False, target=False ), network_mode=network_mode, repository_name="repositoryName", target="target" )
Attributes
-
build_args
¶ 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
orqueue.queueUrl
).- Default
no build args are passed
- Return type
Optional
[Mapping
[str
,str
]]
-
exclude
¶ Glob patterns to exclude from the copy.
- Default
nothing is excluded
- Return type
Optional
[List
[str
]]
-
extra_hash
¶ Extra information to encode into the fingerprint (e.g. build instructions and other inputs).
- Default
hash is only based on source content
- Return type
Optional
[str
]
-
file
¶ Path to the Dockerfile (relative to the directory).
- Default
‘Dockerfile’
- Return type
Optional
[str
]
-
follow
¶ (deprecated) A strategy for how to handle symlinks.
- Default
Never
- Deprecated
use
followSymlinks
instead- Stability
deprecated
- Return type
Optional
[FollowMode
]
-
follow_symlinks
¶ A strategy for how to handle symlinks.
- Default
SymlinkFollowMode.NEVER
- Return type
Optional
[SymlinkFollowMode
]
-
ignore_mode
¶ The ignore behavior to use for exclude patterns.
- Default
IgnoreMode.GLOB
- Return type
Optional
[IgnoreMode
]
-
invalidation
¶ Options to control which parameters are used to invalidate the asset hash.
- Default
hash all parameters
- Return type
Optional
[DockerImageAssetInvalidationOptions
]
-
network_mode
¶ Networking mode for the RUN commands during build.
Support docker API 1.25+.
- Default
no networking mode specified (the default networking mode
NetworkMode.DEFAULT
will be used)
- Return type
Optional
[NetworkMode
]
-
repository_name
¶ (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
- Deprecated
to control the location of docker image assets, please override
Stack.addDockerImageAsset
. this feature will be removed in future releases.- Stability
deprecated
- Return type
Optional
[str
]
-
target
¶ Docker target to build to.
- Default
no target
- Return type
Optional
[str
]