AWS CloudFormation
User Guide (API Version 2010-05-15)
« PreviousNext »
View the PDF for this guide.Go to the AWS Discussion Forum for this product.Go to the Kindle Store to download this guide in Kindle format.Did this page help you?  Yes | No |  Tell us about it...

AWS::EC2::VPC

Creates a Virtual Private Cloud (VPC) with the CIDR block that you specify.

Syntax

{
   "Type" : "AWS::EC2::VPC",
   "Properties" : {
      "CidrBlock" : String,
      "EnableDnsSupport" : Boolean,
      "EnableDnsHostnames" : Boolean,
      "InstanceTenancy" : String,
      "Tags" : [ Resource Tag, ... ]
   }
}     

Properties

CidrBlock

The CIDR block you want the VPC to cover. For example: "10.0.0.0/16".

Required: Yes

Type: String

Update requires: Replacement

EnableDnsSupport

Specifies whether DNS resolution is supported for the VPC. If this attribute is true, the Amazon DNS server resolves DNS hostnames for your instances to their corresponding IP addresses; otherwise, it does not. By default the value is set to true.

Required: No

Type: Boolean

Update requires: No interruption

EnableDnsHostnames

Specifies whether the instances launched in the VPC get DNS hostnames. If this attribute is true, instances in the VPC get DNS hostnames; otherwise, they do not. You can only set EnableDnsHostnames to true if you also set the EnableDnsSupport attribute to true. By default, the value is set to false.

Required: No

Type: Boolean

Update requires: No interruption

InstanceTenancy

The allowed tenancy of instances launched into the VPC.

  • "default": Instances can be launched with any tenancy.

  • "dedicated": Any instance launched into the VPC will automatically be dedicated, regardless of the tenancy option you specify when you launch the instance.

Required: No

Type: String

Valid values: "default" or "dedicated"

Update requires: Replacement

Tags

An arbitrary set of tags (key–value pairs) for this VPC.

Required: No

Type: AWS CloudFormation Resource Tags

Update requires: No interruption.

Return Values

Ref

When the logical ID of this resource is provided to the Ref intrinsic function, it returns the resource name.

For more information about using the Ref function, see Ref.

Example

{
   "AWSTemplateFormatVersion" : "2010-09-09",
   "Resources" : {
      "myVPC" : {
         "Type" : "AWS::EC2::VPC",
         "Properties" : {
            "CidrBlock" : "10.0.0.0/16",
    	    "EnableDnsSupport" : "false",
    	    "EnableDnsHostnames" : "false",
            "InstanceTenancy" : "dedicated",
            "Tags" : [ {"Key" : "foo", "Value" : "bar"} ]
         }
      }
   }
}     

See Also