AWS Fundamentals Logo
AWS Fundamentals
AWS::EC2::VPC

EC2 VPC

Specifies a virtual private cloud (VPC). To add an IPv6 CIDR block to the VPC, see [AWS::EC2::VPCCidrBlock](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-ec2-vpccidrblock.html). For more information, see [Virtual private clouds (VPC)](https://docs.aws.amazon.com/vpc/latest/userguide/configure-your-vpc.html) in the *Amazon VPC User Guide*.

Properties

7 configurable properties. Click a row to see details.

Filter:
PropertyTypeFlags
CidrBlock
string
Create-only
EnableDnsHostnames
boolean
EnableDnsSupport
boolean
InstanceTenancy
string
Ipv4IpamPoolId
string
Create-onlyWrite-only
Ipv4NetmaskLength
integer
Create-onlyWrite-only
Tags
Array<Tag>

Return Values

Values returned after the resource is created. Access these with Fn::GetAtt.

AttributeTypeDescription
CidrBlockAssociationsArray<string>-
DefaultNetworkAclstring-
DefaultSecurityGroupstring-
Ipv6CidrBlocksArray<string>-
VpcIdstring-

Sample CloudFormation Template

A minimal template with required properties and common optional ones.

template.yaml
AWSTemplateFormatVersion: "2010-09-09"
Description: Sample template for AWS::EC2::VPC

Resources:
  MyResource:
    Type: AWS::EC2::VPC
    Properties:
      Tags:
        - Key: Environment
          Value: Production

Required IAM Permissions

Permissions CloudFormation needs in your IAM role to manage this resource.

read

ec2:DescribeVpcsec2:DescribeSecurityGroupsec2:DescribeNetworkAclsec2:DescribeVpcAttribute

create

ec2:CreateVpcec2:DescribeVpcsec2:DescribeVpcAttributeec2:ModifyVpcAttributeec2:CreateTags

update

ec2:CreateTagsec2:ModifyVpcAttributeec2:DescribeVpcAttributeec2:DeleteTagsec2:ModifyVpcTenancy

list

ec2:DescribeVpcs

delete

ec2:DeleteVpcec2:DescribeVpcs

Get the EC2 Cheat Sheet

Everything you need to know about EC2 on one page. HD quality, print-friendly.

Download Free Infographic

Quick Facts

ServiceEC2
Properties12
Required0
TaggingSupported
Primary IDVpcId

Supported Operations

ReadCreateUpdateListDelete

Immutable After Creation

These properties cannot be changed after the resource is created. Updating them triggers a replacement.

CidrBlockIpv4IpamPoolIdIpv4NetmaskLength

External Links