-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
1. Inline Swagger 2. CodeUri & DefinitionUri support Body, Key and Version dictionary 3. FunctionName property
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
AWSTemplateFormatVersion : '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: A hello world application. | ||
Parameters: | ||
Bucket: | ||
Type: String | ||
CodeZipKey: | ||
Type: String | ||
Resources: | ||
HelloWorldFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs4.3 | ||
CodeUri: s3://<bucket>/hello_world.zip | ||
CodeUri: | ||
Bucket: !Bucket | ||
Key: !CodeZipKey |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
exports.handler = function(event, context, callback) { | ||
callback(null, { | ||
"statusCode": 200, | ||
"body": "hello world" | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
AWSTemplateFormatVersion: '2010-09-09' | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: Simple API Endpoint configured using Swagger specified inline and backed by a Lambda function | ||
Resources: | ||
MyApi: | ||
Type: AWS::Serverless::Api | ||
Properties: | ||
StageName: prod | ||
DefinitionBody: | ||
swagger: 2.0 | ||
info: | ||
title: | ||
Ref: AWS::StackName | ||
paths: | ||
"/get": | ||
get: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong. |
||
x-amazon-apigateway-integration: | ||
httpMethod: POST | ||
type: aws_proxy | ||
uri: | ||
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyLambdaFunction.Arn}/invocations | ||
responses: {} | ||
swagger: '2.0' | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
philipakash
|
||
|
||
|
||
|
||
MyLambdaFunction: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
Handler: index.handler | ||
Runtime: nodejs4.3 | ||
CodeUri: s3://<bucket>/inline_swagger.zip | ||
Events: | ||
GetApi: | ||
Type: Api | ||
Properties: | ||
Path: /get | ||
Method: GET | ||
RestApiId: | ||
Ref: MyApi | ||
|
Is this duplicated notation of
get
intentional?