TechWriterDev
  • Cloud
    • AWS
      • 00_Doubts
      • CloudPractitioner
        • Cloud Computing
        • AWS Global Infrastructure
        • Introduction to AWS EC2
        • Elastic load balancer(ELB)
        • 04_Messaging_Queuing
        • Aditional Computing Service
        • Accessing AWS resources
        • AWS Networking
        • Storage
        • Amazon Database Solutions
        • Monitoring Tools
        • AWS Security
        • Distributed Denial Of Service Attacks
      • DeveloperAssociate
        • References
        • AWS DVA-C02 Services Index
        • Services
          • 00_IAM
            • Identity and Access Management (IAM)
            • Account Protection Mechanisms
            • Access Mechanism of AWS Resources
            • Security Tools
            • Responsibility Model
            • Advanced Concepts
          • 01_EC2
            • Elastic Compute Cloud (EC2)
            • EC2 Volume Types
            • Amazon Machine Image (AMI)
            • AWS charges for IPv4 address
          • 02_SecurityGroups
            • Security Groups
          • 03_Elastic_LoadBalancing
            • Terminology
            • Elastic load balancer
            • Features
            • Basics
          • 04_AutoScaling
            • Auto Scaling
          • 05_RDS
            • Relational Database Service (RDS)
            • Aurora
            • Security
            • RDS Proxy
          • 06_ElastiCache
            • Cache
            • Cache Offerings
          • 07_Route53
            • Basics of DNS
            • Route 53
          • 08_VPC
            • Virtual Private Cloud (VPC)
          • 09_S3
            • Simple Storage Service (S3)
            • S3 Features
            • S3 Encryption
            • S3 Features
            • S3 Bucket Policy and IAM Policy
          • 10_ECS
            • Elastic Container Service (ECS)
            • Elastic Container Registry (ECR)
            • AWS Copilot
          • 11_EKS
            • Elastic Kubernetes Service (EKS)
          • 12_SDK_CLI_Tips
            • Access AWS Resources
          • 13_CloudFront
            • Cloud Front
          • 14_Messaging
            • Simple Queue Service (SQS)
            • Simple Notification Service (SNS)
            • Fan Out Pattern
            • Kinesis
            • Compare and Contrast
          • 15_ElasticBeanStalk
            • Elastic Beanstalk
          • 16_CloudFormation
            • CloudFormation
            • Dynamic References
          • 17_Monitoring
            • AWS Monitoring
            • AWS CloudWatch
            • CloudWatch Alarms
            • Synthetics Canary
            • Amazon EventBridge (formerly CloudWatch Events)
            • X-Ray
            • OpenTelemetry
            • CloudTrail
          • 18_Lambda
            • Lambda
            • Lambda Integrations
            • Configuring Lambda
            • Lambda Layers
          • 19_API_Gateway
            • API Gateway
            • API Gateway Integrations
          • 20_DynamoDB
            • DynamoDB
            • Operations
            • Indexes
            • DynamoDB Accelerator (DAX)
            • DynamoDB Streams
            • Transactions
            • Integrations
          • 21_CICD
            • CICD
            • CodeCommit
            • CodePipeline
            • CodeBuild
            • CodeDeploy
            • CodeArtifact
            • CloudGuru
          • 22_SAM
            • Serverless Application Model (SAM)
          • 23_CDK
            • Cloud Development Kit (CDK)
          • 24_StepFunctions
            • Step Functions
            • Types of step function
          • 25_AppSync
            • AppSync
          • 26_Amplify
            • Amplify
          • 27_STS
            • Security Token Service (STS)
          • 28_DirectoryService
            • Active Directory
          • 29_KMS
            • Encryption
            • KMS API
            • Features
            • Cloud Hardware Security Module (HSM)
          • 30_SSM_Store
            • SSM Parameter Store
          • 31_SecretsManager
            • Secrets Manager
          • 32_Cognito
            • Cognito
      • Questions
        • AWS_Region
        • EC2
        • IAM
  • Database
    • MongoDb
      • Mongo db Basics
      • Mongo DB Atlas
      • Document
      • Import-Export based on Data Format
      • Mongo Shell Commands
      • Query Operators
      • Indexes
      • Upsert
      • MongoDB Aggregation Framework
      • Aggregation Framework Operators
    • PostgreSQL
      • POSTGRE SQL DataTypes
      • About table
      • Constraints
  • Technologies
    • RabbitMQ
      • RabbitMQ Concepts
      • Introduction to Exchanges
      • Introduction to Queues
    • Terraform
      • 00_Introduction
      • Configuration blocks
      • Commands
      • Variables
      • Terraform Cloud
      • Modules
  • Languages
    • Java
      • Logging
        • Getting Started
      • 00_Core
        • 00_Basics
          • Java Vs C++
          • Object oriented principles
          • Steps to compile a java program
          • JVM Internals
          • Understanding Java Development Kit
          • What is JIT Compiler?
          • Java data types
          • 07_identifiers_type_conversion
          • 08_references_and_packages
          • Steps for attaching scanner
        • Concurrency
          • 00_Threads
            • Threads
          • 01_ExecutorFramework
            • Executor Framework
            • Asynchronous Computation
      • 01_Backend
        • 01_HttpAndWebServerBasics
          • HTTP
          • Content Type
          • Web Server
        • 02_J2EE_Basics
          • J2EE_Basics
          • Why HttpServlet classs is declared as abstract class BUT with 100 % concrete functionality ?
        • 03_TomCatAndSession
          • What is a Session?
          • WebContainer
        • 04_PageNavigation
          • Cookies Additional Information
          • Page Navigation Techniques
        • 05_AboutServlet
          • CGI v/s Servlet
          • Executor Framework
          • Servlet Life cycle
          • SERVLET CONFIG
          • Servlet Context
          • Servlet Listener (web application listener)
        • 08_SpringBoot
          • Spring Boot
          • Some common annotations used in spring eco system
        • 09_SpringDataJPA
          • Spring Data JPA
        • Java_Language_Changes
          • JDK enhancement tracking reference
        • 06_ORM_Hibernate
          • readmes
            • Hibernate
            • Advantages of Hibernate
            • Hibernate Caching
            • Hibernate API
            • Hibernate Query API
            • Hibernate Annotations and JPQL
            • Entity and Value Type
        • 07_SpringFramework
          • bean_validation
            • Bean Validation
          • core
            • readme
              • Spring
              • Spring Framework Modules
              • Spring MVC Request flow
              • Dependency Injection
              • Spring Beans
              • 06_Spring_Framework_Annotations
      • 03_Tools
        • Maven
          • Maven
  • SoftwareEngineering
    • DesignPatterns
      • Notes
        • Basics
        • OOP
        • SOLID Principles
        • 03_Creational
          • Abstract Factory (aka Kit)
          • Builder
          • Factory Method (aka Virtual constructor)
          • Prototype
          • Singleton
        • 04_Structural
          • Adapter (aka Wrapper)
          • Bridge (aka Handle | Body)
          • Composite
          • Decorator (aka Wrapper)
          • Facade
          • Flyweight
          • Proxy (aka Surrogate)
        • 05_Behavioral
          • Chain of Responsibility
          • Command (aka Action | Transaction)
          • Iterator (aka Cursor)
          • Observer (aka Publish-Subscribe | Dependents)
          • Strategy (aka Policy)
    • Principles
      • REST
        • REST
  • Tools
    • Containers
      • Docker
        • Docker
        • Docker Image
        • Commands
        • Compose
        • Best Practices
      • Kubernetes
        • Kubernetes
    • VCS
      • Git
        • Quick reference of useful Git commands
Powered by GitBook
On this page
  • Icon
  • Basics
  • Terminology
  • Example
  • Flow logs
  • VPC Peering
  • VPC Endpoints
  • VPC Connection Access Type
  • Site to Site VPN
  • Direct Connect (DX)
  • Connection Type Diagram
  • Typical 3-Tier Architecture
  • References
  1. Cloud
  2. AWS
  3. DeveloperAssociate
  4. Services
  5. 08_VPC

Virtual Private Cloud (VPC)

Previous08_VPCNext09_S3

Last updated 4 months ago

Icon

VPC Icon

Basics

Terminology

  • VPC : A regional resource which is a logically isolated (private) virtual network that you've defined where resources are deployed in AWS.

    • Default VPC is the only VPC created by AWS for us per region.

  • Subnet : A subnet is a range of IP addresses in your VPC. They help us to partition a network. A subnet must reside in a single Availability Zone.

    • There are public subnets (accessible from public internet) and private subnets (NOT accessible from public internet) .

    • By default there is only one public subnet per AZ and no private subnet.

    • Route tables helps us define access to Public Internet and subnet to subnet communication in VPC.

  • Gateway : A gateway connects your VPC to another network.

    • Internet Gateway : This gateway is what makes a subnet public and hence can connect to public internet. This is done by having entry on Route table to connect the subnet to Internet Gateway.

    • NAT Instance : These are self managed, unlike Nat Gateway.

  • NACL : Network Access Control List (NACL) is a firewall that controls the traffic from and to a subnet.

    • Can have ALLOW and DENY rules.

    • Attached at subnets levels, consist of IP addresses with relevant rules.

    • By default a NACL allows all inbound and outbound traffic.

    • A NACL is the first layer of defense at subnet level and comes before Security Group.

  • Security Group : A firewall that controls flow of traffic from and to an ENI/EC2 instance.

    • Can only have ALLOW rules.

    • Can have IP addresses or other security groups.

    • By default allows outbound and blocks all inbound traffic.

