Skip to content

Instantly share code, notes, and snippets.

@anandakumarpalanisamy
Last active May 20, 2017 17:41
Show Gist options
  • Save anandakumarpalanisamy/3e74c813df6fc8dc42c63079e6461523 to your computer and use it in GitHub Desktop.
Save anandakumarpalanisamy/3e74c813df6fc8dc42c63079e6461523 to your computer and use it in GitHub Desktop.

What is Amazon VPC ?

Amazon VPC enables you to launch Amazon Web Services resources into a virtual network that you have defined. This virtual network closely resembles a tranditional network that you'd operate in your own data center, with the benefits of using scalable infrastructure of AWS.

Topics

  • Amazon VPC Concepts
  • Using Amazon VPC with Other AWS Services
  • Accessing Amazon VPC
  • Amazon VPC Limits
  • PCI DSS Compliance

Amazon VPC Concepts

Amazon VPC is a network layer for Amazon EC2.

VPCs and Subnets

  • A Virtual Private Cloud (VPC) is a virtual network dedicated to your AWS account.
  • It is logically isolated from the other virtual networks in the AWS cloud.
  • You can launch your AWS resources such as Amazon EC2 instances, into your VPC.
  • You can select its IP address range, create subnets, and configure route tables, network gateways, and security settings.

Subnet

  • 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
  • To protect the AWS resources in each subnet, you can use multiple layers of security, including security groups and network access control lists (ACL).

Supported Platforms

  • Assign static private IPv4 addresses to your instances that persist across starts and stops.
  • Optionally associate an IPv6 CIDR block to your VPC and assign IPv6 addresses to your instances.
  • 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 & Non-Default VPCs

  • If your account supports the EC2-VPC only, then it comes with a default VPC that has a default subnet in each Availability Zone.
  • A default VPC has the benefits of the advanced features provided by a EC2-VPC, and is ready 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 as you need. This is known as a nondefault VPC.
  • Subnets that you have created in your nondefault VPCs and additional subnets that you create in your default VPC are called nondefault subnets.

Accessing the Internet

First method (Public)

  • 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 IPv4 address and public IPv4 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 Amazone EC2 network edge.

Second method (Private)

  • By default, each instance that you launch into a nondefault subnet has a private IPv4 address, but no public IPv4 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.

Third method (hybrid)

  • Alternatively, to allow an instance in your VPC to intiate outbound connections to the Internet but prevent unsolicited inbound connections from the Internet, you can use a Network Address Translation (NAT) device for IPv4 traffic.

  • NAT maps multiple private IPv4 addresses to a single public IPv4 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.

  • You can optionally associate an Amazon-provided IPv6 CDIR block with your VPC and assign IPv6 addresses to your instances. Instances can connect to the Internet over IPv6 through and Internet Gateway.

  • Alternatively, instances can initiate outbound connections to the Internet over IPv6 using an egress-only Internet Gateway.

  • IPv6 traffic is separate to IPv4 traffic, your route tables must include separate routes for IPv6 traffic.

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 to 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.

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 Command line interface, you the following options

    • AWS Command Line Interface (CLI)
    • AWS Tools for Windows Power Shell
  • Amazon VPC provides a Query API. These requests are HTTP and HTTPS requests that use the HTTP verbs GET or POST and a Query Parameter named Action.

  • 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 takes care of tasks such as crytographically signing your requests, retrying requests, and handling error responses, so that it is easier for you to get started.

Amazon VPC limits

  • There are a number of limits to the number of Amazon VPC components that you can provision. You can request an increase for some of these limits.

PCI DSS Compliance

  • Amazon VPC supports the processing, storage and transmission of credit card data by a merchant or service provider, and has been validated as being compliant with Payment Card Industry (PCI) Data Security Standard (DSS).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment