Skip to content

Commit 67134bc

Browse files
committed
Add a note about usage of shared authorizers
1 parent a49d907 commit 67134bc

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,27 @@ stepFunctions:
317317
definition:
318318
```
319319

320+
### Share Authorizer
321+
322+
Auto-created Authorizer is convenient for conventional setup. However, when you need to define your custom Authorizer, or use COGNITO_USER_POOLS authorizer with shared API Gateway, it is painful because of AWS limitation. Sharing Authorizer is a better way to do.
323+
324+
```yml
325+
stepFunctions:
326+
stateMachines:
327+
createUser:
328+
...
329+
events:
330+
- http:
331+
path: /users
332+
...
333+
authorizer:
334+
# Provide both type and authorizerId
335+
type: COGNITO_USER_POOLS # TOKEN, CUSTOM or COGNITO_USER_POOLS, same as AWS Cloudformation documentation
336+
authorizerId:
337+
Ref: ApiGatewayAuthorizer # or hard-code Authorizer ID
338+
```
339+
340+
320341
#### Customizing request body mapping templates
321342

322343
The plugin generates default body mapping templates for `application/json` and `application/x-www-form-urlencoded` content types. If you'd like to add more content types or customize the default ones, you can do so by including them in `serverless.yml`:

0 commit comments

Comments
 (0)