Example

  • Below diagram shows a VPC has one subnet in each of the Availability Zones in the Region, EC2 instances in each subnet, and an internet gateway to allow communication between the resources in your VPC and the internet.

Flow logs

VPC Flow Log

  • VPC flow log captures all traffic in a VPC.

  • Subnet flow logs are also present in it.

  • Elastic Network Interface flow logs are also present in it.

  • Captures logs from all managed services as well.

  • These flow logs allow monitor & troubleshoot all connectivity issues.

  • They capture network information from AWS managed interfaces too.

  • These logs can be transported to other locations like S3, CloudWatch, Kinesis Data Firehose or tools as well.

VPC Peering

  • Connect two VPC in different or same AWS account privately using AWS' network.

  • Connecting them as if they are on same network.

  • Must not have overlapping CIDR IP blocks.

  • VPC peering is not transitive in nature, and connection must be explicitly established.

VPC Endpoints

  • These endpoints helps to connect to AWS services using private network instead of public network.

  • All AWS services are public, so this gives enhanced security and lower network latency to access AWS services.

  • VPC Endpoint Gateway** allows private subnets to access public AWS services without going through public network.

    • They are only available for S3 and Dynamo DB AWS services.

  • VPC Endpoint Interface (ENI) is a requester-managed network interface that serves as an entry point for traffic destined to an endpoint service and is available for AWS services other than S3 and DynamoDB.

VPC Connection Access Type

Site to Site VPN

Icon

About

  • Connect an on-premise VPN to AWS.

  • The connection is encrypted.

  • Goes over public internet.

Direct Connect (DX)

Icon

About

  • Establish a physical connection between on-premise and AWS.

  • Private network, secure and fast connection.

  • Takes a month to establish.

Connection Type Diagram

Typical 3-Tier Architecture

References

NAT Gateway : This AWS managed gateway connects a private subnet to services outside your VPC but external services cannot initiate a connection with those instances.

The route table associated with the private subnet sends internet traffic from the instances in the private subnet to the NAT instance in the public subnet. The NAT instance then sends the traffic to the internet gateway. The traffic is attributed to the public IP address of the NAT instance. The NAT instance specifies a high port number for the response; if a response comes back, the NAT instance sends it to an instance in the private subnet based on the port number for the response.

Traffic first comes to NACL and then flows to AWS resource through Security Group as shown below,

Difference between NACL and SG

Site to Site VPN Icon
DX Icon

VPC User Guide
VPC Peering
VPC Diagram
VPC Peering
VPC Endpoint Gateway
Connection Type Diagram
3 Tier Architecture