-
Notifications
You must be signed in to change notification settings - Fork 0
/
template-for-start-api.yaml
95 lines (91 loc) · 2.75 KB
/
template-for-start-api.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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
AWS
Lambda Function Template for getting amount information using Zaim
Globals:
Function:
Timeout: 60
Resources:
LambdaForZaim:
Type: AWS::Serverless::Function
Properties:
CodeUri: lambdaForZaim.zip
Handler: lambdaForZaim.App::handleRequest
Runtime: java11
MemorySize: 256
Environment:
Variables:
CONSUMER_KEY: !Ref ConsumerKey
CONSUMER_SECRET: !Ref ConsumerSecret
ACCESS_TOKEN: !Ref AccessToken
ACCESS_TOKEN_SECRET: !Ref AccessTokenSecret
Events:
LambdaForZaim:
Type: Api
Properties:
Path: /api/moneyinfo
Method: GET
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- lambda:ListVersionsByFunction
Resource: '*'
ZaimToSlack:
Type: AWS::Serverless::Function
Properties:
CodeUri: zaimToSlack.zip
Handler: zaimtoslack.App::handleRequest
Runtime: java11
MemorySize: 256
Environment:
Variables:
SLACK_BOT_USER_ACCESS_TOKEN: !Ref SlackBotUserAccessToken
SLACK_CHANNEL_ID: !Ref SlackChannelId
Events:
ZaimToSlack:
Type: Api
Properties:
Path: /moneyinfo
Method: POST
Policies:
- Version: '2012-10-17'
Statement:
- Effect: Allow
Action:
- lambda:ListVersionsByFunction
Resource: '*'
Parameters:
ConsumerKey:
Type: String
ConsumerSecret:
Type: String
AccessToken:
Type: String
AccessTokenSecret:
Type: String
SlackBotUserAccessToken:
Type: String
SlackChannelId:
Type: String
Outputs:
LambdaForZaimApi:
Description: "API Gateway endpoint URL for Prod stage for getting amount information function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/api/moneyinfo"
LambdaForZaim:
Description: "Lambda Function for Zaim ARN"
Value: !GetAtt LambdaForZaim.Arn
LambdaForZaimIamRole:
Description: "Implicit IAM Role created for getting amount information function"
Value: !GetAtt LambdaForZaimRole.Arn
ZaimToSlackApi:
Description: "API Gateway endpoint URL for Prod stage for getting amount information function"
Value: !Sub "https://${ServerlessRestApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/moneyinfo"
ZaimToSlack:
Description: "Lambda Function for Zaim ARN"
Value: !GetAtt ZaimToSlack.Arn
ZaimToSlackIamRole:
Description: "Implicit IAM Role created for getting amount information function"
Value: !GetAtt ZaimToSlackRole.Arn