Skip to content

Commit 805cc85

Browse files
authored
chore: merge release/v1.10.0 into master
Merge pull request #843 from awslabs/release/v1.10.0
2 parents 7c621f2 + 8116967 commit 805cc85

File tree

234 files changed

+23157
-1851
lines changed

Some content is hidden

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

234 files changed

+23157
-1851
lines changed

.flake8

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[flake8]
22
max-line-length = 120
3-
ignore = E126
3+
ignore = E126 F821 W504 W605

DEVELOPMENT_GUIDE.rst

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -78,26 +78,26 @@ Profiling
7878

7979
Install snakeviz `pip install snakeviz`
8080

81-
```
82-
python -m cProfile -o sam_profile_results bin/sam-translate.py translate --input-file=tests/translator/input/alexa_skill.yaml --output-file=cfn-template.json
83-
snakeviz sam_profile_results
84-
```
81+
.. code-block:: shell
82+
83+
python -m cProfile -o sam_profile_results bin/sam-translate.py translate --input-file=tests/translator/input/alexa_skill.yaml --output-file=cfn-template.json
84+
snakeviz sam_profile_results
8585
8686
Verifying transforms
8787
--------------------
8888

8989
If you make changes to the transformer and want to verify the resulting CloudFormation template works as expected, you can transform your SAM template into a CloudFormation template using the following process:
9090

91-
```shell
92-
# Optional: You only need to run the package command in certain cases; e.g. when your CodeUri specifies a local path
93-
# Replace MY_TEMPLATE_PATH with the path to your template and MY_S3_BUCKET with an existing S3 bucket
94-
aws cloudformation package --template-file MY_TEMPLATE_PATH/template.yaml --output-template-file output-template.yaml --s3-bucket MY_S3_BUCKET
91+
.. code-block:: shell
92+
93+
# Optional: You only need to run the package command in certain cases; e.g. when your CodeUri specifies a local path
94+
# Replace MY_TEMPLATE_PATH with the path to your template and MY_S3_BUCKET with an existing S3 bucket
95+
aws cloudformation package --template-file MY_TEMPLATE_PATH/template.yaml --output-template-file output-template.yaml --s3-bucket MY_S3_BUCKET
9596
96-
# Transform your SAM template into a CloudFormation template
97-
# Replace "output-template.yaml" if you didn't run the package command above or specified a different path for --output-template-file
98-
bin/sam-translate.py --input-file=output-template.yaml
97+
# Transform your SAM template into a CloudFormation template
98+
# Replace "output-template.yaml" if you didn't run the package command above or specified a different path for --output-template-file
99+
bin/sam-translate.py --input-file=output-template.yaml
99100
100-
# Deploy your transformed CloudFormation template
101-
# Replace MY_STACK_NAME with a unique name each time you deploy
102-
aws cloudformation deploy --template-file cfn-template.json --capabilities CAPABILITY_NAMED_IAM --stack-name MY_STACK_NAME
103-
```
101+
# Deploy your transformed CloudFormation template
102+
# Replace MY_STACK_NAME with a unique name each time you deploy
103+
aws cloudformation deploy --template-file cfn-template.json --capabilities CAPABILITY_NAMED_IAM --stack-name MY_STACK_NAME

Makefile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ init:
3939
$(info [*] Install requirements...)
4040
@pip install -r requirements/dev.txt -r requirements/base.txt
4141

42+
flake:
43+
$(info [*] Running flake8...)
44+
@flake8 samtranslator
45+
4246
test:
4347
$(info [*] Run the unit test with minimum code coverage of $(CODE_COVERAGE)%...)
4448
@pytest --cov samtranslator --cov-report term-missing --cov-fail-under $(CODE_COVERAGE) tests
@@ -49,7 +53,7 @@ build-docs:
4953
@$(MAKE) -C docs/website html
5054

5155
# Command to run everytime you make changes to verify everything works
52-
dev: test
56+
dev: flake test
5357

5458
# Verifications to run before sending a pull request
5559
pr: init dev
@@ -68,4 +72,4 @@ TARGETS
6872
build-docs Generate the documentation.
6973
pr Perform all checks before submitting a Pull Request.
7074

71-
endef
75+
endef

docs/cloudformation_compatibility.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,9 @@ Variables All
168168
EndpointConfiguration All
169169
MethodSettings All
170170
BinaryMediaTypes All
171+
MinimumCompressionSize All
171172
Cors All
173+
TracingEnabled All
172174
================================== ======================== ========================
173175

174176

docs/globals.rst

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@ Example:
2323
Resources:
2424
HelloWorldFunction:
2525
Type: AWS::Serverless::Function
26-
Environment:
27-
Variables:
28-
MESSAGE: "Hello From SAM"
26+
Properties:
27+
Environment:
28+
Variables:
29+
MESSAGE: "Hello From SAM"
2930
3031
ThumbnailFunction:
3132
Type: AWS::Serverless::Function
@@ -53,7 +54,6 @@ Currently, the following resources and properties are being supported:
5354
# Properties of AWS::Serverless::Function
5455
Handler:
5556
Runtime:
56-
# Specifying CodeUri on Globals is not yet supported by 'CloudFormation package' https://docs.aws.amazon.com/cli/latest/reference/cloudformation/package.html
5757
CodeUri:
5858
DeadLetterQueue:
5959
Description:
@@ -67,7 +67,8 @@ Currently, the following resources and properties are being supported:
6767
Layers:
6868
AutoPublishAlias:
6969
DeploymentPreference:
70-
70+
PermissionsBoundary:
71+
7172
Api:
7273
# Properties of AWS::Serverless::Api
7374
# Also works with Implicit APIs
@@ -79,7 +80,11 @@ Currently, the following resources and properties are being supported:
7980
EndpointConfiguration:
8081
MethodSettings:
8182
BinaryMediaTypes:
83+
MinimumCompressionSize:
8284
Cors:
85+
AccessLogSetting:
86+
CanarySetting:
87+
TracingEnabled:
8388
8489
SimpleTable:
8590
# Properties of AWS::Serverless::SimpleTable

