aws-serverless

How to enable “ApiKeyRequired” property in SAM without explicit swagger definition?

廉价感情. 提交于 2019-12-04 04:43:06
问题 In cloudformation, AWS::ApiGateway::Method has a boolean property ApiKeyRequired . How can i achieve the same in SAM ? I know that we can enable using explicit swagger Configuration. which is like this { "swagger": "2.0", "info": { "version": "1.0", "title": { "Ref": "AWS::StackName" } }, "x-amazon-apigateway-api-key-source": "HEADER", "paths": { "/": { "get": { "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:aws:apigateway:${AWS:

How to enable “ApiKeyRequired” property in SAM without explicit swagger definition?

丶灬走出姿态 提交于 2019-12-01 21:35:20
In cloudformation, AWS::ApiGateway::Method has a boolean property ApiKeyRequired . How can i achieve the same in SAM ? I know that we can enable using explicit swagger Configuration. which is like this { "swagger": "2.0", "info": { "version": "1.0", "title": { "Ref": "AWS::StackName" } }, "x-amazon-apigateway-api-key-source": "HEADER", "paths": { "/": { "get": { "x-amazon-apigateway-integration": { "httpMethod": "POST", "type": "aws_proxy", "uri": { "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetHelloWorld.Arn}/invocations" } }, "responses": {}, "security":

SAM Serverless implicit API vs AWS::Serverless::Api

拥有回忆 提交于 2019-11-30 19:17:40
问题 When configuring a SAM template and defining a AWS::Serverless::Function there is the Events param that accepts an Api type. Does this create an API Gateway resource? What is the difference between this event type and a standalone AWS::Serverless::Api resource? 回答1: The question asks about the APIs referred to in the Event source block of a SAM AWS::Serverless::Function type, such as: MyFunction: Type: AWS::Serverless::Function Properties: ... Events: MyApi: Type: Api Properties: Path: