1 Answer
- Newest
- Most votes
- Most comments
0
Function function = (Function) lambdaStack.getAlias().getLambda()
ApiGatewayToLambda integrationSolution = ApiGatewayToLambda.Builder
.create(this, "ApiGatewayToLambdaPattern")
.existingLambdaObj(function)
.build();
Kindly notice how the IFunction interface is extracted from the Alias using the getLambda() method, which I then need to cast into a Function object.
[1] - existingLambdaObj source code https://github.com/awslabs/aws-solutions-constructs/blob/main/source/patterns/%40aws-solutions-constructs/aws-apigateway-lambda/lib/index.ts#L32
[2] - Allow Lambda Aliases To Be Used With Constructs #208 https://github.com/awslabs/aws-solutions-constructs/issues/208
[3] - getLambda() https://docs.aws.amazon.com/cdk/api/v2/java/software/amazon/awscdk/services/lambda/Alias.html#getLambda
Solved this issue with the help of AWS Support, sharing here to make the solution available in this public forum, I hope it helps others.
Relevant content
- Accepted Answerasked 3 years ago
- AWS OFFICIALUpdated 3 months ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated 7 months ago
Looks like there is an issue open in the github with the similar feature request - https://github.com/awslabs/aws-solutions-constructs/issues/208