What is Amazon VPC?
Amazon
Virtual Private Cloud (Amazon VPC) enables you to launch Amazon Web Services
(AWS) resources into a virtual network that you've defined. This virtual
network closely resembles a traditional network that you'd operate in your own
data center, with the benefits of using the scalable infrastructure of AWS.
Topics
- Amazon VPC Concepts
- How to Get Started with Amazon VPC
- Using Amazon VPC with Other AWS Services
- Accessing Amazon VPC
- Pricing for Amazon VPC
- Amazon VPC Limits
- PCI DSS Compliance
Amazon VPC Concepts
As
you get started with Amazon VPC, you should understand the key concepts of this
virtual network, and how it is similar to or different from your own networks.
This section provides a brief description of the key concepts for Amazon VPC.
Amazon
VPC is the networking layer for Amazon EC2. If you're new to Amazon EC2, seeWhat is Amazon EC2? in the Amazon EC2 User Guide for Linux Instances to get a brief overview.
VPCs and Subnets
A virtual
private cloud (VPC) is a virtual
network dedicated to your AWS account. It is logically isolated from other
virtual networks in the AWS cloud. You can launch your AWS resources, such as
Amazon EC2 instances, into your VPC. You can configure your VPC; you can select
its IP address range, create subnets, and configure route tables, network
gateways, and security settings.
A subnet is a range of IP addresses in your VPC. You
can launch AWS resources into a subnet that you select. Use a public subnet for
resources that must be connected to the Internet, and a private subnet for
resources that won't be connected to the Internet. For more information about
public and private subnets, see VPC and Subnet Basics.
To
protect the AWS resources in each subnet, you can use multiple layers of
security, including security groups and network access control lists (ACL). For
more information, seeSecurity in Your VPC.
Supported Platforms
The
original release of Amazon EC2 supported a single, flat network that's shared
with other customers called the EC2-Classic platform. Older AWS accounts still support this platform, and
can launch instances into either EC2-Classic or a VPC. Accounts created after
2013-12-04 support EC2-VPC only. For more information, see Detecting Your
Supported Platforms and Whether You Have a Default VPC.
By
launching your instances into a VPC instead of EC2-Classic, you gain the
ability to:
- Assign static private IP addresses to your instances that persist across starts and stops
- Assign multiple IP addresses to your instances
- Define network interfaces, and attach one or more network interfaces to your instances
- Change security group membership for your instances while they're running
- Control the outbound traffic from your instances (egress filtering) in addition to controlling the inbound traffic to them (ingress filtering)
- Add an additional layer of access control to your instances in the form of network access control lists (ACL)
- Run your instances on single-tenant hardware
Default and Nondefault VPCs
If
your account supports the EC2-VPC platform only, it comes with a default VPC that has adefault subnet in each Availability Zone. A default VPC has
the benefits of the advanced features provided by EC2-VPC, and is ready for you
to use. If you have a default VPC and don't specify a subnet when you launch an
instance, the instance is launched into your default VPC. You can launch
instances into your default VPC without needing to know anything about Amazon
VPC.
Regardless
of which platforms your account supports, you can create your own VPC, and
configure it as you need. This is known as a nondefault VPC. Subnets that you create in your nondefault
VPC and additional subnets that you create in your default VPC are callednondefault subnets.
Accessing the Internet
You
control how the instances that you launch into a VPC access resources outside
the VPC.
Your
default VPC includes an Internet gateway, and each default subnet is a public
subnet. Each instance that you launch into a default subnet has a private IP
address and a public IP address. These instances can communicate with the
Internet through the Internet gateway. An Internet gateway enables your
instances to connect to the Internet through the Amazon EC2 network edge.
By
default, each instance that you launch into a nondefault subnet has a private
IP address, but no public IP address, unless you specifically assign one at
launch, or you modify the subnet's public IP address attribute. These instances
can communicate with each other, but can't access the Internet.
You
can enable Internet access for an instance launched into a nondefault subnet by
attaching an Internet gateway to its VPC (if its VPC is not a default VPC) and
associating an Elastic IP address with the instance.
Alternatively,
to allow an instance in your VPC to initiate outbound connections to the
Internet but prevent unsolicited inbound connections from the Internet, you can
use a network address translation (NAT) device. NAT maps multiple private IP
addresses to a single public IP address. A NAT device has an Elastic IP address
and is connected to the Internet through an Internet gateway. You can connect
an instance in a private subnet to the Internet through the NAT device, which
routes traffic from the instance to the Internet gateway, and routes any responses
to the instance.
NAT
You can use a NAT device to
enable instances in a private subnet to connect to the Internet (for example,
for software updates) or other AWS services, but prevent the Internet from
initiating connections with the instances. A NAT device forwards traffic from
the instances in the private subnet to the Internet or other AWS services, and
then sends the response back to the instances. When traffic goes to the
Internet, the source IP address is replaced with the NAT device’s address and
similarly, when the response traffic goes to those instances, the NAT device
translates the address back to those instances’ private IP addresses.
Note
We use
the term NAT in this documentation to follow common
IT practice, though the actual role of a NAT device is both address translation
and port address translation (PAT).
AWS offers two kinds of NAT
devices — a NAT gateway or a NAT instance. We recommend
NAT gateways, as they provide better availability and bandwidth over NAT
instances. The NAT Gateway service is also a managed service that does not
require your administration efforts. A NAT instance is launched from a NAT AMI.
You can choose to use a NAT instance for special purposes.
Accessing a Corporate or Home Network
You
can optionally connect your VPC to your own corporate data center using an
IPsec hardware VPN connection, making the AWS cloud an extension of your data
center.
A
VPN connection consists of a virtual private gateway attached to your VPC and a
customer gateway located in your data center. A virtual private gateway is the
VPN concentrator on the Amazon side of the VPN connection. A customer gateway
is a physical device or software appliance on your side of the VPN connection.
How to Get Started with Amazon VPC
To
get a hands-on introduction to Amazon VPC, complete the exercise Getting Started with Amazon VPC. The exercise will guide you through the
steps to create a nondefault VPC with a public subnet, and to launch an
instance into your subnet.
If
you have a default VPC, and you want to get started launching instances into
your VPC without performing any additional configuration on your VPC, see Launching an EC2 Instance into Your Default
VPC.
To
learn about the basic scenarios for Amazon VPC, see VPC Wizard Scenarios for Amazon VPC. You can configure your VPC and subnets in
other ways to suit your needs.
The
following table lists related resources that you'll find useful as you work
with this service.
Resource
|
Description
|
A whitepaper that
provides an overview of the options for network connectivity.
|
|
A community-based
forum for discussing technical questions related to Amazon VPC.
|
|
A central starting
point to find documentation, code samples, release notes, and other
information to help you create innovative applications with AWS.
|
|
The home page for
AWS Support.
|
|
A central contact
point for inquiries concerning AWS billing, accounts, and events.
|
Using Amazon VPC with Other AWS Services
Amazon
VPC integrates with many other AWS services; furthermore, some services require
a VPC in your account to carry out certain functions. Below are examples of
services that use Amazon VPC.
Service
|
Relevant Topic
|
AWS Data Pipeline
|
|
Amazon EC2
|
|
Auto Scaling
|
|
Elastic Beanstalk
|
|
Elastic Load
Balancing
|
|
Amazon ElastiCache
|
|
Amazon EMR
|
|
AWS OpsWorks
|
|
Amazon RDS
|
|
Amazon Redshift
|
|
Amazon Route 53
|
|
Amazon WorkSpaces
|
To
get a detailed view of the VPCs, subnets, and other VPC resources in your
account and their relation to each other, you can use the AWS Config service.
For more information, seeWhat is AWS Config? in the AWS Config Developer Guide.
Accessing Amazon VPC
Amazon
VPC provides a web-based user interface, the Amazon VPC console. If you've
signed up for an AWS account, you can access the Amazon VPC console by signing
into the AWS Management Console and selecting VPC from the console home page.
If
you prefer to use a command line interface, you have the following options:
AWS Command Line Interface (CLI)
Provides commands for a broad set of AWS products, and is supported
on Windows, Mac, and Linux/UNIX. To get started, see AWS Command Line
Interface User Guide. For more information
about the commands for Amazon VPC, see ec2.
AWS Tools for Windows PowerShell
Provides commands for a broad set of AWS products for those who
script in the PowerShell environment. To get started, see AWS Tools for Windows
PowerShell User Guide.
Amazon
VPC provides a Query API. These requests are HTTP or HTTPS requests that use
the HTTP verbs GET or POST and a Query parameter named Action. For more information about the API actions
for Amazon VPC, see Actions in the Amazon EC2
API Reference.
If
you prefer to build applications using language-specific APIs instead of
submitting a request over HTTP or HTTPS, AWS provides libraries, sample code,
tutorials, and other resources for software developers. These libraries provide
basic functions that automatically take care of tasks such as cryptographically
signing your requests, retrying requests, and handling error responses, so that
it is easier for you to get started. For more information about downloading the
AWS SDKs, see AWS SDKs and Tools.
Pricing for Amazon VPC
There's
no additional charge for using Amazon VPC. You pay the standard rates for the
instances and other Amazon EC2 features that you use. If you choose to create a
hardware VPN connection, you pay for each hour that the VPN is connected to
your VPC. For more information, see Amazon VPC Pricing and Amazon EC2 Pricing.
Amazon VPC Limits
There
are limits to the number of Amazon VPC components that you can provision. You
can request an increase for some of these limits. For more information, see Amazon VPC Limits.
Source: Amazon Web Services