-
Notifications
You must be signed in to change notification settings - Fork 1
/
unusedebsvol.yml
40 lines (40 loc) · 1.25 KB
/
unusedebsvol.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
policies:
- name: ebs-garbage-collection-with-tags
resource: ebs
description: |
Cloud Custodian EBS Garbage Collection
comments: |
Delete unattached EBS volumes older than 1 day (24hrs) that
have the tag AutoCleanup set to true.
Volumes set to not delete on instance termination do have
valid use cases as data drives, but 99% of the time they
appear to be just garbage creation.
Use this policy at your discretion.
mode:
type: periodic
role: arn:aws:iam::1234567890:role/CloudCustodian
schedule: "rate(1 hour)"
filters:
- Attachments: []
- type: value
key: CreateTime
op: greater-than
value_type: age
value: 1
- "tag:AutoCleanup": "true"
actions:
- delete
- type: notify
template: ebs-garbage-collection.html
slack_template: slack-ebs-garbage-collection
template_format: 'html'
priority_header: '5'
subject: 'EBS Garbage Collection'
to:
- email@address.com
- slack://#slackchannel
owner_absent_contact:
- email@address.com
transport:
type: sqs
queue: https://sqs.us-east-1.amazonaws.com/1234567890/cloud-cloudcustodian