Deploying Lambda via CDK inside Amplify App Error

0

I am attempting to deploy a lambda inside an Amplify app with AWS CDK. My CDK code looks like this:

const initiateExportJobFunction = new lambda.Function(
       this,
       `InitiateExportJobFunction`,
       {
         runtime: lambda.Runtime.NODEJS_14_X,
         handler: "index.handler",
         code: lambda.Code.fromAsset(
           path.join(__dirname, "..", "InitiateExportJobFunction")
         ),
       }
     );

The error message is: "Parameters: [AssetParameters97f3093890bbef669e9ff0dafda5999980162ae2645144b4946af24866fc3448S3BucketEF40089D, AssetParameters97f3093890bbef669e9ff0dafda5999980162ae2645144b4946af24866fc3448S3VersionKeyE028CAFF, AssetParameters97f3093890bbef669e9ff0dafda5999980162ae2645144b4946af24866fc3448ArtifactHash3276AB2A] must have values"

This should be a very simple operation. I do not see what I'm doing wrong. Any ideas?

1 Answer
0

It seems it is not finding the Lambda package using the path.

 path.join(__dirname, "..", "InitiateExportJobFunction"

Try the following example: https://cdkworkshop.com/40-dotnet/30-hello-cdk/200-lambda.html

AWS
vtjean
answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions