6. Creating an Internet-connected VPC: steps
Choosing an
address range
Setting up subnets
in Availability Zones
Creating a route to
the Internet
Authorizing traffic
to/from the VPC
14. VPC subnets and Availability Zones
172.31.0.0/16
Availability Zone Availability Zone Availability Zone
VPC subnet VPC subnet VPC subnet
172.31.0.0/24 172.31.1.0/24 172.31.2.0/24
eu-west-1a eu-west-1b eu-west-1c
15. VPC subnet considerations
• /16 VPC (64K IPv4 addresses)
• /24 subnets (251 IPv4 addresses)
• One subnet per Availability Zone
• first 4 IP addresses and the last IP address in each subnet CIDR
block are reserved , and cannot be assigned
• For example, in a subnet with CIDR block 10.0.0.0/24
• 10.0.0.0: Network address
• 10.0.0.1: Reserved by AWS for the VPC router.
• 10.0.0.2: Reserved by AWS as DNS server IP
• 10.0.0.3: Reserved by AWS for future use.
• 10.0.0.255: Network broadcast address(Not Supported)
17. Routing in your VPC
• Route tables contain rules for which
packets go where
• Your VPC has a default route table
• … but you can assign different route
tables to different subnets
18. Can instances with the CIDR- 10.0.0.0/24 reach to the instances
with the CIDR 10.0.1.0/24?
19. Can instances with the CIDR- 10.0.0.0/24 reach to the instances
with the CIDR 10.0.1.0/24?
With VPC, YES!
24. Network ACLs: Stateless firewalls
English translation: Allow all traffic in
Can be applied on a subnet basis
Rules are evaluated starting with the lowest numbered rule.
26. Security groups example: web servers
In English: Hosts in this group are reachable
from the Internet on port 80 (HTTP)
27. Security groups example: backends
In English: Only instances in the MyWebServers
Security Group can reach instances in this
Security Group
28. Security groups in VPC: additional notes
• Follow the Principle of Least Privilege
• VPC allows creation of egress as well as ingress
Security Group rules
• You can only define ALLOW rule not a DENY
30. Beyond Internet connectivity
Restricting
Internet access
Connecting to your
corporate network
Connecting
to other VPCs
Accessing Services
Through AWS PrivateLink
VPC Endpoints for
Amazon S3 &
DynamoDB
35. Example VPC peering use:
shared services VPC
You can create a VPC peering connection
between:
• your own VPCs
• with a VPC in another AWS account
• with a VPC in a different AWS Region
Common/core services
• Authentication/directory
• Monitoring
• Logging
• Remote administration
• Scanning
Can VPC B access VPC C via VPC A?
36. Security groups across peered VPCs
VPC Peering
172.31.0.0/16 10.55.0.0/16
Orange Security Group Blue Security Group
ALLOW
You can create inbound or outbound rules for your VPC
security groups to reference security groups in the
peered VPC
39. Establish a VPC peering: create route
172.31.0.0/16 10.55.0.0/16Step 1
Initiate peering request
Step 2
Accept peering request
Step 3
Create routes
In English: Traffic destined for the
peered VPC should go to the peering
43. VPN and AWS Direct Connect
• Both allow secure connections
between your network and your VPC
• VPN is a pair of IPSec tunnels over
the Internet
• DirectConnect is a dedicated line with
lower per-GB data transfer rates
• For highest availability: Use both
44. VPC Endpoints for DynamoDB
VPC Endpoints for Amazon S3
VPC Endpoint Services (AWS
PrivateLink)
45. S3, DynamoDB and your VPC
S3 Bucket
Your applications
Your data
DynamoDB
Table
49. IAM policy for VPC endpoints
S3 Bucket
IAM Policy at VPC Endpoint -
Endpoint Policy: Restrict actions
of VPC in S3
IAM Policy at S3 Bucket:
Make accessible from
VPC Endpoint only
51. AWS PrivateLink
• privately connect your VPC to supported
AWS services, services hosted by other AWS
accounts (VPC endpoint services)
• do not require an internet gateway, NAT
device, public IP address, AWS Direct
Connect connection, or VPN connection to
communicate with the service *(without using public
IPs, and without requiring the traffic to traverse across the Internet)
• Amazon Elastic Compute Cloud (EC2),
Elastic Load Balancing (ELB), Kinesis
Streams, EC2 Systems Manager …
• Even You can create your own application in
your VPC and configure it as an AWS
PrivateLink-powered service
52. VPC Endpoint Services (AWS PrivateLink)
Running Internal Web Services in a
private subnet
Using an interface endpoint to access
the services in subnet B.
Subnets should not overlap!
53. VPC and the rest of AWS
DNS in-VPC with
Amazon Route 53
Logging VPC Traffic
with VPC Flow Logs
54. VPC DNS options
Use Amazon DNS server
Have EC2 auto-assign DNS
hostnames to instances
55. Amazon Route 53 private hosted zones
Private Hosted
Zone
example.demohostedzone.org
172.31.0.99