examples/2016-10-31/api_cognito_auth/template.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ Resources:
4040
RestApiId: !Ref MyApi
4141
Path: /
4242
Method: GET
43+
# NOTE: This endpoint is publicly accessible
4344
Auth:
4445
Authorizer: NONE
4546
ProxyAny:
@@ -48,6 +49,7 @@ Resources:
4849
RestApiId: !Ref MyApi
4950
Path: /{proxy+}
5051
Method: ANY
52+
# NOTE: This endpoint is publicly accessible
5153
Auth:
5254
Authorizer: NONE
5355
GetUsers:
@@ -56,6 +58,7 @@ Resources:
5658
RestApiId: !Ref MyApi
5759
Path: /users
5860
Method: GET
61+
# NOTE: This endpoint is publicly accessible
5962
Auth:
6063
Authorizer: NONE
6164
GetUser:
@@ -64,6 +67,7 @@ Resources:
6467
RestApiId: !Ref MyApi
6568
Path: /users/{userId}
6669
Method: GET
70+
# NOTE: This endpoint is publicly accessible
6771
Auth:
6872
Authorizer: NONE
6973
CreateUser:

examples/2016-10-31/api_lambda_request_auth/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The Authorizer Lambda Function in this example simply accepts an `auth` query st
66

77
## Running the example
88

9+
Optional: Uncomment the following lines in `template.yaml` to enable a publicly accessible endpoint:
10+
11+
```yaml
12+
# Auth:
13+
# Authorizer: NONE
14+
```
15+
916
Deploy the example into your account:
1017

1118
```bash
@@ -15,7 +22,7 @@ aws cloudformation package --template-file template.yaml --output-template-file
1522
aws cloudformation deploy --template-file ./template.packaged.yaml --stack-name sam-example-api-lambda-request-auth --capabilities CAPABILITY_IAM
1623
```
1724

18-
Invoke the API's root endpoint `/` without an `auth` query string to see the API respond with a 200. In the SAM template, we explicitly state `Authorizer: NONE` to make this a public/open endpoint (the Authorizer Lambda Function is not invoked).
25+
Invoke the API's root endpoint `/` without an `auth` query string to see the API respond with a 200 (assuming you followed the optional step above). In the SAM template, we explicitly state `Authorizer: NONE` to make this a public/open endpoint (the Authorizer Lambda Function is not invoked).
1926

2027
```bash
2128
api_url=$(aws cloudformation describe-stacks --stack-name sam-example-api-lambda-request-auth --query 'Stacks[].Outputs[?OutputKey==`ApiURL`].OutputValue' --output text)

examples/2016-10-31/api_lambda_request_auth/template.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,9 @@ Resources:
3838
RestApiId: !Ref MyApi
3939
Path: /
4040
Method: get
41-
Auth:
42-
Authorizer: NONE
41+
# NOTE: Uncomment the two lines below to make `GET /` publicly accessible
42+
# Auth:
43+
# Authorizer: NONE
4344
GetUsers:
4445
Type: Api
4546
Properties:

examples/2016-10-31/api_lambda_token_auth/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,13 @@ The Authorizer Lambda Function in this example simply accepts an `Authorization`
66

77
## Running the example
88

9+
Optional: Uncomment the following lines in `template.yaml` to enable a publicly accessible endpoint:
10+
11+
```yaml
12+
# Auth:
13+
# Authorizer: NONE
14+
```
15+
916
Deploy the example into your account:
1017

1118
```bash
@@ -15,7 +22,7 @@ aws cloudformation package --template-file template.yaml --output-template-file
1522
aws cloudformation deploy --template-file ./template.packaged.yaml --stack-name sam-example-api-lambda-token-auth --capabilities CAPABILITY_IAM
1623
```
1724

18-
Invoke the API's root endpoint `/` without an `Authorization` header to see the API respond with a 200. In the SAM template, we explicitly state `Authorizer: NONE` to make this a public/open endpoint (the Authorizer Lambda Function is not invoked).
25+
Invoke the API's root endpoint `/` without an `Authorization` header to see the API respond with a 200 (assuming you followed the optional step above). In the SAM template, we explicitly state `Authorizer: NONE` to make this a public/open endpoint (the Authorizer Lambda Function is not invoked).
1926

2027
```bash
2128
curl "$(aws cloudformation describe-stacks --stack-name sam-example-api-lambda-token-auth --query 'Stacks[].Outputs[?OutputKey==`ApiURL`].OutputValue' --output text)"

examples/2016-10-31/api_lambda_token_auth/template.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,9 @@ Resources:
3131
RestApiId: !Ref MyApi
3232
Path: /
3333
Method: get
34-
Auth:
35-
Authorizer: NONE
34+
# NOTE: Uncomment the two lines below to make `GET /` publicly accessible
35+
# Auth:
36+
# Authorizer: NONE
3637
GetUsers:
3738
Type: Api
3839
Properties:

0 commit comments

Comments
 (0)