Brian Gaber
03/18/2026, 3:17 PMpolicies:
- name: tag-ebs-volumes-on-ec2-launch
resource: ebs
description: |
Triggered when a new EBS Volume is created for a new EC2 Launch. Checks to see if
it's missing the CreatedBy and CreatedOn tag. If both missing then four tags get created.
mode:
type: cloudtrail
role: arn:aws:iam::{account_id}:role/cloud-custodian-role-assumed
events:
- source: ec2.amazonaws.com
event: RunInstances
ids: "responseElements.instancesSet.items[].blockDeviceMappings[].ebs.volumeId"
filters:
- and:
- tag:CreatedBy: absent
- tag:CreatedOn: absent
actions:
- type: copy-related-tag
resource: ec2
skip_missing: true
key: "Attachments[0].InstanceId"
tags:
- Name
- CreatedBy
- CreatedOn
- AccountId
- Regionajay.gautam
04/03/2026, 4:58 AM