Learn CLOUD-CUSTODIAN with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Simple Cloud Custodian Policy
# cloud_custodian/demo/stop_unused_ec2.yaml
policies:
- name: stop-unused-ec2
resource: aws.ec2
filters:
- State: running
- type: value
key: "tag:Environment"
value: absent
actions:
- stop
A simple Cloud Custodian policy to stop unused EC2 instances in AWS.