class DockerImageCode
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.Lambda.DockerImageCode |
Java | software.amazon.awscdk.services.lambda.DockerImageCode |
Python | aws_cdk.aws_lambda.DockerImageCode |
TypeScript (source) | @aws-cdk/aws-lambda » DockerImageCode |
Code property for the DockerImageFunction construct.
Example
new lambda.DockerImageFunction(this, 'AssetFunction', {
code: lambda.DockerImageCode.fromImageAsset(path.join(__dirname, 'docker-handler')),
});
Initializer
new DockerImageCode()
Methods
Name | Description |
---|---|
static from | Use an existing ECR image as the Lambda code. |
static from | Create an ECR image from the specified asset and bind it as the Lambda code. |
static fromEcr(repository, props?)
public static fromEcr(repository: IRepository, props?: EcrImageCodeProps): DockerImageCode
Parameters
- repository
IRepository
— the ECR repository that the image is in. - props
Ecr
— properties to further configure the selected image.Image Code Props
Returns
Use an existing ECR image as the Lambda code.
static fromImageAsset(directory, props?)
public static fromImageAsset(directory: string, props?: AssetImageCodeProps): DockerImageCode
Parameters
- directory
string
— the directory from which the asset must be created. - props
Asset
— properties to further configure the selected image.Image Code Props
Returns
Create an ECR image from the specified asset and bind it as the Lambda code.