awslabs / aws-solutions-constructs

The AWS Solutions Constructs Library is an open-source extension of the AWS Cloud Development Kit (AWS CDK) that provides multi-service, well-architected patterns for quickly defining solutions
https://docs.aws.amazon.com/solutions/latest/constructs/
Apache License 2.0
1.25k stars 249 forks source link

Lambda function is not reusable for OpenApiGatewayToLambda #1191

Closed adminy closed 2 months ago

adminy commented 3 months ago

when I try to reuse a lambda function in OpenApiGatewayToLambda constructor via existingLambdaObj, I get an error relating to https://github.com/awslabs/aws-solutions-constructs/blob/9315c9324cb902a50b852a4d61dbb17f8573e2a7/source/patterns/%40aws-solutions-constructs/aws-openapigateway-lambda/lib/index.ts#L215

as this permission is added for every lambda but cdk would create it over and over again with the same name and it has an expectation of it to be unique.

biffgaut commented 2 months ago

Just to clarify as we dive deeper - you are sharing a Lambda function between 2 openapigateway-lambda constructs?

biffgaut commented 2 months ago

We've implemented the fix for this, it should be published to the various repositories this evening.

adminy commented 2 months ago

thank you.

biffgaut commented 2 months ago

v2.71.0 includes this fix