|
| 1 | +Resources: |
| 2 | + MyApiWithCognitoAuth: |
| 3 | + Type: "AWS::Serverless::Api" |
| 4 | + Properties: |
| 5 | + StageName: Prod |
| 6 | + OpenApiVersion: '3.0.1' |
| 7 | + Auth: |
| 8 | + DefaultAuthorizer: MyDefaultCognitoAuth |
| 9 | + Authorizers: |
| 10 | + MyDefaultCognitoAuth: |
| 11 | + UserPoolArn: arn:aws:1 |
| 12 | + AuthorizationScopes: |
| 13 | + - default.write |
| 14 | + - default.read |
| 15 | + MyCognitoAuthWithDefaultScopes: |
| 16 | + UserPoolArn: arn:aws:2 |
| 17 | + AuthorizationScopes: default.delete |
| 18 | + |
| 19 | + MyFn: |
| 20 | + Type: AWS::Serverless::Function |
| 21 | + Properties: |
| 22 | + CodeUri: s3://bucket/key |
| 23 | + Handler: index.handler |
| 24 | + Runtime: nodejs12.x |
| 25 | + Events: |
| 26 | + CognitoAuthorizerWithDefaultScopes: |
| 27 | + Type: Api |
| 28 | + Properties: |
| 29 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 30 | + Method: get |
| 31 | + Path: /cognitoauthorizerwithdefaultscopes |
| 32 | + Auth: |
| 33 | + Authorizer: MyCognitoAuthWithDefaultScopes |
| 34 | + CognitoDefaultScopesDefaultAuthorizer: |
| 35 | + Type: Api |
| 36 | + Properties: |
| 37 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 38 | + Method: get |
| 39 | + Path: /cognitodefaultscopesdefaultauthorizer |
| 40 | + CognitoWithAuthNone: |
| 41 | + Type: Api |
| 42 | + Properties: |
| 43 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 44 | + Method: get |
| 45 | + Path: /cognitowithauthnone |
| 46 | + Auth: |
| 47 | + Authorizer: NONE |
| 48 | + CognitoDefaultScopesWithOverwritten: |
| 49 | + Type: Api |
| 50 | + Properties: |
| 51 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 52 | + Method: get |
| 53 | + Path: /cognitodefaultscopesoverwritten |
| 54 | + Auth: |
| 55 | + Authorizer: MyDefaultCognitoAuth |
| 56 | + AuthorizationScopes: |
| 57 | + - overwritten.read |
| 58 | + - overwritten.write |
| 59 | + CognitoAuthorizerScopesOverwritten: |
| 60 | + Type: Api |
| 61 | + Properties: |
| 62 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 63 | + Method: get |
| 64 | + Path: /cognitoauthorizercopesoverwritten |
| 65 | + Auth: |
| 66 | + Authorizer: MyCognitoAuthWithDefaultScopes |
| 67 | + AuthorizationScopes: |
| 68 | + - overwritten.read |
| 69 | + - overwritten.write |
| 70 | + CognitoDefaultScopesNone: |
| 71 | + Type: Api |
| 72 | + Properties: |
| 73 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 74 | + Method: get |
| 75 | + Path: /cognitodefaultscopesnone |
| 76 | + Auth: |
| 77 | + Authorizer: MyDefaultCognitoAuth |
| 78 | + AuthorizationScopes: [] |
| 79 | + CognitoDefaultAuthDefaultScopesNone: |
| 80 | + Type: Api |
| 81 | + Properties: |
| 82 | + RestApiId: !Ref MyApiWithCognitoAuth |
| 83 | + Method: get |
| 84 | + Path: /cognitodefaultauthdefaultscopesnone |
| 85 | + Auth: |
| 86 | + Authorizer: MyCognitoAuthWithDefaultScopes |
| 87 | + AuthorizationScopes: [] |
0 commit comments