-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
52 lines (47 loc) · 1.24 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
service: Route53Backup
custom:
s3BucketName: 'route53backup.ciug.internal' # the name must be globaly unique
backupInterval: 24 # backup interval in full hours
timeout: 120 # function timeout
provider:
name: aws
runtime: python3.7
logRetentionInDays: 7
tracing:
lambda: true
iamRoleStatements:
- Effect: Allow
Action:
- "route53:ListHostedZones"
- "route53:ListResourceRecordSets"
- "route53:ListHostedZonesByName"
Resource: "*"
- Effect: Allow
Action:
- "s3:PutObject"
Resource:
- "arn:aws:s3:::${self:custom.s3BucketName}/*"
iamManagedPolicies:
- arn:aws:iam::aws:policy/AWSXrayWriteOnlyAccess
package:
include:
- index.py
functions:
Route53Backup:
handler: index.handler
description: Route53Backup
memorySize: 128
timeout: ${self:custom.timeout}
environment:
s3BucketName: ${self:custom.s3BucketName}
AWS_XRAY_CONTEXT_MISSING: LOG_ERROR
AWS_XRAY_TRACING_NAME: Route53Backup
events:
- schedule: rate(${self:custom.backupInterval} hours)
resources:
Resources:
Route53Archive:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.s3BucketName}
AccessControl: 'Private'