Accessing s3 bucket form Private Ec2 Instance
Project summary: In this step-by-step guide, we'll walk you through the process of creating a Virtual Private Cloud (VPC) on Amazon Web Services (AWS), configuring public and private subnets, and setting up a VPC endpoint to securely connect an EC2 instance from the private subnet to an S3 bucket.
Services being used: AWS EC2, VPC, VPC Endpoint and s3 bucket
Process flow:
Creation of VPC
Creation of Internet gateway and attaching to VPC
Subnets creation (public and private subnet )
NAT gateway creation
Route table creation (public and private)
Public route table associating with public subnet and should attach to internet gateway
Private route table associating with private subnet and should attach to NAT gateway
Deploying ec2 instances in public and private Make sure your private ec2 key should be in public ec2 instance
chmod 400 <keypair name>
ssh -i /path/to/private_key.pem ec2-user@private_ip_address
Installing aws cli on private instance and configuring aws credentials
Removing NAT gateway from private route-table
Creation s3 bucket
Creation of VPC endpoint associating with private route table
Accessing s3 bucket from a private ec2 instance