Aws-sam-cli: HttpApi event type does not work with local start-api

Created on 5 Dec 2019  ·  19Comments  ·  Source: aws/aws-sam-cli

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
typfeature

Most helpful comment

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

All 19 comments

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

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

Following...

Following...

Does it work with local invoke?

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.

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.

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

Hi,

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

Thanks!

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

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

@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 :)

+1

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...

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

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 🐿️ 🙏

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

sam --version
SAM CLI, version 0.53.0

just tested this with 1.0.0, still not possible

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

Was this page helpful?
0 / 5 - 0 ratings