Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use API DefinitionBody and Api EventSource Together #1981

Closed
cmarshall10450 opened this issue Apr 7, 2021 · 1 comment
Closed

Use API DefinitionBody and Api EventSource Together #1981

cmarshall10450 opened this issue Apr 7, 2021 · 1 comment

Comments

@cmarshall10450
Copy link

Description:

I am trying to create an API which has routes to invoke Lambda functions but also routes to send data to a Kinesis Data Stream. I am using the AWS::Serverless::Function resource with an Api EventSource to add the route to the AWS::Serverless::Api resource that is also defined in my template. The AWS::Serverless::Api resource also has the DefinitionBody property defined to give a Swagger definition to define the routes for sending requests to Kinesis. This definition is based on the one from the AWS tutorial for sending data from API Gateway to Kinesis.

The deployed API only has the routes defined in the DefinitionBody and none of the routes defined in the Lambda functions.

Steps to reproduce:

  • Add definition from here to DefinitionBody property of AWS::Serverless:Api resource
  • Add EventSource of type Api to AWS::Serverless::Function resource
  • Add RestApiId property to EventSource which references AWS::Serverless:Api resource

Observed result:

The EventSource is not added to the Swagger definition.

Expected result:

I expect both the Kinesis routes and the Lambda function routes to all be added to the API Gateway.

The AWS::Serverless:Api document suggests that SAM will add to the definition body before passing the template to CloudFormation

If certain properties are provided, content may be inserted or modified into the DefinitionBody before being passed to CloudFormation. Properties include Auth, BinaryMediaTypes, Cors, GatewayResponses, Models, and an EventSource of type Api on for a corresponding AWS::Serverless::Function

@sriram-mv sriram-mv added the stage/bug-repro The issue/bug needs to be reproduced label Apr 9, 2021
@sriram-mv
Copy link
Contributor

Looks to be related to an older bug: #650. Closing this issue to track it there.

@sriram-mv sriram-mv added type/duplicate and removed stage/bug-repro The issue/bug needs to be reproduced labels Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants