-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
template.yaml
50 lines (49 loc) · 1.58 KB
/
template.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: 'AWS::Serverless-2016-10-31'
Description: 'Example of Multiple-Origin CORS using API Gateway and Lambda'
Resources:
ExampleRoot:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: '.'
Handler: 'routes/root.handler'
Runtime: 'nodejs8.10'
Events:
Get:
Type: 'Api'
Properties:
Path: '/'
Method: 'get'
ExampleTest:
Type: 'AWS::Serverless::Function'
Properties:
CodeUri: '.'
Handler: 'routes/test.handler'
Runtime: 'nodejs8.10'
Events:
Delete:
Type: 'Api'
Properties:
Path: '/test'
Method: 'delete'
Options:
Type: 'Api'
Properties:
Path: '/test'
Method: 'options'
Outputs:
ExampleApi:
Description: "API Gateway endpoint URL for Prod stage for API Gateway Multi-Origin CORS function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/"
ExampleRoot:
Description: "API Gateway Multi-Origin CORS Lambda Function (Root) ARN"
Value: !GetAtt ExampleRoot.Arn
ExampleRootIamRole:
Description: "Implicit IAM Role created for API Gateway Multi-Origin CORS function (Root)"
Value: !GetAtt ExampleRootRole.Arn
ExampleTest:
Description: "API Gateway Multi-Origin CORS Lambda Function (Test) ARN"
Value: !GetAtt ExampleTest.Arn
ExampleTestIamRole:
Description: "Implicit IAM Role created for API Gateway Multi-Origin CORS function (Test)"
Value: !GetAtt ExampleTestRole.Arn