Being new to AWS CDK, I am currently in the process of creating an API gateway and connecting it to an AWS lambda. However, I want these two components to have separate code structures.
I've created the lambda functions and the API gateway in two different projects, and both are initialized in my AWS console. The challenge now is figuring out how to connect my API gateway to the lambdas.
The only solution I could come up with was:
new lambda.Function(this, 'createPr', {
code: lambda.Code.asset("resources/lambdas"),
....
....
});
Unfortunately, this method requires the directory structure to point towards the lambda code.
Any assistance on this matter would be greatly appreciated!