Mastering S3 Connectivity: A Deep Dive into Endpoint Access
Published: 2023-07-11 06:43:09

**overview architecture**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fbhqyfme41aao7lnsmrj.png)

The architecture you described involves creating a Virtual Private Cloud (VPC) with two subnets (one public and one private), launching instances within those subnets, creating an S3 bucket, configuring IAM roles for a user, and establishing an endpoint connection to access the S3 bucket from a private server with an Internet Gateway (IGW). Here is an overview of this architecture:

**Virtual Private Cloud (VPC):**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xw9bp4rztv34dzkhymsg.png)

1. - Create a VPC: Define the IP address range for the VPC and set up the VPC networking infrastructure.

**Subnets:**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rbho5d6dzi82y6t1fhrt.png)

1. - Public Subnet: Create a public subnet within the VPC with a route table that has an IGW attached. This subnet allows instances to have public IP addresses and direct access to the internet.
2. - Private Subnet: Create a private subnet within the VPC. Instances in this subnet do not have public IP addresses and cannot be directly accessed from the internet.

**Instances:**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gz2fptbshd0jpgno7c1c.png)

1. - Launch Instances: Launch EC2 instances within both the public and private subnets. Configure security groups to control inbound and outbound traffic for these instances.

**S3 Bucket:**

Create S3 Bucket: Create an S3 bucket within AWS S3. This bucket will be used to store and manage your objects (files).

**IAM Roles:**

1. - Configure IAM Roles: Create and configure IAM roles for the instances to grant them specific permissions for accessing AWS services, such as S3. Ensure the IAM role associated with the private server has appropriate S3 access permissions.

**Endpoint Connection:**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/55t28cft0mrysphjprml.png)

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/08fp40cbqif1jknehess.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/qa5zajsxf7izi8qd8zfb.png)
1. - Create Endpoint: Create a VPC endpoint for S3 within the VPC. This allows instances in the private subnet to access S3 directly, without going through the IGW.
2. - Configure Routing: Update the route table of the private subnet to route S3 traffic through the VPC endpoint.

**Jump Server Access:**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fmko7he1r8nncelqep0q.jpg)
1. - Connect to the public server using SSH, providing the necessary key pair for authentication.
2. - From the public server, establish an SSH connection to the private server using its private IP address or internal DNS name.
3. - Ensure that the necessary key pair and file read permissions are set up on the private server, allowing you to connect to it securely.

**Access S3:**


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mmftvjjwyzkblnuavzp.jpg)
- 1. Now, the instances in the private subnet can securely access the S3 bucket using the VPC endpoint without needing to traverse the public internet or rely on the IGW.
- 2. It's important to note that this architecture assumes the instances in the public subnet have internet connectivity through the IGW and can access the internet. The private subnet instances rely on the VPC endpoint to securely access the S3 bucket without exposing their traffic to the public internet.

Remember to configure appropriate security groups, IAM roles, and access policies to ensure secure and controlled access to your resources.