forked from ocelotconsulting/node-acme-lambda
-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
98 lines (92 loc) · 2.51 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
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
service: acme-certificate-runner
# Use serverless-webpack plugin to transpile ES6/ES7
plugins:
- serverless-webpack
# Enable auto-packing of external modules
custom:
webpackIncludeModules: true
provider:
name: aws
runtime: nodejs6.10
stage: prod
region: eu-west-1
memorySize: 1024
timeout: 10
versionFunctions: true
environment:
RENEW_BEFORE_EXPIRY: 45
S3_ACCOUNT_BUCKET: some-settings-bucket
S3_CERTIFICATE_BUCKET: some-bucket
S3_CERTIFICATE_FOLDER: ${self:provider.stage}/store
ACME_ACCOUNT_EMAIL: someone@email.org
USE_PRODUCTION: false
iamRoleStatements:
- Effect: Allow
Action:
- s3:ListBucket
Resource:
- arn:aws:s3:::${self:provider.environment.S3_CERTIFICATE_BUCKET}
- arn:aws:s3:::${self:provider.environment.S3_ACCOUNT_BUCKET}
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObject
- s3:DeleteObject
Resource:
- arn:aws:s3:::${self:provider.environment.S3_CERTIFICATE_BUCKET}/*
- arn:aws:s3:::${self:provider.environment.S3_ACCOUNT_BUCKET}/*
- Effect: Allow
Action:
- s3:GetBucketLocation
- s3:ListAllMyBuckets
Resource:
- "arn:aws:s3:::*"
- Effect: Allow
Action:
- iam:ListServerCertificates
- iam:UploadServerCertificate
- iam:UpdateServerCertificate
- iam:DeleteServerCertificate
Resource:
- "*"
- Effect: Allow
Action:
- acm:DescribeCertificate
- acm:ListCertificates
- acm:ImportCertificate
- acm:DeleteCertificate
Resource:
- "*"
- Effect: Allow
Action:
- route53:ListHostedZones
- route53:ListHostedZonesByName
- route53:ListResourceRecordSets
- route53:GetChange
- route53:GetHostedZone
- route53:GetHostedZoneCount
- route53:ChangeResourceRecordSets
Resource:
"*"
functions:
runner:
handler: runner.main
name: ${self:provider.stage}-Certificate-Orchestrator
description: Certificate Orchestrator ACMEv1
runtime: nodejs6.10
memorySize: 1024
timeout: 300
reservedConcurrency: 1
events:
- schedule:
rate: rate(2 hours)
name: Certificate Orchestrator ACMEv1
description: 'Attempt renewal of certificates every 2 hours'
pem:
handler: pem-creator.main
name: ${self:provider.stage}-pem-creator
description: Certificate Orchestrator ACMEv1 - Pem Addon
runtime: nodejs6.10
memorySize: 1024
timeout: 300
reservedConcurrency: 1