Create a VPC

Creating a VPC, Subnets, and VPC Resources Using the Console

Use the following procedure to create a VPC along with additional VPC resources you need to run your application, such as subnets, route tables, Internet gateways, and NAT gateways. For VPC configuration examples, refer to the VPC Examples.

  1. Open the Amazon VPC console here.

Create a VPC

  1. On the VPC dashboard, choose Create VPC.

  2. For Resources to create, choose VPC and more.

Create a VPC

  1. Keep the Name tag auto-generation option selected to create Name tags for VPC resources, or deselect it to provide your own Name tags for VPC resources.

  2. For the IPv4 CIDR block range, enter an IPv4 address range for your VPC. A VPC must have an IPv4 address range.

  3. (Optional) To support IPv6 traffic, select IPv6 CIDR block, an IPv6 range provided by Amazon.

  4. Choose a Tenancy option. This option determines whether the EC2 instances you launch into the VPC will run on hardware shared with other AWS accounts or on dedicated hardware for your use. If you select VPC Tenancy as Default, EC2 instances launched into this VPC will use the Tenancy attribute you specify when launching instances - See more details in the Amazon EC2 User Guide for Linux Instances. If you select VPC Tenancy as Dedicated, the instances will always run as Dedicated Instances on hardware dedicated to you. If you’re using AWS Outposts, your Outpost must have private connectivity; you must use the default Tenancy.

  5. For Number of Availability Zones (AZs), we recommend providing subnets in at least two Availability Zones for a production environment. To select AZs for your subnets, expand Customize AZs. Otherwise, let AWS choose for you.

Create a VPC

  1. To configure your subnets, select values for Number of public subnets and Number of private subnets. To select IP address ranges for your subnets, expand Customize subnets CIDR blocks. Otherwise, let AWS choose for you.

  2. (Optional) If resources in a private subnet need public internet access via IPv4, for NAT gateways, choose the number of AZs you want to create NAT gateways in. In a production environment, we recommend deploying a NAT gateway in each AZ with resources that need public internet access. Note that there are associated costs with NAT gateways. For more information, see Pricing.

  3. (Optional) If resources in a private subnet need public internet access via IPv6, for Egress-only Internet Gateway, select Yes.

  4. (Optional) If you need direct access to Amazon S3 from your VPC, select VPC endpoints, S3 Gateway. This creates a VPC endpoint for Amazon S3. For more information, see VPC Endpoint Services in the AWS PrivateLink User Guide.

  5. (Optional) For DNS options, both domain resolution options are enabled by default. If the defaults don’t meet your needs, you can disable these options.

  6. (Optional) To add a tag to your VPC, expand Additional tags, choose Add new tag, and enter a tag key and tag value.

  7. In the Preview pane, you can see the relationship diagram of the VPC resources you’ve configured. Solid lines represent relationships between resources. Dotted lines represent network traffic to NAT gateways, Internet gateways, and gateway endpoints. After creating the VPC, you can view your VPC resources in this format anytime using the Resource Map tab. For more information, see Viewing Resource Maps of Your VPC Resources.

  8. When you’ve completed configuring your VPC, choose Create VPC.

Create a VPC

Create a VPC

Changing Public IPv4 Address Attribute for Your Subnet

By default, non-default subnets have the Public IPv4 address attribute set to false, and default subnets have this attribute set to true. An exception is a non-default subnet created using the Amazon EC2 instance launch wizard - the wizard sets this attribute to true. You can change this attribute using the Amazon VPC interface.

To change the Public IPv4 address behavior for your subnet:

  1. Open the Amazon VPC console https://console.aws.amazon.com/vpc/.

  2. In the navigation pane, choose Subnets.

Create a VPC

  1. Select your subnet and choose Actions, Edit subnet settings.

Create a VPC

  1. The Auto-assign public IPv4 address checkbox, if selected, will require a Public IPv4 address for all instances launched into the selected subnet. Select or deselect the checkbox as needed, then choose Save.

Create a VPC