Closed
Description
Describe the bug
Trying to build lambda function with awslambda.NewDockerImageFunction
that takes handler from AWS ECR. But it throws following error.
Error: Unsupported Lambda runtime for '${Token[TOKEN.832]}': FROM_IMAGE
Regression Issue
- Select this option if this issue appears to be a regression.
Last Known Working CDK Version
No response
Expected Behavior
Should be working as expected where function with Docker Image taken from ECR.
Current Behavior
It throws an error
panic: Error: Unsupported Lambda runtime for '${Token[TOKEN.832]}': FROM_IMAGE
Reproduction Steps
In my code, following lines are being used in construct library. It uses NewDockerImageFunction
to build function and DockerImageCode_FromEcr
to specify the code.
repo := awsecr.Repository_FromRepositoryName(scope, jsii.String(id+"tax-verification-ecr"), jsii.String(props.LambdaImageRepo))
function := awslambda.NewDockerImageFunction(scope, jsii.String(id+"-tax-verification-lambda"), &awslambda.DockerImageFunctionProps{
FunctionName: jsii.String(props.LambdaFunctionName),
Description: jsii.String(props.LambdaDescription),
Architecture: awslambda.Architecture_X86_64(),
Code: awslambda.DockerImageCode_FromEcr(repo, nil),
MemorySize: jsii.Number(256),
Timeout: awscdk.Duration_Seconds(jsii.Number(60)),
Role: lambdaRole,
Environment: &envs,
})
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.1013.0 (build 054afef)
Framework Version
No response
Node.js Version
v20.18.1
OS
Mac OS
Language
Go
Language Version
go version go1.24.0 darwin/arm64
Other information
No response