

# ec2-instances-in-vpc
<a name="ec2-instances-in-vpc"></a>

**Important**  
For this rule, the rule identifier (INSTANCES\_IN\_VPC) and rule name (ec2-instances-in-vpc) are different.

Checks if your EC2 instances belong to a virtual private cloud (VPC). Optionally, you can specify the VPC ID to associate with your instances.



**Identifier:** INSTANCES\_IN\_VPC

**Resource Types:** AWS::EC2::Instance

**Trigger type:** Configuration changes

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

**Parameters:**

vpcId (Optional)Type: String  
VPC ID that contains these EC2 instances.

## Amazon CloudFormation template
<a name="w2aac20c16c17b7d975c21"></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).