Open ETisREAL opened 1 year ago
For lambda container runtime, I think you should use DockerImageFunction instead.
No, that's not it. DockerImageFunction is what I should use if I already have the image pushed to ECR. In this case I ma trying to build it on deployment
@ETisREAL DockerImageFunction allows you to specify DockerImageCode for the code
property. And you can specify your local docker assets directory with fromImageAssets. On cdk synth, the docker image assets will be built with docker build
from the path you specify and published to the staging ECR repo. Is this something you expect?
@pahud As the fllowing code I suppose: new lambda.DockerImageFunction(this, 'leaderboardsStreamHandler', { functionName: 'leaderboardsStreamHandler', code: lambda.DockerImageCode.fromImageAsset(path.resolve('resources/lambdas-code/leaderboardsStreamHandler/code')), environment: { 'TABLE_NAME': props.leaderboardsTable.tableName, 'STAGE': props.STAGE.toLowerCase() }, events: [ new lambda_event_sources.DynamoEventSource(props.leaderboardsTable, { startingPosition: lambda.StartingPosition.TRIM_HORIZON, retryAttempts: 2, batchSize: 1, filters: [ lambda.FilterCriteria.filter({ dynamodb: { Keys: { PK: {S: lambda.FilterRule.beginsWith('PARTICIPANT#')}, SK: {S: lambda.FilterRule.beginsWith('#TOURNAMENT#')} } } }) ] }) ], logRetention: RetentionDays.ONE_WEEK, description: 'Lambda function responsible for creating and updating leaderboards' })
Describe the bug
I am trying to deploy a dockerized lambda function.
This is my code:
The Image build completes succesfully, but I get the error reported below:
Why is this happening? It doesn't make any sense :/
Expected Behavior
I am following the documentation, so it should work just fine TBH
Current Behavior
I get the following error:
Reproduction Steps
cdk deploy
Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.87
Framework Version
No response
Node.js Version
v18.04
OS
Linux - Ubuntu
Language
Typescript
Language Version
No response
Other information
No response