AssetImageCodeProps
- class aws_cdk.aws_lambda.AssetImageCodeProps(*, exclude=None, follow_symlinks=None, ignore_mode=None, extra_hash=None, asset_name=None, build_args=None, build_secrets=None, build_ssh=None, cache_disabled=None, cache_from=None, cache_to=None, display_name=None, file=None, invalidation=None, network_mode=None, outputs=None, platform=None, target=None, cmd=None, entrypoint=None, working_directory=None)
- Bases: - DockerImageAssetOptions- Properties to initialize a new AssetImage. - Parameters:
- exclude ( - Optional[- Sequence[- str]]) – File paths matching the patterns will be excluded. See- ignoreModeto set the matching behavior. Has no effect on Assets bundled using the- bundlingproperty. Default: - nothing is excluded
- follow_symlinks ( - Optional[- SymlinkFollowMode]) – A strategy for how to handle symlinks. Default: SymlinkFollowMode.NEVER
- ignore_mode ( - Optional[- IgnoreMode]) – The ignore behavior to use for- excludepatterns. Default: IgnoreMode.GLOB
- extra_hash ( - Optional[- str]) – Extra information to encode into the fingerprint (e.g. build instructions and other inputs). Default: - hash is only based on source content
- asset_name ( - Optional[- str]) – Unique identifier of the docker image asset and its potential revisions. Required if using AppScopedStagingSynthesizer. Default: - no asset name
- build_args ( - Optional[- Mapping[- str,- str]]) – Build args to pass to the- docker buildcommand. Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as- lambda.functionArnor- queue.queueUrl). Default: - no build args are passed
- build_secrets ( - Optional[- Mapping[- str,- str]]) – Build secrets. Docker BuildKit must be enabled to use build secrets. Default: - no build secrets
- build_ssh ( - Optional[- str]) – SSH agent socket or keys to pass to the- docker buildcommand. Docker BuildKit must be enabled to use the ssh flag Default: - no –ssh flag
- cache_disabled ( - Optional[- bool]) – Disable the cache and pass- --no-cacheto the- docker buildcommand. Default: - cache is used
- cache_from ( - Optional[- Sequence[- Union[- DockerCacheOption,- Dict[- str,- Any]]]]) – Cache from options to pass to the- docker buildcommand. Default: - no cache from options are passed to the build command
- cache_to ( - Union[- DockerCacheOption,- Dict[- str,- Any],- None]) – Cache to options to pass to the- docker buildcommand. Default: - no cache to options are passed to the build command
- display_name ( - Optional[- str]) – A display name for this asset. If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information. If the same asset is added multiple times, the display name of the first occurrence is used. If- assetNameis given, it will also be used as the default- displayName. Otherwise, the default is the construct path of the ImageAsset construct, with respect to the enclosing stack. If the asset is produced by a construct helper function (such as- lambda.Code.fromAssetImage()), this will look like- MyFunction/AssetImage. We use the stack-relative construct path so that in the common case where you have multiple stacks with the same asset, we won’t show something like- /MyBetaStack/MyFunction/Codewhen you are actually deploying to production. Default: - Stack-relative construct path
- file ( - Optional[- str]) – Path to the Dockerfile (relative to the directory). Default: ‘Dockerfile’
- invalidation ( - Union[- DockerImageAssetInvalidationOptions,- Dict[- str,- Any],- None]) – Options to control which parameters are used to invalidate the asset hash. Default: - hash all parameters
- network_mode ( - Optional[- NetworkMode]) – Networking mode for the RUN commands during build. Support docker API 1.25+. Default: - no networking mode specified (the default networking mode- NetworkMode.DEFAULTwill be used)
- outputs ( - Optional[- Sequence[- str]]) – Outputs to pass to the- docker buildcommand. Default: - no outputs are passed to the build command (default outputs are used)
- platform ( - Optional[- Platform]) – Platform to build for. Requires Docker Buildx. Default: - no platform specified (the current machine architecture will be used)
- target ( - Optional[- str]) – Docker target to build to. Default: - no target
- cmd ( - Optional[- Sequence[- str]]) – Specify or override the CMD on the specified Docker image or Dockerfile. This needs to be in the ‘exec form’, viz.,- [ 'executable', 'param1', 'param2' ]. Default: - use the CMD specified in the docker image or Dockerfile.
- entrypoint ( - Optional[- Sequence[- str]]) – Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. An ENTRYPOINT allows you to configure a container that will run as an executable. This needs to be in the ‘exec form’, viz.,- [ 'executable', 'param1', 'param2' ]. Default: - use the ENTRYPOINT in the docker image or Dockerfile.
- working_directory ( - Optional[- str]) – Specify or override the WORKDIR on the specified Docker image or Dockerfile. A WORKDIR allows you to configure the working directory the container will use. Default: - use the WORKDIR in the docker image or Dockerfile.
 
- 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 as cdk from aws_cdk import aws_ecr_assets as ecr_assets from aws_cdk import aws_lambda as lambda_ # network_mode: ecr_assets.NetworkMode # platform: ecr_assets.Platform asset_image_code_props = lambda.AssetImageCodeProps( asset_name="assetName", build_args={ "build_args_key": "buildArgs" }, build_secrets={ "build_secrets_key": "buildSecrets" }, build_ssh="buildSsh", cache_disabled=False, cache_from=[ecr_assets.DockerCacheOption( type="type", # the properties below are optional params={ "params_key": "params" } )], cache_to=ecr_assets.DockerCacheOption( type="type", # the properties below are optional params={ "params_key": "params" } ), cmd=["cmd"], display_name="displayName", entrypoint=["entrypoint"], exclude=["exclude"], extra_hash="extraHash", file="file", follow_symlinks=cdk.SymlinkFollowMode.NEVER, ignore_mode=cdk.IgnoreMode.GLOB, invalidation=ecr_assets.DockerImageAssetInvalidationOptions( build_args=False, build_secrets=False, build_ssh=False, extra_hash=False, file=False, network_mode=False, outputs=False, platform=False, repository_name=False, target=False ), network_mode=network_mode, outputs=["outputs"], platform=platform, target="target", working_directory="workingDirectory" ) - Attributes - asset_name
- Unique identifier of the docker image asset and its potential revisions. - Required if using AppScopedStagingSynthesizer. - Default:
- no asset name 
 
 
 - build_args
- Build args to pass to the - docker buildcommand.- Since Docker build arguments are resolved before deployment, keys and values cannot refer to unresolved tokens (such as - lambda.functionArnor- queue.queueUrl).- Default:
- no build args are passed 
 
 
 - build_secrets
- Build secrets. - Docker BuildKit must be enabled to use build secrets. - Default:
- no build secrets 
 
- See:
 - Example: - from aws_cdk import DockerBuildSecret build_secrets = { "MY_SECRET": DockerBuildSecret.from_src("file.txt") } 
 - build_ssh
- SSH agent socket or keys to pass to the - docker buildcommand.- Docker BuildKit must be enabled to use the ssh flag - Default:
- no –ssh flag 
 
- See:
 
 - cache_disabled
- Disable the cache and pass - --no-cacheto the- docker buildcommand.- Default:
- cache is used 
 
 
 - cache_from
- Cache from options to pass to the - docker buildcommand.- Default:
- no cache from options are passed to the build command 
 
- See:
 
 - cache_to
- Cache to options to pass to the - docker buildcommand.- Default:
- no cache to options are passed to the build command 
 
- See:
 
 - cmd
- Specify or override the CMD on the specified Docker image or Dockerfile. - This needs to be in the ‘exec form’, viz., - [ 'executable', 'param1', 'param2' ].- Default:
- use the CMD specified in the docker image or Dockerfile. 
 
- See:
 
 - display_name
- A display name for this asset. - If supplied, the display name will be used in locations where the asset identifier is printed, like in the CLI progress information. If the same asset is added multiple times, the display name of the first occurrence is used. - If - assetNameis given, it will also be used as the default- displayName. Otherwise, the default is the construct path of the ImageAsset construct, with respect to the enclosing stack. If the asset is produced by a construct helper function (such as- lambda.Code.fromAssetImage()), this will look like- MyFunction/AssetImage.- We use the stack-relative construct path so that in the common case where you have multiple stacks with the same asset, we won’t show something like - /MyBetaStack/MyFunction/Codewhen you are actually deploying to production.- Default:
- Stack-relative construct path 
 
 
 - entrypoint
- Specify or override the ENTRYPOINT on the specified Docker image or Dockerfile. - An ENTRYPOINT allows you to configure a container that will run as an executable. This needs to be in the ‘exec form’, viz., - [ 'executable', 'param1', 'param2' ].- Default:
- use the ENTRYPOINT in the docker image or Dockerfile. 
 
- See:
- https://docs.docker.com/engine/reference/builder/#entrypoint 
 
 - exclude
- File paths matching the patterns will be excluded. - See - ignoreModeto set the matching behavior. Has no effect on Assets bundled using the- bundlingproperty.- Default:
- nothing is excluded 
 
 
 - extra_hash
- Extra information to encode into the fingerprint (e.g. build instructions and other inputs). - Default:
- hash is only based on source content 
 
 
 - file
- Path to the Dockerfile (relative to the directory). - Default:
- ‘Dockerfile’ 
 
 - follow_symlinks
- A strategy for how to handle symlinks. - Default:
- SymlinkFollowMode.NEVER 
 
 - ignore_mode
- The ignore behavior to use for - excludepatterns.- Default:
- IgnoreMode.GLOB 
 
 - invalidation
- Options to control which parameters are used to invalidate the asset hash. - Default:
- hash all parameters 
 
 
 - 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.DEFAULTwill be used)
 
 
 - outputs
- Outputs to pass to the - docker buildcommand.- Default:
- no outputs are passed to the build command (default outputs are used) 
 
- See:
- https://docs.docker.com/engine/reference/commandline/build/#custom-build-outputs 
 
 - platform
- Platform to build for. - Requires Docker Buildx. - Default:
- no platform specified (the current machine architecture will be used) 
 
 
 - target
- Docker target to build to. - Default:
- no target 
 
 
 - working_directory
- Specify or override the WORKDIR on the specified Docker image or Dockerfile. - A WORKDIR allows you to configure the working directory the container will use. - Default:
- use the WORKDIR in the docker image or Dockerfile. 
 
- See: