-
Notifications
You must be signed in to change notification settings - Fork 0
/
sam.yaml
131 lines (131 loc) · 3.79 KB
/
sam.yaml
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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Exported by architect/[email protected] on 2020-02-20T01:39:04.221Z
Resources:
Init:
Type: AWS::Serverless::Api
Properties:
StageName: staging
DefinitionBody:
openapi: 3.0.1
info:
title:
Ref: AWS::StackName
paths:
/:
get:
responses:
'200':
description: 200 response
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetIndex.Arn}/invocations
responses:
default:
statusCode: '200'
contentHandling: CONVERT_TO_TEXT
passthroughBehavior: when_no_match
httpMethod: POST
contentHandling: CONVERT_TO_TEXT
type: aws_proxy
/{proxy+}:
x-amazon-apigateway-any-method:
parameters:
- name: proxy
in: path
required: true
schema:
type: string
x-amazon-apigateway-integration:
uri:
Fn::Sub: arn:aws:apigateway:${AWS::Region}:lambda:path/2015-03-31/functions/${GetIndex.Arn}/invocations
responses:
default:
statusCode: '200'
passthroughBehavior: when_no_match
httpMethod: POST
cacheNamespace: xlr8r
cacheKeyParameters:
- method.request.path.proxy
contentHandling: CONVERT_TO_TEXT
type: aws_proxy
EndpointConfiguration: REGIONAL
BinaryMediaTypes:
- '*~1*'
MinimumCompressionSize: 0
GetIndex:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
CodeUri: s3://init-cfn-deployments-3f063/0ff21bf9e75bf9b8a4389bbf5bd537db
Runtime: nodejs12.x
MemorySize: 1152
Timeout: 5
Environment:
Variables:
ARC_ROLE:
Ref: Role
ARC_CLOUDFORMATION:
Ref: AWS::StackName
ARC_APP_NAME: init
ARC_HTTP: aws_proxy
NODE_ENV: staging
SESSION_TABLE_NAME: jwe
Role:
Fn::Sub:
- arn:aws:iam::${AWS::AccountId}:role/${roleName}
- roleName:
Ref: Role
Events:
GetIndexEvent:
Type: Api
Properties:
Path: /
Method: GET
RestApiId:
Ref: Init
InvokeProxyPermission:
Type: AWS::Lambda::Permission
Properties:
FunctionName:
Ref: GetIndex
Action: lambda:InvokeFunction
Principal: apigateway.amazonaws.com
SourceArn:
Fn::Sub:
- arn:aws:execute-api:${AWS::Region}:${AWS::AccountId}:${restApiId}/*/*
- restApiId:
Ref: Init
Role:
Type: AWS::IAM::Role
Properties:
AssumeRolePolicyDocument:
Version: '2012-10-17'
Statement:
- Effect: Allow
Principal:
Service: lambda.amazonaws.com
Action: sts:AssumeRole
Policies:
- PolicyName: ArcGlobalPolicy
PolicyDocument:
Statement:
- Effect: Allow
Action:
- logs:CreateLogGroup
- logs:CreateLogStream
- logs:PutLogEvents
- logs:DescribeLogStreams
Resource: arn:aws:logs:*:*:*
Outputs:
API:
Description: API Gateway
Value:
Fn::Sub:
- https://${restApiId}.execute-api.${AWS::Region}.amazonaws.com/staging
- restApiId:
Ref: Init
restApiId:
Description: HTTP restApiId
Value:
Ref: Init