Skip to content

Instantly share code, notes, and snippets.

@OtherDevOpsGene
Created February 25, 2022 21:51
Show Gist options
  • Save OtherDevOpsGene/99b604fafb7e5a4c14d3e9b48b74d872 to your computer and use it in GitHub Desktop.
Save OtherDevOpsGene/99b604fafb7e5a4c14d3e9b48b74d872 to your computer and use it in GitHub Desktop.
Cloud Custodian read-only report policy that finds used images older than 60 days and unused images older than 14 days.
policies:
- name: old-images-report
resource: ami
comment: |
Report on all used images older than 60 days.
filters:
- type: unused
value: false
- type: image-age
days: 60
- name: ami-unused
resource: ami
comment: |
Report on all unused images older than 14 days.
filters:
- type: unused
value: true
- type: image-age
days: 14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment