-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtemplate.yaml
More file actions
72 lines (66 loc) · 1.75 KB
/
Copy pathtemplate.yaml
File metadata and controls
72 lines (66 loc) · 1.75 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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
hitoiru
Sample SAM Template for hitoiru
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Timeout: 3
MemorySize: 512
Parameters:
SlackApiToken:
Type: String
Description: Slack API Token
SlackChannel:
Type: String
Description: Slack Channel Name (start with "#")
BucketName:
Type: String
Description: S3 Bucket Name
AzureTenantID:
Type: String
AzureAppID:
Type: String
AzureAppSecret:
Type: String
AzureUserPrincipalName:
Type: String
Resources:
AlertFunction:
Type: AWS::Serverless::Function
Properties:
CodeUri: alert/
Handler: app.lambda_handler
Runtime: ruby3.4
Timeout: 10
Policies:
- S3FullAccessPolicy:
BucketName: !Ref BucketName
Architectures:
- x86_64
Environment:
Variables:
SLACK_API_TOKEN: !Ref SlackApiToken
SLACK_CHANNEL: !Ref SlackChannel
AZURE_TENANT_ID: !Ref AzureTenantID
AZURE_APP_ID: !Ref AzureAppID
AZURE_APP_SECRET: !Ref AzureAppSecret
AZURE_USER_PRINCIPAL_NAME: !Ref AzureUserPrincipalName
Events:
S3:
Type: S3
Properties:
Bucket: !Ref MailBucket
Events: s3:ObjectCreated:*
MailBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: !Ref BucketName
Outputs:
AlertFunction:
Description: "Available Alert Lambda Function ARN"
Value: !GetAtt AlertFunction.Arn
AlertFunctionIamRole:
Description: "Implicit IAM Role created for Available Alert function"
Value: !GetAtt AlertFunction.Arn