Skip to main content

Top 13 Amazon Virtual Private Cloud (VPC) Best Practices

Amazon VPC brings a host of advantages to the table, including static private IP addresses, Elastic Network Interfaces, secure bastion host setup, DHCP options, Advanced Network Access Control, predictable internal IP ranges, VPN connectivity, movement of internal IPs and NICs between instances, heightened security, and more.

Read on to learn more about some key implementation-related best practices for developers and companies that utilize Amazon VPC. Whether you’re currently maintaining an existing VPC implementation or you’re planning to migrate to the AWS ecosystem, this guide can help you identify thirteen best practices. Here they are:

1. Choosing the Proper VPC Configuration for Your Organization’s Needs

First, you’ll need to select the right architecture for your Amazon VPC implementation.  You’ll want to keep in mind the specific requirements you currently have and those you predict you will need in the future.

It is advisable to design your Amazon VPC implementation based on your expansion requirements looking ahead at least two years.

Today, there are various Amazon VPC setup types available, including:

  1. Public and Private VPC
  2. Public-Facing VPC
  3. Amazon VPC – Private Subnets and Hardware VPN Access
  4. Amazon VPC – Public and Private Subnets and Hardware VPN Access
  5. Software-based VPN access – and so on

You can select whichever configuration best suits your current and future requirements.

2. Choosing a CIDR Block for Your VPC Implementation

When designing your Amazon VPC instance, you must consider the number of IP addresses required and the connectivity type with the data center before choosing the CIDR block. The permissible size of the block ranges between /16 netmask and a /28 netmask.

As of now, you cannot alter or modify Amazon VPC, so it is better to pick the CIDR block that has more IP addresses. While designing your Amazon VPC architecture to communicate with the on-premise data center, it is required that the CIDR range used in Amazon VPC does not overlap or cause a conflict with the CIDR block in the on-premise data center.

3. Isolating Your VPC Environments

Physical isolation which is present in the on-premise environment should also be a part of the cloud environment. It’s always better to create a distinct Amazon VPC for development, production, and staging – or one Amazon VPC with Separate Security/Subnets/isolated NW groups for staging, production and development.

4. Securing Your Amazon VPC Implementation 

Running a machine with mission-critical workloads requires multiple layers of security. Amazon VPC can be secured like your on-premise data center by following some of these useful tips:

  • Amazon Web Services Marketplace offers you a web application firewall, a firewall virtual appliance, and a few other tools which you can use to secure your Amazon VPC.
  • To secure your protocols from unauthorized use or intrusion you can configure intrusion detection systems and intrusion prevention virtual appliances.
  • With the help of Configure Privileged Identity access management, you can audit and monitor Administrator access to your VPC.
  • For transferring information securely between Amazon VPC among diverse regions or Amazon VPC to an on-premise data center, you can easily configure a Site to Site VPN.

For more information about AWS security, be sure to check out Cloud Academy’s Security Fundamentals for AWS course.

5. Creating Your Disaster Recovery Plan

Developing a disaster recovery plan with respect to your VPC implementation is of critical importance. Here are few simple rules to follow:

You need to ensure that you do not have any conflicts with your on-premises subnet CIDR block in the event where both need to be integrated into the on-premise data center as well.

After creating these CIDR blocks, instantiate a VPC which will tunnel between regions and to your on-premise data center. It may help to replicate the data with the aid of private IPs.

For more disaster recovery best practices, check out this hands-on CloudFormation lab from Cloud Academy.

6. Traffic Control and Security

To bolster your implementation’s security posture, you should take advantage of software like Sophos or Squid to limit URLs, domains, ports, etc. which would then allow all traffic to pass through the controlled proxy tier and would also get logged.
Using these proxy and security systems, you could also limit threatening and unwanted ports.
Click here to walk step-by-step through the process of securing your VPC infrastructure.  

7. Keep your Data Close

If cost is more critical for your needs as opposed to high availability, it could be a good idea to keep the Web and App within the same availability zone as RDS, ElastiCache, and so on of the Amazon VPC. You can develop and design the subnets accordingly. However, it is not a recommended architecture for applications which demand high availability.

8. VPC Peering

