How to delete a elasticache subnet group with cloud custodian?

183 Views Asked by At

I want to use cloud custodian to cleanup some aws resources.( elasticache in this case) . However ; I got error when trying to delete elasticache subnet groups. According to custodian cache.subnet-group documentation, delete is not a valid action for cache.subnet-group. How do I perform delete in this case?

my policy file.

policies:
  - name: cleanup-elasticache-subnet-group
    resource: aws.cache-subnet-group
    filters:
        - type: value
          key: "CacheSubnetGroupName"
          op: contains
          value: foo
    actions:
        - type: delele  >>> !!! delete is not a valaid action type !!!

1

There are 1 best solutions below

0
On

Since Cloud Custodian doesn't natively provide the delete action today, your main options are:

  • Open a feature request for an aws.cache-subnet-group.delete action.
  • Use Cloud Custodian to report/notify on subnet groups you need to delete, but handle the actual deletion with external tools.

For what it's worth, you can review open feature requests here. I didn't see any for this action, but it's always good to check!