-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
63 lines (59 loc) · 1.57 KB
/
serverless.yml
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
---
service: certifier
provider:
name: aws
runtime: python3.8
stage: default
iamRoleStatements:
- Effect: 'Allow'
Action:
- 's3:GetObject'
Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- ${opt:certificates-bucket}
- '/*'
- Effect: 'Allow'
Action:
- 'acm:DeleteCertificate'
- 'acm:DescribeCertificate'
- 'acm:RemoveTagsFromCertificate'
- 'acm:AddTagsToCertificate'
Resource:
- Fn::Sub: 'arn:aws:acm:${AWS::Region}:${AWS::AccountId}:certificate/*'
- Effect: 'Allow'
Action:
- 'acm:RequestCertificate'
- 'acm:ListCertificates'
- 'acm:ListTagsForCertificate'
Resource:
- '*'
- Effect: 'Allow'
Action:
- 'ssm:GetParameter'
- 'ssm:PutParameter'
- 'ssm:DeleteParameter'
Resource:
- Fn::Sub: 'arn:aws:ssm:${AWS::Region}:${AWS::AccountId}:parameter/certifier/*'
functions:
manage-certificates:
handler: handlers.manage_certificates
timeout: 120
events:
- s3:
bucket: ${opt:certificates-bucket}
event: s3:ObjectCreated:*
existing: true
- s3:
bucket: ${opt:certificates-bucket}
event: s3:ObjectRemoved:*
existing: true
delete-certificates:
handler: handlers.delete_certificates
events:
- schedule: rate(${opt:schedule-rate, "1 day"})
transition-certificates:
handler: handlers.transition_certificates
events:
- schedule: rate(${opt:schedule-rate, "1 day"})