Skip to content

Commit

Permalink
fix: provide access to GuApiGatewayWithLambdaByPath's API Gateway ins…
Browse files Browse the repository at this point in the history
…tance
  • Loading branch information
jacobwinch committed May 19, 2022
1 parent abc237f commit e8f0b2f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/patterns/api-multiple-lambdas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,10 @@ function isNoMonitoring(
* For details on configuring the individual Lambda functions, see [[`GuLambdaFunction`]].
*/
export class GuApiGatewayWithLambdaByPath {
public readonly api: RestApi;
constructor(scope: GuStack, props: GuApiGatewayWithLambdaByPathProps) {
const apiGateway = new RestApi(scope, "RestApi", props);
this.api = apiGateway;
props.targets.map((target) => {
const resource = apiGateway.root.resourceForPath(target.path);
resource.addMethod(target.httpMethod, new LambdaIntegration(target.lambda));
Expand Down

0 comments on commit e8f0b2f

Please sign in to comment.