Created
March 15, 2017 06:35
-
-
Save JohnTheodore/81ace05d2fa8918730015a6009c62c56 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
policies: | |
- name: ebs-mark-unattached-deletion-recent | |
resource: ebs | |
comments: | | |
Mark any unattached EBS volumes for deletion in 3 days | |
if the volume was created in the last 3 days. | |
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. | |
filters: | |
- Attachments: [] | |
- "tag:maid_status": absent | |
- type: value | |
value: 3 | |
key: Created | |
op: less-than | |
value_type: age | |
actions: | |
- type: notify | |
template: default.html | |
subject: "URGENT: Your AWS Resources will be shutdown." | |
to: | |
- resource-owner | |
- resource-group | |
transport: | |
type: sqs | |
queue: https://sqs.us-east-1.amazonaws.com/xxxxxxcloudcustodian-mailer | |
- type: mark-for-op | |
op: delete | |
days: 3 | |
- name: ebs-mark-unattached-deletion | |
resource: ebs | |
comments: | | |
Mark any unattached EBS volumes for deletion in 3 days. | |
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. | |
filters: | |
- Attachments: [] | |
- "tag:maid_status": absent | |
actions: | |
- type: notify | |
template: default.html | |
subject: "URGENT: Your AWS Resources will be shutdown." | |
to: | |
- resource-owner | |
- resource-group | |
transport: | |
type: sqs | |
queue: https://sqs.us-east-1.amazonaws.com/xxxxxxcloudcustodian-mailer | |
- type: mark-for-op | |
op: delete | |
days: 30 | |
- name: ebs-unmark-attached-deletion | |
resource: ebs | |
comments: | | |
Unmark any attached EBS volumes that were scheduled for deletion | |
if they are currently attached | |
filters: | |
- type: value | |
key: "Attachments[0].Device" | |
value: not-null | |
- "tag:maid_status": not-null | |
actions: | |
- unmark | |
- name: ebs-delete-marked | |
resource: ebs | |
comments: | | |
Delete any attached EBS volumes that were scheduled for deletion | |
filters: | |
- type: marked-for-op | |
op: delete | |
actions: | |
- type: notify | |
template: default.html | |
subject: "URGENT: Your AWS Resources will be shutdown." | |
to: | |
- resource-owner | |
- resource-group | |
transport: | |
type: sqs | |
queue: https://sqs.us-east-1.amazonaws.com/xxxxxxcloudcustodian-mailer | |
- delete |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment