diff --git a/examples/2016-10-31/api_cognito_auth/template.yaml b/examples/2016-10-31/api_cognito_auth/template.yaml index 6c701f33e5..60e4badd12 100644 --- a/examples/2016-10-31/api_cognito_auth/template.yaml +++ b/examples/2016-10-31/api_cognito_auth/template.yaml @@ -40,6 +40,7 @@ Resources: RestApiId: !Ref MyApi Path: / Method: GET + # NOTE: This endpoint is publicly accessible Auth: Authorizer: NONE ProxyAny: @@ -48,6 +49,7 @@ Resources: RestApiId: !Ref MyApi Path: /{proxy+} Method: ANY + # NOTE: This endpoint is publicly accessible Auth: Authorizer: NONE GetUsers: @@ -56,6 +58,7 @@ Resources: RestApiId: !Ref MyApi Path: /users Method: GET + # NOTE: This endpoint is publicly accessible Auth: Authorizer: NONE GetUser: @@ -64,6 +67,7 @@ Resources: RestApiId: !Ref MyApi Path: /users/{userId} Method: GET + # NOTE: This endpoint is publicly accessible Auth: Authorizer: NONE CreateUser: diff --git a/examples/2016-10-31/api_lambda_request_auth/README.md b/examples/2016-10-31/api_lambda_request_auth/README.md index 61b36b5ce1..841dee57c0 100644 --- a/examples/2016-10-31/api_lambda_request_auth/README.md +++ b/examples/2016-10-31/api_lambda_request_auth/README.md @@ -6,6 +6,13 @@ The Authorizer Lambda Function in this example simply accepts an `auth` query st ## Running the example +Optional: Uncomment the following lines in `template.yaml` to enable a publicly accessible endpoint: + +```yaml +# Auth: +# Authorizer: NONE +``` + Deploy the example into your account: ```bash @@ -15,7 +22,7 @@ aws cloudformation package --template-file template.yaml --output-template-file aws cloudformation deploy --template-file ./template.packaged.yaml --stack-name sam-example-api-lambda-request-auth --capabilities CAPABILITY_IAM ``` -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). +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). ```bash api_url=$(aws cloudformation describe-stacks --stack-name sam-example-api-lambda-request-auth --query 'Stacks[].Outputs[?OutputKey==`ApiURL`].OutputValue' --output text) diff --git a/examples/2016-10-31/api_lambda_request_auth/template.yaml b/examples/2016-10-31/api_lambda_request_auth/template.yaml index 0bf1da16a0..22c876fe5a 100644 --- a/examples/2016-10-31/api_lambda_request_auth/template.yaml +++ b/examples/2016-10-31/api_lambda_request_auth/template.yaml @@ -38,8 +38,9 @@ Resources: RestApiId: !Ref MyApi Path: / Method: get - Auth: - Authorizer: NONE + # NOTE: Uncomment the two lines below to make `GET /` publicly accessible + # Auth: + # Authorizer: NONE GetUsers: Type: Api Properties: diff --git a/examples/2016-10-31/api_lambda_token_auth/README.md b/examples/2016-10-31/api_lambda_token_auth/README.md index c693a2a6b5..02504b6e9c 100644 --- a/examples/2016-10-31/api_lambda_token_auth/README.md +++ b/examples/2016-10-31/api_lambda_token_auth/README.md @@ -6,6 +6,13 @@ The Authorizer Lambda Function in this example simply accepts an `Authorization` ## Running the example +Optional: Uncomment the following lines in `template.yaml` to enable a publicly accessible endpoint: + +```yaml +# Auth: +# Authorizer: NONE +``` + Deploy the example into your account: ```bash @@ -15,7 +22,7 @@ aws cloudformation package --template-file template.yaml --output-template-file aws cloudformation deploy --template-file ./template.packaged.yaml --stack-name sam-example-api-lambda-token-auth --capabilities CAPABILITY_IAM ``` -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). +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). ```bash curl "$(aws cloudformation describe-stacks --stack-name sam-example-api-lambda-token-auth --query 'Stacks[].Outputs[?OutputKey==`ApiURL`].OutputValue' --output text)" diff --git a/examples/2016-10-31/api_lambda_token_auth/template.yaml b/examples/2016-10-31/api_lambda_token_auth/template.yaml index 50d18a3195..17521113ad 100644 --- a/examples/2016-10-31/api_lambda_token_auth/template.yaml +++ b/examples/2016-10-31/api_lambda_token_auth/template.yaml @@ -31,8 +31,9 @@ Resources: RestApiId: !Ref MyApi Path: / Method: get - Auth: - Authorizer: NONE + # NOTE: Uncomment the two lines below to make `GET /` publicly accessible + # Auth: + # Authorizer: NONE GetUsers: Type: Api Properties: