Skip to content

Commit 5c886b5

Browse files
authored
Merge branch 'master' into sls-govcloud
2 parents 5477eb2 + bd196e0 commit 5c886b5

File tree

136 files changed

+4487
-2263
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

136 files changed

+4487
-2263
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,7 @@ jest
5454
# VIM
5555
*.swp
5656

57-
# .NET Build files
57+
# DotNet
5858
obj/
59+
[Bb]in/
60+
[Oo]bj/

CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
# 1.26.1 (27.02.2018)
2+
- [Fix lambda integration regression](https://github.com/serverless/serverless/pull/4775)
3+
4+
## Meta
5+
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.26.0...v1.26.1)
6+
7+
# 1.26.0 (29.01.2018)
8+
- [AWS Go support](https://github.com/serverless/serverless/pull/4669)
9+
- [Support for using an existing ApiGateway and Resources](https://github.com/serverless/serverless/pull/4247)
10+
- [Add logRetentionInDays config](https://github.com/serverless/serverless/pull/4591)
11+
- [Add support of `serverless.js` configuration file](https://github.com/serverless/serverless/pull/4590)
12+
- [Add "did you mean..." CLI suggestions](https://github.com/serverless/serverless/pull/4586)
13+
- [Add `--template-path` option to `serverless create`](https://github.com/serverless/serverless/pull/4576)
14+
- [Add support POJO input support for Java invoke local](https://github.com/serverless/serverless/pull/4596)
15+
16+
## Meta
17+
- [Comparison since last release](https://github.com/serverless/serverless/compare/v1.25.0...v1.26.0)
18+
19+
120
# 1.25.0 (20.12.2017)
221
- [Improve Stage and Region Usage](https://github.com/serverless/serverless/pull/4560)
322
- [Add API Gateway endpoint configuration](https://github.com/serverless/serverless/pull/4531)

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
**The Serverless Framework** – Build applications comprised of microservices that run in response to events, auto-scale for you, and only charge you when they run. This lowers the total cost of maintaining your apps, enabling you to build more logic, faster.
1414

15-
The Framework uses new event-driven compute services, like AWS Lambda, Google CloudFunctions, and more. It's a command-line tool, providing scaffolding, workflow automation and best practices for developing and deploying your serverless architecture. It's also completely extensible via plugins.
15+
The Framework uses new event-driven compute services, like AWS Lambda, Google Cloud Functions, and more. It's a command-line tool, providing scaffolding, workflow automation and best practices for developing and deploying your serverless architecture. It's also completely extensible via plugins.
1616

1717
Serverless is an MIT open-source project, actively maintained by a full-time, venture-backed team.
1818

@@ -132,7 +132,7 @@ The following are services you can instantly install and use by running `serverl
132132

133133
## <a name="features"></a>Features
134134

135-
* Supports Node.js, Python, Java, Scala, C#, F#, Groovy, Kotlin, PHP & Swift.
135+
* Supports Node.js, Python, Java, Scala, C#, F#, Go, Groovy, Kotlin, PHP & Swift.
136136
* Manages the lifecycle of your serverless architecture (build, deploy, update, delete).
137137
* Safely deploy functions, events and their required resources together via provider resource managers (e.g., AWS CloudFormation).
138138
* Functions can be grouped ("serverless services") for easy management of code, resources & processes, across large projects & teams.
@@ -158,7 +158,7 @@ This table is generated from https://github.com/serverless/plugins/blob/master/p
158158
| **[Raml Serverless](https://github.com/andrewcurioso/raml-serverless)** <br/> Serverless plugin to work with RAML API spec documents | [andrewcurioso](http://github.com/andrewcurioso) |
159159
| **[Serverless Alexa Plugin](https://github.com/rajington/serverless-alexa-plugin)** <br/> Serverless plugin to support Alexa Lambda events | [rajington](http://github.com/rajington) |
160160
| **[Serverless Api Stage](https://github.com/leftclickben/serverless-api-stage)** <br/> Serverless API Stage plugin, enables stage variables and logging for AWS API Gateway. | [leftclickben](http://github.com/leftclickben) |
161-
| **[Serverless Apig S3](https://github.com/sdd/serverless-apig-s3)** <br/> Serve static front-end content from S3 via the API Gatewy and deploy client bundle to S3. | [sdd](http://github.com/sdd) |
161+
| **[Serverless Apig S3](https://github.com/sdd/serverless-apig-s3)** <br/> Serve static front-end content from S3 via the API Gateway and deploy client bundle to S3. | [sdd](http://github.com/sdd) |
162162
| **[Serverless Apigateway Plugin](https://github.com/GFG/serverless-apigateway-plugin)** <br/> Configure the AWS api gateway: Binary support, Headers and Body template mappings | [GFG](http://github.com/GFG) |
163163
| **[Serverless Apigw Binary](https://github.com/maciejtreder/serverless-apigw-binary)** <br/> Plugin to enable binary support in AWS API Gateway. | [maciejtreder](http://github.com/maciejtreder) |
164164
| **[Serverless Apigwy Binary](https://github.com/ryanmurakami/serverless-apigwy-binary)** <br/> Serverless plugin for configuring API Gateway to return binary responses | [ryanmurakami](http://github.com/ryanmurakami) |
@@ -263,6 +263,7 @@ This table is generated from https://github.com/serverless/examples/blob/master/
263263
-->
264264
| Project Name | Author |
265265
|:-------------|:------:|
266+
| **[Serverless Architecture Boilerplate](https://github.com/msfidelis/serverless-architecture-boilerplate)** <br/> Boilerplate to organize and deploy big projects using Serverless and CloudFormation on AWS | [msfidelis](http://github.com/msfidelis) |
266267
| **[Jwtauthorizr](https://github.com/serverlessbuch/jwtAuthorizr)** <br/> Custom JWT Authorizer Lambda function for Amazon API Gateway with Bearer JWT | [serverlessbuch](http://github.com/serverlessbuch) |
267268
| **[Serverless Graphql Api](https://github.com/boazdejong/serverless-graphql-api)** <br/> Serverless GraphQL API using Lambda and DynamoDB | [boazdejong](http://github.com/boazdejong) |
268269
| **[Serverless Screenshot](https://github.com/svdgraaf/serverless-screenshot)** <br/> Serverless Screenshot Service using PhantomJS | [svdgraaf](http://github.com/svdgraaf) |

docker-compose.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,19 @@ services:
6060
volumes:
6161
- ./tmp/serverless-integration-test-aws-csharp:/app
6262
aws-fsharp:
63-
image: microsoft/dotnet:1.0.4-sdk
63+
image: microsoft/dotnet:2.0-sdk
6464
volumes:
6565
- ./tmp/serverless-integration-test-aws-fsharp:/app
66+
aws-go:
67+
image: golang:1.9
68+
volumes:
69+
- ./tmp/serverless-integration-test-aws-go:/app
70+
- ./tmp/serverless-integration-test-aws-go:/go/src/app
71+
aws-go-dep:
72+
image: yunspace/golang:1.9
73+
volumes:
74+
- ./tmp/serverless-integration-test-aws-go-dep:/app
75+
- ./tmp/serverless-integration-test-aws-go-dep:/go/src/app
6676
aws-nodejs-typescript:
6777
image: node:6.10.3
6878
volumes:

docs/providers/aws/events/alexa-skill.md

Lines changed: 29 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,41 @@ layout: Doc
1414

1515
## Event definition
1616

17-
This will enable your Lambda function to be called by an Alexa skill kit.
17+
This will enable your Lambda function to be called by an Alexa Skill kit.
18+
`amzn1.ask.skill.xx-xx-xx-xx-xx` is a skill ID for Alexa Skills kit. You receive a skill ID once you register and create a skill in [Amazon Developer Console](https://developer.amazon.com/).
19+
After deploying, add your deployed Lambda function ARN to which this event is attached to the Service Endpoint under Configuration on Amazon Developer Console.
1820

1921
```yml
2022
functions:
2123
mySkill:
2224
handler: mySkill.handler
2325
events:
24-
- alexaSkill
26+
- alexaSkill: amzn1.ask.skill.xx-xx-xx-xx-xx
2527
```
2628
2729
You can find detailed guides on how to create an Alexa Skill with Serverless using NodeJS [here](https://github.com/serverless/examples/tree/master/aws-node-alexa-skill) as well as in combination with Python [here](https://github.com/serverless/examples/tree/master/aws-python-alexa-skill).
30+
31+
## Enabling / Disabling
32+
33+
**Note:** `alexaSkill` events are enabled by default.
34+
35+
This will create and attach a alexaSkill event for the `mySkill` function which is disabled. If enabled it will call
36+
the `mySkill` function by an Alexa Skill.
37+
38+
```yaml
39+
functions:
40+
mySkill:
41+
handler: mySkill.handler
42+
events:
43+
- alexaSkill:
44+
appId: amzn1.ask.skill.xx-xx-xx-xx
45+
enabled: false
46+
```
47+
48+
## Backwards compatibility
49+
50+
Previous syntax of this event didn't require a skill ID as parameter, but according to [Amazon's documentation](https://developer.amazon.com/docs/custom-skills/host-a-custom-skill-as-an-aws-lambda-function.html#configuring-the-alexa-skills-kit-trigger) you should restrict your lambda function to be executed only by your skill.
51+
52+
Omitting the skill id will make your Lambda function available for the public, allowing any other skill developer to invoke it.
53+
54+
(This is important, as [opposing to custom HTTPS endpoints](https://developer.amazon.com/docs/custom-skills/handle-requests-sent-by-alexa.html#request-verify), there's no way to validate the request was sent by your skill.)

docs/providers/aws/events/apigateway.md

Lines changed: 51 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,32 @@ layout: Doc
1212

1313
# API Gateway
1414

15+
- [Lambda Proxy Integration](#lambda-proxy-integration)
16+
- [Simple HTTP Endpoint](#simple-http-endpoint)
17+
- [Example "LAMBDA-PROXY" event (default)](#example-lambda-proxy-event-default)
18+
- [HTTP Endpoint with Extended Options](#http-endpoint-with-extended-options)
19+
- [Enabling CORS](#enabling-cors)
20+
- [HTTP Endpoints with `AWS_IAM` Authorizers](#http-endpoints-with-awsiam-authorizers)
21+
- [HTTP Endpoints with Custom Authorizers](#http-endpoints-with-custom-authorizers)
22+
- [Catching Exceptions In Your Lambda Function](#catching-exceptions-in-your-lambda-function)
23+
- [Setting API keys for your Rest API](#setting-api-keys-for-your-rest-api)
24+
- [Request Parameters](#request-parameters)
25+
- [Lambda Integration](#lambda-integration)
26+
- [Example "LAMBDA" event (before customization)](#example-lambda-event-before-customization)
27+
- [Request templates](#request-templates)
28+
- [Default Request Templates](#default-request-templates)
29+
- [Custom Request Templates](#custom-request-templates)
30+
- [Pass Through Behavior](#pass-through-behavior)
31+
- [Responses](#responses)
32+
- [Custom Response Headers](#custom-response-headers)
33+
- [Custom Response Templates](#custom-response-templates)
34+
- [Status codes](#status-codes)
35+
- [Available Status Codes](#available-status-codes)
36+
- [Using Status Codes](#using-status-codes)
37+
- [Custom Status Codes](#custom-status-codes)
38+
- [Setting an HTTP Proxy on API Gateway](#setting-an-http-proxy-on-api-gateway)
39+
- [Share API Gateway and API Resources](#share-api-gateway-and-api-resources)
40+
1541
_Are you looking for tutorials on using API Gateway? Check out the following resources:_
1642

1743
> - [Add a custom domain for your API Gateway](https://serverless.com/blog/serverless-api-gateway-domain/)
@@ -321,7 +347,7 @@ functions:
321347
identityValidationExpression: someRegex
322348
```
323349

324-
You can also use the Request Type Authorizer by setting the `type` property. In this case, your `identitySource` could contain multiple entries for you policy cache. The default `type` is 'token'.
350+
You can also use the Request Type Authorizer by setting the `type` property. In this case, your `identitySource` could contain multiple entries for your policy cache. The default `type` is 'token'.
325351

326352
```yml
327353
functions:
@@ -497,6 +523,7 @@ This method is more complicated and involves a lot more configuration of the `ht
497523
"cognitoPoolClaims": {
498524
"sub": ""
499525
},
526+
"enhancedAuthContext": {},
500527
"headers": {
501528
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8",
502529
"Accept-Encoding": "gzip, deflate, br",
@@ -633,33 +660,7 @@ See the [api gateway documentation](https://docs.aws.amazon.com/apigateway/lates
633660
**Notes:**
634661

635662
- A missing/empty request Content-Type is considered to be the API Gateway default (`application/json`)
636-
- [Read this on the main serverless docs site](https://www.serverless.com/framework/docs/providers/aws/events/apigateway)
637-
- [API Gateway](#api-gateway)
638-
- [Lambda Proxy Integration](#lambda-proxy-integration)
639-
- [Simple HTTP Endpoint](#simple-http-endpoint)
640-
- [Example "LAMBDA-PROXY" event (default)](#example-lambda-proxy-event-default)
641-
- [HTTP Endpoint with Extended Options](#http-endpoint-with-extended-options)
642-
- [Enabling CORS](#enabling-cors)
643-
- [HTTP Endpoints with `AWS_IAM` Authorizers](#http-endpoints-with-awsiam-authorizers)
644-
- [HTTP Endpoints with Custom Authorizers](#http-endpoints-with-custom-authorizers)
645-
- [Catching Exceptions In Your Lambda Function](#catching-exceptions-in-your-lambda-function)
646-
- [Setting API keys for your Rest API](#setting-api-keys-for-your-rest-api)
647-
- [Request Parameters](#request-parameters)
648-
- [Lambda Integration](#lambda-integration)
649-
- [Example "LAMBDA" event (before customization)](#example-lambda-event-before-customization)
650-
- [Request templates](#request-templates)
651-
- [Default Request Templates](#default-request-templates)
652-
- [Custom Request Templates](#custom-request-templates)
653-
- [Pass Through Behavior](#pass-through-behavior)
654-
- [Responses](#responses)
655-
- [Custom Response Headers](#custom-response-headers)
656-
- [Custom Response Templates](#custom-response-templates)
657-
- [Status codes](#status-codes)
658-
- [Available Status Codes](#available-status-codes)
659-
- [Using Status Codes](#using-status-codes)
660-
- [Custom Status Codes](#custom-status-codes)
661-
- [Setting an HTTP Proxy on API Gateway](#setting-an-http-proxy-on-api-gateway)
662-
- [Share API Gateway and API Resources](#share-api-gateway-and-api-resources)
663+
- API Gateway docs refer to "WHEN_NO_TEMPLATE" (singular), but this will fail during creation as the actual value should be "WHEN_NO_TEMPLATES" (plural)
663664

664665
### Responses
665666

@@ -857,11 +858,11 @@ Now that you have these two CloudFormation templates defined in your `serverless
857858

858859
## Share API Gateway and API Resources
859860

860-
As you application grows, you will have idea to break it out into multiple services. However, each serverless project generates new API Gateway by default. If you want to share same API Gateway for muliple projects, you 'll need to reference REST API ID and Root Resource ID into serverless.yml files
861+
As your application grows, you will likely need to break it out into multiple, smaller services. By default, each Serverless project generates a new API Gateway. However, you can share the same API Gateway between multiple projects by referencing its REST API ID and Root Resource ID in `serverless.yml` as follows:
861862

862863
```yml
863864
service: service-name
864-
provider:
865+
provider:
865866
name: aws
866867
apiGateway:
867868
restApiId: xxxxxxxxxx # REST API resource ID. Default is generated by the framework
@@ -872,13 +873,14 @@ functions:
872873
873874
```
874875

875-
In case the application has many chilren and grandchildren paths, you also want to break them out into smaller services.
876+
877+
If your application has many nested paths, you might also want to break them out into smaller services.
876878

877879
```yml
878880
service: service-a
879-
provider:
881+
provider:
880882
apiGateway:
881-
restApiId: xxxxxxxxxx
883+
restApiId: xxxxxxxxxx
882884
restApiRootResourceId: xxxxxxxxxx
883885
884886
functions:
@@ -892,10 +894,10 @@ functions:
892894

893895
```yml
894896
service: service-b
895-
provider:
897+
provider:
896898
apiGateway:
897-
restApiId: xxxxxxxxxx
898-
restApiRootResourceId: xxxxxxxxxx
899+
restApiId: xxxxxxxxxx
900+
restApiRootResourceId: xxxxxxxxxx
899901
900902
functions:
901903
create:
@@ -906,28 +908,28 @@ functions:
906908
path: /posts/{id}/comments
907909
```
908910

909-
They reference the same parent path `/posts`. Cloudformation will throw error if we try to generate existed one. To avoid that, we must reference source ID of `/posts`.
911+
The above example services both reference the same parent path `/posts`. However, Cloudformation will throw an error if we try to generate an existing path resource. To avoid that, we reference the resource ID of `/posts`:
910912

911913
```yml
912914
service: service-a
913-
provider:
915+
provider:
914916
apiGateway:
915-
restApiId: xxxxxxxxxx
917+
restApiId: xxxxxxxxxx
916918
restApiRootResourceId: xxxxxxxxxx
917919
restApiResources:
918920
/posts: xxxxxxxxxx
919-
921+
920922
functions:
921923
...
922924
923925
```
924926

925927
```yml
926928
service: service-b
927-
provider:
929+
provider:
928930
apiGateway:
929-
restApiId: xxxxxxxxxx
930-
restApiRootResourceId: xxxxxxxxxx
931+
restApiId: xxxxxxxxxx
932+
restApiRootResourceId: xxxxxxxxxx
931933
restApiResources:
932934
/posts: xxxxxxxxxx
933935
@@ -936,18 +938,19 @@ functions:
936938
937939
```
938940

939-
You can define more than one path resource. Otherwise, serverless will generate paths from root resource. `restApiRootResourceId` can be optional if there isn't path that need to be generated from the root
941+
You can define more than one path resource, but by default, Serverless will generate them from the root resource.
942+
`restApiRootResourceId` is optional if a path resource isn't required for the root (`/`).
940943

941944
```yml
942945
service: service-a
943-
provider:
946+
provider:
944947
apiGateway:
945-
restApiId: xxxxxxxxxx
948+
restApiId: xxxxxxxxxx
946949
# restApiRootResourceId: xxxxxxxxxx # Optional
947950
restApiResources:
948951
/posts: xxxxxxxxxx
949952
/categories: xxxxxxxxx
950-
953+
951954
952955
functions:
953956
listPosts:
@@ -966,4 +969,4 @@ functions:
966969
967970
```
968971

969-
For best practice and CI, CD friendly, we should define Cloudformation resources from early service, then use Cross-Stack References for another ones.
972+
To be more in line with best practices and to be CI/CD friendly, we should define CloudFormation resources from an earlier service, then use Cross-Stack References from it in future projects.

docs/providers/aws/events/cloudwatch-event.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,24 @@ functions:
111111
state:
112112
- pending
113113
```
114+
115+
## Specifying a Name
116+
117+
You can also specify a CloudWatch Event name. Keep in mind that the name must begin with a letter; contain only ASCII letters, digits, and hyphens; and not end with a hyphen or contain two consecutive hyphens. More infomation [here](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-name.html).
118+
119+
```yml
120+
functions:
121+
myCloudWatch:
122+
handler: myCloudWatch.handler
123+
events:
124+
- cloudwatchEvent:
125+
name: 'my-cloudwatch-event-name'
126+
event:
127+
source:
128+
- "aws.ec2"
129+
detail-type:
130+
- "EC2 Instance State-change Notification"
131+
detail:
132+
state:
133+
- pending
134+
```

docs/providers/aws/events/cloudwatch-log.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ layout: Doc
1414

1515
## Simple event definition
1616

17-
This will enable your Lambda function to be called by an Log Stream.
17+
This will enable your Lambda function to be called by a Log Stream.
1818

1919
```yml
2020
functions:

docs/providers/aws/examples/hello-world/README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ Pick your language of choice:
1717

1818
* [JavaScript](./node)
1919
* [Python](./python)
20-
* [csharp](./csharp)
20+
* [C#](./csharp)
21+
* [F#](./fsharp)
22+
* [Go](./go)
2123

2224
[View all examples](https://www.serverless.com/framework/docs/providers/aws/examples/)

0 commit comments

Comments
 (0)