Amazon Virtual Private Cloud
User Guide

Examples for VPC

This section has examples for creating and configuring a VPC.

Example Usage

Example: Create an IPv4 VPC and Subnets Using the AWS CLI

Use the AWS CLI to create a VPC with a public subnet and a private subnet.

Example: Create an IPv6 VPC and Subnets Using the AWS CLI

Use the AWS CLI to create a VPC with an associated IPv6 CIDR block and a public subnet and a private subnet, each with an associated IPv6 CIDR block.

Example: Sharing Public Subnets and Private Subnets Share private and public subnets with accounts.

Example: Services Using AWS PrivateLink and VPC Peering

Learn how to use a combination of VPC peering and AWS PrivateLink to extend access to private services to consumers.

You can also use a transit gateway to connect your VPCs.

Example Usage

Centralized router

You can configure your transit gateway as a centralized router that connects all of your VPCs, AWS Direct Connect, and AWS Site-to-Site VPN connections.

For more information about configuring your transit gateway as a centralized router, see Transit Gateway Example: Centralized Router in Amazon VPC Transit Gateways.

Isolated VPCs

You can configure your transit gateway as multiple isolated routers. This is similar to using multiple transit gateways, but provides more flexibility in cases where the routes and attachments might change.

For more information about configuring your transit gateway to isolate your VPCs, see Transit Gateway Example: Isolated VPCs in Amazon VPC Transit Gateways.

Isolated VPCs with Shared Services You can configure your transit gateway as multiple isolated routers that use a shared service This is similar to using multiple transit gateways, but provides more flexibility in cases where the routes and attachments might change.

For more information about configuring your transit gateway to isolate your VPCs, see Transit Gateway Example: Isolated VPCs with Shared Services in Amazon VPC Transit Gateways.