With the introduction of VPC peering features, life has become easier for AWS users. With the help VPC peering connectivity, you can connect two Amazon VPCs and which would then enable you to route traffic between them with the aid of private IP addresses.

As AWS uses the current infrastructure of a VPC for creating a VPC peering connection; it is neither a VPN connection nor a gateway, and does not depend on any physical hardware.

VPC Peering can be useful in various scenarios such as:

  1. Big corporations typically have multiple Amazon VPCs which are running in a single region with interconnected applications requiring private and secure access inside AWS.
  2. Some large organizations have different AWS accounts for various business departments or units or teams, where at times the systems which have been deployed in different AWS accounts by some business units are required to be shared or consumed privately.
  3. To achieve integrated access of systems, the customer can peer their VPC with their core suppliers.

9. EIP – Just In Case

It is always advisable to keep a part of your application services in the public subnet for external communication. It is also a recommended exercise to associate them with Amazon EIP (Elastic IP) and whitelisting these IP addresses in the target services which are used by them.

10. NAT Instances

In specific cases, there might be hundreds of EC2 instances within the Amazon VPC which are creating lots of heavy web service or HTTP calls simultaneously. At times, even a single NAT instance with the largest EC2 size may not be able to handle that bandwidth and may cause performance issues.

During such events, it is advisable to span the EC2 across multiple subnets and create NATs for each the subnets. With the help of this strategy, you can spread the outgoing bandwidth while improving the performance of VPC-based deployments.

11. Determining the NAT Instance Type

Every time EC2 instances residing within the private subnet of your Amazon VPC implementation are created or make HTTP/SQS/S3 calls, they go through a NAT instance.

You should scale the NAT instance capacity per your application needs in order to avoid performance bottlenecks. With the help of NAT instances, you can save on the cost of an Elastic IP, which also provides an extra level of security without revealing the instances to the outer world for accessing the internet.

12. IAM for Your Amazon VPC Infrastructure

When planning who will maintain your Amazon VPC, you can enlist the help of Amazon IAM to help you create accounts with granular levels of permissions. Also, you can use Sophisticated Privileged Identity Management solutions which are available on the AWS Marketplace to IAM your VPC.

13. ELB on Amazon VPC

While using ELB for web applications, ensure that you place all other EC2 instances in private subnets wherever possible. Except where there is an explicit requirement for instances requiring outside world access and Elastic IP attached, place all the instances in private subnets only. In the Amazon VPC environment, only ELBs must be in the public subnet as secure practice.

Summary

We’ve covered a lot of ground in this best practices guide for AWS VPC implementations.

Be sure to also check out Cloud Academy’s AWS Solutions Architect Associate learning path. You’ll learn everything there is to know about developing scalable and sustainable AWS architectures, as well as gain a solid mastery of the knowledge and skills necessary to pass the exam and acquire your certification.

As always, please leave a comment below if you have any questions – we’ll be happy to help!

Avatar

Written by

Sudhi Seshachala

Sudhi is part of Cloud Technology Partners & is a trusted advisor and strategic consultant to many C level executives and IT Directors. He brings 18+ years diverse experience covering software, IT operations, cloud technologies, and management. Have led several global teams in HP, Sun/Oracle, SeeBeyond and few startups to deliver scalable and highly available business/technology products and solutions. He has expertise in systems management, monitoring and integrated SaaS and on-premise applications addressing a wide range of business problems.

Related Posts

Avatar
Stuart Scott
— July 18, 2019

AWS Fundamentals: Understanding Compute, Storage, Database, Networking & Security

If you are just starting out on your journey toward mastering AWS cloud computing, then your first stop should be to understand the AWS fundamentals. This will enable you to get a solid foundation to then expand your knowledge across the entire AWS service catalog.   It can be both d...

Read more
  • AWS
  • Compute
  • Database
  • fundamentals
  • networking
  • Security
  • Storage
Avatar
Adam Hawkins
— July 17, 2019

How to Become a DevOps Engineer

The DevOps Handbook introduces DevOps as a framework for improving the process for converting a business hypothesis into a technology-enabled service that delivers value to the customer. This process is called the value stream. Accelerate finds that applying DevOps principles of flow, f...

