-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Description
Description:
When deploying an implicit API with SAM and then doing what I take to be the same steps in API Gateway in the AWS Console, I end up with a different configuration. To be sure, I'm not sure if this is a support request or a behaviour that needs better documentation or a bug.
Steps to reproduce the issue:
1/ In Console, create a Proxy resource. Steps: Go to API Gateway => Create API => (Name=MyAPI, Endpoint Type=Edge Optimized). Then: Actions => Create Resource => (Configure as Proxy resource, leave Enable API Gateway CORS UNchecked) => Create Resource. Then: Lambda Function=Some Lambda Function. Then: Save. Then: Select the /{proxy+} resource => Actions => Enable CORS => (Gateway Responses for MyAPI API=Default 4XX,Default 5XX) => Enable CORS and replace existing CORS headers.
2/ In a SAM template:
Globals:
Api:
EndpointConfiguration: EDGE
Cors:
AllowMethods: "'DELETE,GET,HEAD,OPTIONS,PATCH,POST,PUT'"
AllowHeaders: "'Content-Type,X-Amz-Date,Authorization,X-Api-Key,X-Amz-Security-Token'"
AllowOrigin: "'*'"
Resources:
ChatAPIFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: my-api/
Handler: index.handler
Runtime: nodejs8.10
Policies: AmazonS3ReadOnlyAccess
Events:
ProxyApiGreedy:
Type: Api
Properties:
Path: /{proxy+}
Method: ANY
Observed result:
For the manually create API I see in the Method Response "Models: application/json => Empty" as shown here:
For the SAM-created API I don't see the Models:
Expected result:
I expected both these approaches to result in the same config, and if not, I expected to be able to somehow use SAM to generate the same config I generated manually.
Additional info:
This may be related to #640