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?
It appears that deploying lambdas inside of custom resources/CDK is not supported by Amplify. You must bundle the files yourself. See here: https://github.com/aws-amplify/amplify-cli/issues/9055