|
63 | 63 | },
|
64 | 64 | "StageName": "Prod"
|
65 | 65 | }
|
66 |
| - }, |
| 66 | + }, |
| 67 | + "MyApiWithNotCachedLambdaRequestAuthProdStage": { |
| 68 | + "Type": "AWS::ApiGateway::Stage", |
| 69 | + "Properties": { |
| 70 | + "DeploymentId": { |
| 71 | + "Ref": "MyApiWithNotCachedLambdaRequestAuthDeployment444f67cd7c" |
| 72 | + }, |
| 73 | + "RestApiId": { |
| 74 | + "Ref": "MyApiWithNotCachedLambdaRequestAuth" |
| 75 | + }, |
| 76 | + "StageName": "Prod" |
| 77 | + } |
| 78 | + }, |
67 | 79 | "MyApiWithLambdaTokenAuthMyLambdaTokenAuthAuthorizerPermission": {
|
68 | 80 | "Type": "AWS::Lambda::Permission",
|
69 | 81 | "Properties": {
|
|
205 | 217 | ]
|
206 | 218 | }
|
207 | 219 | }
|
208 |
| - }, |
| 220 | + }, |
| 221 | + "MyApiWithNotCachedLambdaRequestAuthMyLambdaRequestAuthAuthorizerPermission": { |
| 222 | + "Type": "AWS::Lambda::Permission", |
| 223 | + "Properties": { |
| 224 | + "Action": "lambda:InvokeFunction", |
| 225 | + "Principal": "apigateway.amazonaws.com", |
| 226 | + "FunctionName": { |
| 227 | + "Fn::GetAtt": [ |
| 228 | + "MyAuthFn", |
| 229 | + "Arn" |
| 230 | + ] |
| 231 | + }, |
| 232 | + "SourceArn": { |
| 233 | + "Fn::Sub": [ |
| 234 | + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/authorizers/*", |
| 235 | + { |
| 236 | + "__ApiId__": { |
| 237 | + "Ref": "MyApiWithNotCachedLambdaRequestAuth" |
| 238 | + } |
| 239 | + } |
| 240 | + ] |
| 241 | + } |
| 242 | + } |
| 243 | + }, |
209 | 244 | "MyFnLambdaTokenPermissionProd": {
|
210 | 245 | "Type": "AWS::Lambda::Permission",
|
211 | 246 | "Properties": {
|
|
236 | 271 | "Description": "RestApi deployment id: 6e52add211cda52ae10a7cc0e0afcf4afc682f9f",
|
237 | 272 | "StageName": "Stage"
|
238 | 273 | }
|
239 |
| - }, |
| 274 | + }, |
| 275 | + "MyApiWithNotCachedLambdaRequestAuthDeployment444f67cd7c": { |
| 276 | + "Type": "AWS::ApiGateway::Deployment", |
| 277 | + "Properties": { |
| 278 | + "RestApiId": { |
| 279 | + "Ref": "MyApiWithNotCachedLambdaRequestAuth" |
| 280 | + }, |
| 281 | + "Description": "RestApi deployment id: 444f67cd7c6475a698a0101480ba99b498325e90", |
| 282 | + "StageName": "Stage" |
| 283 | + } |
| 284 | + }, |
240 | 285 | "MyFnLambdaRequestPermissionProd": {
|
241 | 286 | "Type": "AWS::Lambda::Permission",
|
242 | 287 | "Properties": {
|
|
257 | 302 | ]
|
258 | 303 | }
|
259 | 304 | }
|
260 |
| - }, |
| 305 | + }, |
| 306 | + "MyFnLambdaNotCachedRequestPermissionProd": { |
| 307 | + "Type": "AWS::Lambda::Permission", |
| 308 | + "Properties": { |
| 309 | + "Action": "lambda:InvokeFunction", |
| 310 | + "Principal": "apigateway.amazonaws.com", |
| 311 | + "FunctionName": { |
| 312 | + "Ref": "MyFn" |
| 313 | + }, |
| 314 | + "SourceArn": { |
| 315 | + "Fn::Sub": [ |
| 316 | + "arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${__ApiId__}/${__Stage__}/GET/not-cached-lambda-request", |
| 317 | + { |
| 318 | + "__Stage__": "*", |
| 319 | + "__ApiId__": { |
| 320 | + "Ref": "MyApiWithNotCachedLambdaRequestAuth" |
| 321 | + } |
| 322 | + } |
| 323 | + ] |
| 324 | + } |
| 325 | + } |
| 326 | + }, |
261 | 327 | "MyApiWithLambdaTokenAuth": {
|
262 | 328 | "Type": "AWS::ApiGateway::RestApi",
|
263 | 329 | "Properties": {
|
|
468 | 534 | }
|
469 | 535 | }
|
470 | 536 | }
|
| 537 | + }, |
| 538 | + "MyApiWithNotCachedLambdaRequestAuth": { |
| 539 | + "Type": "AWS::ApiGateway::RestApi", |
| 540 | + "Properties": { |
| 541 | + "Body": { |
| 542 | + "info": { |
| 543 | + "version": "1.0", |
| 544 | + "title": { |
| 545 | + "Ref": "AWS::StackName" |
| 546 | + } |
| 547 | + }, |
| 548 | + "paths": { |
| 549 | + "/not-cached-lambda-request": { |
| 550 | + "get": { |
| 551 | + "x-amazon-apigateway-integration": { |
| 552 | + "httpMethod": "POST", |
| 553 | + "type": "aws_proxy", |
| 554 | + "uri": { |
| 555 | + "Fn::Sub": "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${MyFn.Arn}/invocations" |
| 556 | + } |
| 557 | + }, |
| 558 | + "security": [ |
| 559 | + { |
| 560 | + "MyLambdaRequestAuth": [] |
| 561 | + } |
| 562 | + ], |
| 563 | + "responses": {} |
| 564 | + } |
| 565 | + } |
| 566 | + }, |
| 567 | + "swagger": "2.0", |
| 568 | + "securityDefinitions": { |
| 569 | + "MyLambdaRequestAuth": { |
| 570 | + "in": "header", |
| 571 | + "type": "apiKey", |
| 572 | + "name": "Unused", |
| 573 | + "x-amazon-apigateway-authorizer": { |
| 574 | + "type": "request", |
| 575 | + "authorizerUri": { |
| 576 | + "Fn::Sub": [ |
| 577 | + "arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${__FunctionArn__}/invocations", |
| 578 | + { |
| 579 | + "__FunctionArn__": { |
| 580 | + "Fn::GetAtt": [ |
| 581 | + "MyAuthFn", |
| 582 | + "Arn" |
| 583 | + ] |
| 584 | + } |
| 585 | + } |
| 586 | + ] |
| 587 | + }, |
| 588 | + "authorizerResultTtlInSeconds": 0 |
| 589 | + }, |
| 590 | + "x-amazon-apigateway-authtype": "custom" |
| 591 | + } |
| 592 | + } |
| 593 | + } |
| 594 | + } |
471 | 595 | }
|
472 | 596 | }
|
473 | 597 | }
|
0 commit comments