Read more
  • AWS
  • AWS Certifications
  • DevOps
  • DevOps Foundation Certification
  • Engineer
  • Kubernetes
Avatar
Stuart Scott
— July 2, 2019

AWS Machine Learning Services

The speed at which machine learning (ML) is evolving within the cloud industry is exponentially growing, and public cloud providers such as AWS are releasing more and more services and feature updates to run in parallel with the trend and demand of this technology within organizations t...

Read more
  • Amazon Machine Learning
  • AWS
  • AWS re:Invent
  • Machine Learning
Avatar
Stuart Scott
— June 27, 2019

AWS Control Tower & VPC Traffic Mirroring

AWS re:Inforce 2019 is a two-day conference for security, identity, and compliance learning and community building. This year's keynote, presented by AWS Vice President and CIO, Stephen Schmidt, announced the general availability of AWS Control Tower and the new VPC Traffic Mirroring fe...

Read more
  • AWS
  • re:Inforce 2019
  • traffic mirroring
  • VPC
Avatar
Stuart Scott
— June 20, 2019

Working with AWS Networking & Amazon VPC

Being able to architect your own isolated segment of AWS is a simple process using VPCs; understanding how to architect its related networking components and connectivity architecture is key to making it a powerful service. Many services within Amazon Web Services (AWS) require you t...

Read more
  • AWS
  • VPC
Avatar
Stuart Scott
— June 19, 2019

AWS Compute Fundamentals Update

AWS is renowned for the rate at which it reinvents, revolutionizes, and meets customer demands and expectations through its continuous cycle of feature and service updates. With hundreds of updates a month, it can be difficult to stay on top of all the changes made available.   Here ...

Read more
  • AWS
Jeff Hyatt
Jeff Hyatt
— June 18, 2019

10 Steps for an Effective Reserved Instances Strategy

Amazon Web Services (AWS) offers three different ways to pay for EC2 Instances: On-Demand, Reserved Instances, and Spot Instances. This article will focus on effective strategies for purchasing Reserved Instances. While most of the major cloud platforms offer pre-pay and reservation dis...

Read more
  • AWS
  • EC2
Joe Nemer
Joe Nemer
— June 18, 2019

AWS Certification Practice Exam: What to Expect from Test Questions

If you’re building applications on the AWS cloud or looking to get started in cloud computing, certification is a way to build deep knowledge in key services unique to the AWS platform. AWS currently offers 11 certifications that cover major cloud roles including Solutions Architect, De...

Read more
  • AWS
  • AWS Certifications
Avatar
John Chell
— June 13, 2019

AWS Certified Solutions Architect Associate: A Study Guide

The AWS Solutions Architect - Associate Certification (or Sol Arch Associate for short) offers some clear benefits: Increases marketability to employers Provides solid credentials in a growing industry (with projected growth of as much as 70 percent in five years) Market anal...

Read more
  • AWS
  • AWS Certifications
Chris Gambino and Joe Niemiec
Chris Gambino and Joe Niemiec
— June 11, 2019

Moving Data to S3 with Apache NiFi

Moving data to the cloud is one of the cornerstones of any cloud migration. Apache NiFi is an open source tool that enables you to easily move and process data using a graphical user interface (GUI).  In this blog post, we will examine a simple way to move data to the cloud using NiFi c...

Read more
  • AWS
  • S3
Avatar
Chandan Patra
— June 11, 2019

Amazon DynamoDB: 10 Things You Should Know

Amazon DynamoDB is a managed NoSQL service with strong consistency and predictable performance that shields users from the complexities of manual setup. Whether or not you've actually used a NoSQL data store yourself, it's probably a good idea to make sure you fully understand the key ...

Read more
  • AWS
  • DynamoDB
Avatar
Andrew Larkin
— June 6, 2019

The 11 AWS Certifications: Which is Right for You and Your Team?

As companies increasingly shift workloads to the public cloud, cloud computing has moved from a nice-to-have to a core competency in the enterprise. This shift requires a new set of skills to design, deploy, and manage applications in cloud computing. As the market leader and most ma...

Read more
  • AWS
  • AWS Certifications