graduapp.com

Exploring AWS VPC Endpoints: A Comprehensive Guide

Written on

Chapter 1: Introduction to VPC Endpoints

This section provides an overview of VPC endpoints and their deployment in AWS.

VPC endpoints allow private connections between your Virtual Private Cloud (VPC) and AWS services, eliminating the need for an internet gateway, NAT device, or VPN connection. Instances within the VPC can communicate with AWS services without requiring public IP addresses.

Types of VPC Endpoints:

  1. Interface Endpoint:

    An elastic network interface that uses a private IP address from your subnet's range, acting as an entry point for traffic directed to supported services.

  2. Gateway Endpoint:

    This endpoint connects your VPC to AWS services in a scalable and highly available manner. Typically associated with services accessible via an Internet Gateway, such as Amazon S3 and DynamoDB, we will focus on S3 VPC endpoints in this section.

Key AWS Services Involved: - VPC - Subnet - Route Table - Internet Gateway - EC2 - S3 - AWS CLI

Chapter 2: Overview of AWS Services

Amazon EC2 (Elastic Compute Cloud): EC2 provides scalable computing resources in the cloud, enabling users to run virtual servers (instances) for applications, workloads, or data storage.

Amazon S3 (Simple Storage Service): S3 is an object storage solution offering scalable, durable, and secure data storage. It allows users to store and retrieve any amount of data anytime, from anywhere.

AWS VPC (Virtual Private Cloud): An AWS VPC is a customizable, isolated network within the AWS cloud for launching AWS resources, defining subnets, and configuring network settings, security, and routing.

AWS CLI (Command Line Interface): The AWS CLI is a command-line tool that enables users to interact with AWS services through shell commands.

Chapter 3: Hands-On Deployment

In this section, we will deploy two EC2 instances—one in a public subnet and the other in a private subnet—as well as create an S3 bucket. The objective is to access the files stored in the S3 bucket securely from the private server without an internet connection.

Step-by-Step Deployment:

  1. Log in to the AWS Console using your root username and password.
  2. Navigate to the VPC Console in AWS.
VPC Console Overview
  1. Click on "Create VPC."
  2. Follow the configurations outlined below.
VPC Creation Configuration
  1. Create one public subnet and one private subnet.
Public and Private Subnet Configuration
  1. Click "Create VPC."
VPC Creation Confirmation
  1. You have now successfully created a VPC with two subnets.
Two Subnets Created in VPC
  1. Two route tables are configured, each associated with their respective subnets.
Route Tables Overview
  1. An Internet Gateway is attached to the route table of the public subnet, allowing internet access (0.0.0.0/0) by default.
  2. Next, deploy two EC2 servers—one in the public subnet and another in the private subnet. The primary distinction is that the public subnet allows public IPs, whereas the private subnet does not.

Public Subnet EC2 Server:

EC2 Server in Public Subnet

Private Subnet EC2 Server:

EC2 Server in Private Subnet
  1. Now that both EC2 servers are hosted, the next step is to deploy an S3 bucket.
  2. Navigate to the S3 Console and click on "Create Bucket."
  3. Follow the configurations detailed below.
Creating an S3 Bucket
  1. After following the setup instructions, click "Create Bucket."
S3 Bucket Created Confirmation
  1. The next step is to create a VPC Endpoint, which will allow access to files from the S3 bucket without using the internet on the private server.
VPC Endpoint Configuration
  1. Select the appropriate VPC and route tables to complete the endpoint setup.
VPC Endpoint Selection
  1. The endpoint is now successfully created.
Endpoint Creation Confirmation
  1. Now that the EC2 and S3 services are deployed, connect to the EC2 server in the public subnet using PuTTY.
Connecting to EC2 Server via PuTTY
  1. Install the AWS CLI on the EC2 server by following the instructions specific to your operating system. For Linux, use the following commands:

unzip awscliv2.zip sudo ./aws/install

  1. After installation, verify with:

aws --version

  1. AWS CLI is successfully installed on the public server.
AWS CLI Installation Confirmation
  1. Configure your AWS Console on the EC2 server by using the command aws configure and ensure you have your access key and secret key ready.
  2. The AWS Console is now successfully configured on the EC2 server.
  3. You can upload files to the S3 bucket using the AWS Console.
Uploading Files to S3 Bucket
  1. For demonstration, I have uploaded a PDF for reference.
  2. To verify from the EC2 server, check the S3 bucket contents.
Verifying S3 Bucket Contents
  1. You should see the AWS Developer.pdf in your S3 bucket.
  2. To access the S3 content from the private server, create a new file for your private server key and copy the public key to this file. Use the following commands:

vim filename.pem chmod 600 filename.pem

  1. Connect to the private server using the SSH command:

ssh -i private.pem [email protected]

  1. Reconfigure AWS on the private server following the same steps, enabling access to files stored in the S3 bucket.

By establishing the endpoint connection, you can access the files in your S3 bucket from the private server without needing an internet connection.

AWS VPC Endpoints Part 1: This video provides an overview of AWS VPC endpoints and their implementation.

AWS - How to Use VPC Endpoint: This tutorial guides you through the process of utilizing VPC endpoints effectively.

Share the page:

Twitter Facebook Reddit LinkIn

-----------------------

Recent Post:

Embracing the Journey: Finding Joy in Every Step of Life

Discover the importance of valuing the journey of life over the destination and learn how to appreciate each moment.

Strategies for Programmers to Enhance Social Connections

Discover effective strategies for programmers to maintain social connections and enhance professional success in the tech world.

Understanding Ocean Dead Zones: Causes and Consequences

Explore the causes of ocean dead zones, their impact on marine life, and the importance of addressing this critical environmental issue.

Enhancing Your Ruby on Rails App: Top Performance Monitoring Tools

Discover essential tools for monitoring and optimizing performance in your Ruby on Rails applications.

Innovative Insights from Peter Thiel's

Explore the key takeaways from Peter Thiel's

Fasting: A Promising Approach to Enhancing Immune Function

Exploring how fasting can support immune health and combat infections.

Understanding the Distinction Between Pain and Suffering

Explore the vital differences between pain and suffering, and how perception shapes our experiences.

Transform Your PhD Workflow with Zotero Connector: A Guide

Discover how Zotero Connector can streamline your academic workflow and enhance productivity in your PhD journey.