This repository was archived by the owner on Nov 9, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroute.yaml
More file actions
99 lines (83 loc) · 2.33 KB
/
route.yaml
File metadata and controls
99 lines (83 loc) · 2.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
---
AWSTemplateFormatVersion: 2010-09-09
Description: 'git LFS: API route'
Parameters:
ApiId:
Description: ID of the API.
Type: String
#FunctionName:
# Description: Name of the Lambda function to call.
# Type: String
HttpMethod:
Description: HTTP request method.
Type: String
AllowedValues:
- DELETE
- GET
- HEAD
- OPTIONS
- PATCH
- POST
- PUT
LambdaArn:
Description: ARN of the Lambda function, function version or function alias to invoke.
Type: String
RouteKey:
Description: API Gateway route key, which may include variables.
Type: String
AllowedPattern: ^/.*$
Resources:
Integration:
Type: AWS::ApiGatewayV2::Integration
Properties:
ApiId:
Ref: ApiId
IntegrationMethod: POST
IntegrationType: AWS_PROXY
IntegrationUri:
Fn::Sub: arn:${AWS::Partition}:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${LambdaArn}/invocations
CredentialsArn:
Fn::GetAtt:
- IntegrationRole
- Arn
PayloadFormatVersion: '2.0'
IntegrationRole:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: 2012-10-17
Statement:
-
Principal:
Service:
- apigateway.amazonaws.com
Action:
- sts:AssumeRole
Effect: Allow
Policies:
-
PolicyName: lambda
PolicyDocument:
Version: 2012-10-17
Statement:
-
Sid: Function
Action:
- lambda:InvokeFunction
Resource:
-
Ref: LambdaArn
Effect: Allow
Route:
Type: AWS::ApiGatewayV2::Route
Properties:
ApiId:
Ref: ApiId
AuthorizationType: NONE
#AuthorizationScopes:
# - foo
# - bar
RouteKey:
Fn::Sub: ${HttpMethod} ${RouteKey}
Target:
Fn::Sub: integrations/${Integration}