

# ec2-volume-inuse-check
<a name="ec2-volume-inuse-check"></a>

Checks if EBS volumes are attached to EC2 instances. Optionally checks if EBS volumes are marked for deletion when an instance is terminated.

The rule is COMPLIANT if an EBS volume is attached to running or stopped EC2 instances.

The rule is NON\_COMPLIANT if an EBS volume is not attached to any EC2 instance or is attached to a terminated EC2 instance.



**Identifier:** EC2\_VOLUME\_INUSE\_CHECK

**Resource Types:** AWS::EC2::Volume

**Trigger type:** Configuration changes

**Amazon Web Services Region:** All supported Amazon regions

**Parameters:**

deleteOnTermination (Optional)Type: boolean  
EBS volumes are marked for deletion when an instance is terminated. Possible values: True or False (other input values are marked as NON\_COMPLIANT). If set to `True`, the rule is NON\_COMPLIANT if a terminated EBS volume is not marked for deletion.

## Amazon CloudFormation template
<a name="w2aac20c16c17b7d633c23"></a>

To create Amazon Config managed rules with Amazon CloudFormation templates, see [Creating Amazon Config Managed Rules With Amazon CloudFormation Templates](aws-config-managed-rules-cloudformation-templates.md).