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

HttpApi event type does not work with local start-api #1641

Closed
Lanchez opened this issue Dec 5, 2019 · 19 comments · Fixed by #1942
Closed

HttpApi event type does not work with local start-api #1641

Lanchez opened this issue Dec 5, 2019 · 19 comments · Fixed by #1942
Labels
type/feature Feature request

Comments

@Lanchez
Copy link

Lanchez commented Dec 5, 2019

Description

I renamed all Api events from functions to HttpApi and sam local start-api gives error message Error: Template does not have any APIs connected to Lambda functions

Steps to reproduce

Create a function with event type HttpApi without any events of type Api and try to start local start-api

Observed result

Found '0' API Events in Serverless function with name 'XXX'
...
Removed duplicates from '0' Explicit APIs and '0' Implicit APIs to produce '0' APIs
0 APIs found in the template
Sending Telemetry: {'metrics': [{'commandRun': {'awsProfileProvided': False, 'debugFlagProvided': True, 'region': '', 'commandName': 'sam local start-api', 'duration': 242, 'exitReason': 'UserException', 'exitCode': 1, 'requestId': '76b3766e-5990-4e27-ae83-98f7d13b012c', 'installationId': '9ce7efdf-c007-4c1d-920f-939c97325721', 'sessionId': 'e46aa880-3d79-4ae3-92e9-139ccddd56d0', 'executionEnvironment': 'CLI', 'pyversion': '3.7.5', 'samcliVersion': '0.37.0'}}]}
HTTPSConnectionPool(host='aws-serverless-tools-telemetry.us-west-2.amazonaws.com', port=443): Read timed out. (read timeout=0.1)
Error: Template does not have any APIs connected to Lambda functions

Expected result

Local api starts with HttpApi event type just like with Api event type.

Additional environment details (Ex: Windows, Mac, Amazon Linux etc)

  1. OS: Ubuntu 18.04
  2. sam --version: 0.37.0
@sanathkr
Copy link
Contributor

sanathkr commented Dec 9, 2019

Good catch. This is on our immediate roadmap to support. Marking this as a feature request for visibility.

@sanathkr sanathkr added the type/feature Feature request label Dec 9, 2019
@enobufs
Copy link

enobufs commented Feb 4, 2020

I'm exploring HttpApi and came across this issue. When would this become available?

@apemberton
Copy link

Following...

1 similar comment
@metaskills
Copy link
Contributor

Following...

@metaskills
Copy link
Contributor

Does it work with local invoke?

@metaskills
Copy link
Contributor

Adding some context. I have noticed that v0.45.0 does add full support for AWS::Serverless::HttpApi which I think was error'ing out for me prior on properties like Tags.

But in order for our team to update our highest invoked Lambda to HTTP API, we need the start-api feature to work since we use that for integration tests server.

@MartinMasek
Copy link

Tested on version v0.45.0
Any updates on this (ETA)? I have to manually set Event to Api instead of HttpApi when I want to test locally which not the best flow.

@amrabdelshafi97
Copy link

I updated sam to v0.47.0 and still HttpApi not working with local start-api

@davidpach
Copy link

Hi,

Is there any update? Also in my organization we are waiting for this feature.

Thanks!

@pyk
Copy link
Contributor

pyk commented Apr 25, 2020

Hi guys, I just add HttpApi support in local start-api. You can see the MR #1942.

@rasensio
Copy link

+1 to this guys, as soon as people discover HttpApi and how faster and cheaper it is , this will become a big missing feature

@MartinMasek
Copy link

@sanathkr Is there any update on this please? We're starting a new project and I noticed it's not done yet.
PR from @pyk has 1 not passing test. Seems we could be almost there :)

@InspectorDeno
Copy link

+1

@rowanu
Copy link

rowanu commented Jun 14, 2020

This is so close to being fixed - thanks for your work @pyk!

@sanathkr can you please confirm if the only thing holding back @pyk's PR being merged is the failing test?
Looks like there's a comment on the PR how to fix it already, but if @pyk is too busy I can re-branch and add it to his work...

@pyk
Copy link
Contributor

pyk commented Jun 15, 2020

I've updated my PR, now all tests are passed successfully 🙏

@rowanu
Copy link

rowanu commented Jun 15, 2020

Thanks @pyk! 🙇

@jfuss any chance you can have a look at this one and let us know what's needed to be able to merge it? It's a big blocker to using the new HTTP API like the old REST API in SAM 🐿️ 🙏

@sebsto
Copy link

sebsto commented Jul 16, 2020

Is this supposed to be fixed ?
I can still reproduce this

sam --version
SAM CLI, version 0.53.0

@drissamri
Copy link

just tested this with 1.0.0, still not possible

@saminnet
Copy link

saminnet commented Aug 5, 2020

Yeah with 1.0.0, still doesn't work, it would have been nice to be able to test the api locally!

@awsjeffg awsjeffg added the stage/pm-review Waiting for review by our Product Manager, please don't work on this yet label Aug 6, 2020
@awsjeffg awsjeffg linked a pull request Aug 7, 2020 that will close this issue
6 tasks
@awsjeffg awsjeffg removed the stage/pm-review Waiting for review by our Product Manager, please don't work on this yet label Oct 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/feature Feature request
Projects
None yet
Development

Successfully merging a pull request may close this issue.