AWS-VPC
AWS-VPC
AWS-VPC
Provision a private,
isolated virtual network
on the AWS cloud.
Amazo
n Have complete control over
VPC
your virtual networking
environment.
VPCs and subnets
Intern Custom
et er
Networ
Interne k Virtual
t Private
Gatewa Gateway
y
R
Web VPC
NAT App
Server DB
Gatewa Server
Server
y
Web App DB
Server Server Server
Public Private VPN Only
Subnet Subnet Subnet
Virtual Private
Cloud
AWS Cloud
Security in your VPC
• Security
e e e e
groups Securit
y
Securit
y
Securit
y
Securit
y
Group Group Group Group
access 10.0.0.0/2
4
10.0.1.0/2
4
(ACLs) Routing
Table
Routing
Table
VPC
VPN Internet
Gateway Gateway
VPN connections
For most use cases, there are two primary patterns for organizing your
infrastructure:
Account
pattern Shared Services Development Test Production
AWS Account AWS AWS AWS
Account Account Account
Choosing A Pattern
10 . 0 . 0 . 0
0000101
00000000 00000000 00000000
0
10 . 0 . 255 . 255
0000101
0 00000000 11111111 11111111
IPs and
CIDR
10 . 0 . 0 . 0
/16
00001010 00000000 00000000
00000000
16
IPs and CIDR
10 . 0 . 0 . 0
10 . 0 . 0 .
Lowes 0000101 0 0000000
t 0 0
e 10 . 0 . 255 .
IP
Highest
possible IP 0000101 255
0
00000000 11111111
11111111
VPCs and IP Addresses
Example
Subnet Subnet
: 1 2
A VPC with CIDR 251 251
/22 includes 1,024
102
total IPs Subnet 4IPsSubnet
4
3
251
251
Note: In every
subnet, the first
four and last one
IP addresses are
reserved for AWS
use.
How to Use Subnets
Recommendation: Use
subnets to define Internet
accessibility.
Include asubnets
Public routing table entry Do not have a routing table
Private
to an Internet gateway to entry to an Internet gateway
subnets
support inbound/outbound and are not directly accessible
access to the public Internet. from the public Internet.
Typically use a "jump box"
(NAT/proxy/bastion host) to
support restricted, outbound-
only public Internet access.
Subnets
Recommendation: Start with one public and one private subnet per
Availability Zone.
10.0.0.0/2 (10.0.0.0-
1 10.0.7.255)
Recommendation: Start with one public and one private subnet per
Availability Zone.
10.0.0.0/2 (10.0.0.0-
1 10.0.7.255)
Which subnet type (public or private) should you use for these
resources ?
Publi Privat
c e
Datastore
instances
Batch processing
instances
Back-end
instances
Web application
instances
How do you control your VPC traffic?
Route tables
Security
groups
Network ACLs
Internet
gateways
Route Tables
Best practice:
Use custom route tables for each subnet to enable granular routing for
destinations.
Security Groups
Use security groups to control traffic into, out of, and between
resources.
ap ap App tier ap ap
p p security p p
group
dat dat
Data tier
a a
security
group
Private Private
subnet subnet
Availability Zone Availability Zone
A B
How Security Groups Are
Configured
Allow communication
between
instances in your VPC
10.0.0.0/1
and the Internet. 6
Interne
t
Are horizontally scaled, gatewa
redundant, and highly y
available by default.
Instance A
Provide a target in your VPC with public
IP
route tables for Internet- 10.0.10.0/24
Public
routable traffic. Subnet
Directing Traffic To Your VPC
Securit
y Port
forwarding
Subnets, Gateways, and Routes
Destination Target
10.0.0.0/20 local
Destination Target
0.0.0.0/0 IGW Interne 10.0.0.0/20 local
10.0.0.0/20 t
gatewa 0.0.0.0/0 NAT
y
securit
y
NAT Private
DynamoD group
Instance Instance
B
Private
Public IP 10.0.4.0/2
IP
10.0.0.0/24 3
Private
Destination Target Public Subnet subnet
Availability
10.0.0.0/20 local Zone 1
0.0.0.0/0 NAT
Private
Instance
Private
IP
10.0.2.0/23
security group
⚫ From the Your VPCs screen note the details for your
VPC – VPC ID, DHCP Options set, Main Route table,
Default Network ACL.
⚫ Also note the Subnets, Internet Gateways and Elastic
IPs that have been created for your VPC. Your should
clearly name your VPC resources.
AWS VPC
⚫ http://docs.aws.amazon.com/AmazonVPC/lates
t/Us
erGuide/VPC_Scenario2.html
⚫ How to securely manage AWS credentials
https://blogs.aws.amazon.com/security/post/
Tx3D6U6WSFG OK2H/A-New-and-Standardized-Way-
to-Manage- Credentials-in-the-AWS-SDKs
⚫ How to login securely to Linux AMI in VPC
Private subnet using ssh agent
forwarding
https://blogs.aws.amazon.com/security/post/
Tx3N8GFK85U N1G6/Securely-connect-to-Linux-
instances-running-in-a- private-Amazon-VPC