aws-cdk-lib.aws_lambda.EcrImageCode

class EcrImageCode

LanguageType name
.NETAmazon.CDK.AWS.Lambda.EcrImageCode
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awslambda#EcrImageCode
Javasoftware.amazon.awscdk.services.lambda.EcrImageCode
Pythonaws_cdk.aws_lambda.EcrImageCode
TypeScript (source)aws-cdk-lib » aws_lambda » EcrImageCode

Extends Code

Represents a Docker image in ECR that can be bound as Lambda Code.

Example

// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ecr as ecr } from 'aws-cdk-lib';
import { aws_lambda as lambda } from 'aws-cdk-lib';

declare const repository: ecr.Repository;
const ecrImageCode = new lambda.EcrImageCode(repository, /* all optional props */ {
  cmd: ['cmd'],
  entrypoint: ['entrypoint'],
  tag: 'tag',
  tagOrDigest: 'tagOrDigest',
  workingDirectory: 'workingDirectory',
});

Initializer

new EcrImageCode(repository: IRepository, props?: EcrImageCodeProps)

Parameters

  • repository IRepository
  • props EcrImageCodeProps

Properties

NameTypeDescription
isInlinebooleanDetermines whether this Code is inline code or not.

isInline

Type: boolean

Determines whether this Code is inline code or not.

Methods

NameDescription
bind(_scope)Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.
bindToResource(_resource, _options?)Called after the CFN function resource has been created to allow the code class to bind to it.

bind(_scope)

public bind(_scope: Construct): CodeConfig

Parameters

  • _scope Construct

Returns

  • CodeConfig

Called when the lambda or layer is initialized to allow this object to bind to the stack, add resources and have fun.


bindToResource(_resource, _options?)

public bindToResource(_resource: CfnResource, _options?: ResourceBindOptions): void

Parameters

  • _resource CfnResource
  • _options ResourceBindOptions

Called after the CFN function resource has been created to allow the code class to bind to it.

Specifically it's required to allow assets to add metadata for tooling like SAM CLI to be able to find their origins.