You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support API Gateway Logging Metrics, Usage Plans, EndpointConfiguration, and CORS #248
Parent Tracking Issue for Logging, Usage Plans, CORS etc on API resources (Implicit and Explicit). As part of this, we will move to a model where all API features will be supported in both Implicit & Explicit definitions consistently.
For deeper details on the different issues, see the appropriate issue that is referenced below.
Reacted by ryanwkan, Manikandan Subramanian, StoyanIvanovI, Alex Casalboni, Linus Guan, rowan, Shaun Egan, Chris Rowe, Joris Conijn, calvchiu and 120 more
Reacted by Jamie van Brunschot, Andrew O'Hara, Joe Feeney, Dimitri (Dimi) Tarasowski, Jon, Mathias, Junji Watanabe, Yves M., Maxwell O'Roark, Alexey Golovnya and 7 more
changed the title [-]Support API Gateway Logging Metrics, Usage Plans, and CORS[/-][+]Support API Gateway Logging Metrics, Usage Plans, EndpointConfiguration, and CORS[/+]on Jan 8, 2018
Regarding the cors:true issue: could you please prioritize? Many users would like to utilize SAM to build web apps -- it is a huge percentage of use cases, many serveless app in fact are NOT "mobile first". Without direct CORS support, it is difficult to use SAM for web apps. Using Swagger with SAM to get around this can be painful and buggy.
Reacted by Eric Esquibel, Alex Casalboni, Ihor Ukolov, Johan Haals, Levi Bracken, Sergio Garcez, John Hann, Sean Carey, A. Tariq, Joe Feeney and 9 more
@rabowskyb All of these (in the issue) are being prioritize with high priority in the team and are going to be the first set of things we will address this year. The team is actively talking about how to move forward and we are trying to do this as quickly as we can. We don't have timelines to share, as of now though. I hope to share more soon.
Reacted by jarrett jordaan, Joris Conijn, Alex Casalboni, Ihor Ukolov, John Hovell, Linus Guan, Ted Armstrong, Andrew O'Hara, Justin Stewart, Joe Lafiosca and 1 more
Does this also mean it will be more straightforward to declare a AWS::ApiGateway::Authorizer resource with Type: "Cognito_user_pool" within a SAM template? There are a few unanswered requests for advice about this topic in the aws-sam-local issue 137 (aws/aws-sam-cli#137)
Reacted by Andrew O'Hara, Joe Lafiosca, juniorclarke, Austin Nevins, Adriano Raiano, ajhool and rfink
Great news, thank you. My question was generally about API Authorizers but specifically about the IAM use case asked by @steveparker-kcom. Just a suggestion... when you ship this, I think a lot of people will appreciate documentation or examples specifically about IAM gateway authorization. Thank you again!
When you do implement the IAM piece, will be simple to get access to the Cognito identity in the lambda functions?
I think it is so close to being a very easy way to setup a website, complete with auth backend, as far as I can tell CORS and Cognito integration are the last pieces of the puzzle. (I could well be missing something with the Cognito bit, only just started looking).
@deleugpn@jona Thanks for following up on this. #444 can't be merged into develop in its current form. It needs to be updated to fit within the Auth syntax we've added to AWS::Serverless::Api since it was merged. We have not currently prioritized this work internally so the fastest way to get it into SAM is for someone from the community to contribute the necessary changes.
#547 is specifically tracking adding support for API Keys to AWS::Serverless::Api. It links to #827 as a good example PR to follow for anyone who wants to implement this feature.
Will (or does) it consider all throttling definitions (AWS::ApiGateway::UsagePlan Throtle; AWS::ApiGateway::UsagePlan ApiStages Throtle; AWS::Serverless::Api MethodSettings)?
I am trying to verify the response messages returned to see whether my response template works when throttling but no matter what all jobs are queued and throttling never occurs on SAM CLI. Maybe I have to do this on AWS. Any hints?
@liam-sage Are you trying to test throttling with 'start-api'? I don't think that really does anything other than add some routes and invoke your function through a simple Flask CGI wrapper - any of the more complicated stuff that API Gateway does like authorizers, throttling, etc are not included.
You can't have it directly on AWS::Serverless::Api as discussed, but AWS SAM supports anything AWS CloudFormation supports so why not to apply this into your code. Template example here.
Then you can just
MyApi:
Type: AWS::Serverless::Api
Properties:
MethodSettings: # Use execution logging
AccessLogSetting: # Use access logging
Activity
[-]Support API Gateway Logging Metrics, Usage Plans, and CORS[/-][+]Support API Gateway Logging Metrics, Usage Plans, EndpointConfiguration, and CORS[/+]rabowskyb commentedon Jan 8, 2018
Regarding the cors:true issue: could you please prioritize? Many users would like to utilize SAM to build web apps -- it is a huge percentage of use cases, many serveless app in fact are NOT "mobile first". Without direct CORS support, it is difficult to use SAM for web apps. Using Swagger with SAM to get around this can be painful and buggy.
jfuss commentedon Jan 8, 2018
@rabowskyb All of these (in the issue) are being prioritize with high priority in the team and are going to be the first set of things we will address this year. The team is actively talking about how to move forward and we are trying to do this as quickly as we can. We don't have timelines to share, as of now though. I hope to share more soon.
samwan commentedon Jan 11, 2018
Does this also mean it will be more straightforward to declare a AWS::ApiGateway::Authorizer resource with Type: "Cognito_user_pool" within a SAM template? There are a few unanswered requests for advice about this topic in the aws-sam-local issue 137 (aws/aws-sam-cli#137)
steveparker-1984 commentedon Jan 12, 2018
Can you confirm if this issue covers the built in AWS_IAM authorizer? It's a bit unclear from reading it but was referred to in the closure of #49
jfuss commentedon Jan 12, 2018
@samwan Yes, we will be supporting AWS::ApiGateway::Authorizer
@steveparker-kcom Yes, this will cover the AWS_IAM authorizer.
I updated the list above to call this explicitly out. (Feel free to update or add more details as well)
samwan commentedon Jan 13, 2018
Great news, thank you. My question was generally about API Authorizers but specifically about the IAM use case asked by @steveparker-kcom. Just a suggestion... when you ship this, I think a lot of people will appreciate documentation or examples specifically about IAM gateway authorization. Thank you again!
johnbest commentedon Jan 16, 2018
When you do implement the IAM piece, will be simple to get access to the Cognito identity in the lambda functions?
I think it is so close to being a very easy way to setup a website, complete with auth backend, as far as I can tell CORS and Cognito integration are the last pieces of the puzzle. (I could well be missing something with the Cognito bit, only just started looking).
77 remaining items
jlhood commentedon May 10, 2019
@deleugpn @jona Thanks for following up on this. #444 can't be merged into develop in its current form. It needs to be updated to fit within the Auth syntax we've added to
AWS::Serverless::Apisince it was merged. We have not currently prioritized this work internally so the fastest way to get it into SAM is for someone from the community to contribute the necessary changes.#547 is specifically tracking adding support for API Keys to
AWS::Serverless::Api. It links to #827 as a good example PR to follow for anyone who wants to implement this feature.crawforde commentedon May 13, 2019
Any updates on this? not being able to add metrics using MethodSettings makes it pretty hard to use serverless in a production environment.
jfuss commentedon May 13, 2019
@crawforde Please see above comment (it's have been released for some time now) #248 (comment)
crawforde commentedon May 13, 2019
Found the docs on it. Thanks! Seems like there was another issue that was preventing this from working.
liam-sage commentedon May 28, 2019
@jfuss, any update on support for throttling?
Will (or does) it consider all throttling definitions (AWS::ApiGateway::UsagePlan Throtle; AWS::ApiGateway::UsagePlan ApiStages Throtle; AWS::Serverless::Api MethodSettings)?
I am trying to verify the response messages returned to see whether my response template works when throttling but no matter what all jobs are queued and throttling never occurs on SAM CLI. Maybe I have to do this on AWS. Any hints?
brandond commentedon May 28, 2019
@liam-sage Are you trying to test throttling with 'start-api'? I don't think that really does anything other than add some routes and invoke your function through a simple Flask CGI wrapper - any of the more complicated stuff that API Gateway does like authorizers, throttling, etc are not included.
phanikrishnahari commentedon Jul 25, 2019
Hi, do we have the feature to enable logging for ApiGateway when deployed using SAM templet?
ShreyaGangishetty commentedon Sep 13, 2019
We have created an RFC #1141 to support creation of Api keys for Auth with Usage Plans. Please let us know your thoughts on the RFC
juhaniniinimaa commentedon Oct 7, 2019
@phanikrishnahari
You can't have it directly on
AWS::Serverless::Apias discussed, but AWS SAM supports anything AWS CloudFormation supports so why not to apply this into your code. Template example here.Then you can just
awsjeffg commentedon Sep 4, 2020
@jfuss this was reviewed as part of backlog review. What's missing here that we need?
sapessi commentedon Mar 17, 2021
Closing this issue for now since most feature requests are addressed. We'll track additional/new items separately.
Fix incorrect url suffix for rest/http api (#248)
Fix incorrect url suffix for rest/http api (aws#248)
Fix incorrect url suffix for rest/http api (aws#248)