Urgent.News

What's breaking now, across hundreds of outlets.

Tech

I Gave an EC2 Instance Zero Internet and It Still Uploaded to S3

The challenge The client's requirement fit in one sentence: The private backend must talk to Amazon S3 without ever touching the public internet. The environment had two VPCs: A custom VPC with a private EC2 instance. It had no Internet Gateway and no NAT Gateway . A default VPC with a public-facing EC2 instance acting as a bastion (jump host) . The plan was to SSH into the bastion, hop to the…

The challenge: The client demanded private backend communication with Amazon S3 without direct internet access. Two VPCs were involved: a custom VPC with a private EC2 instance and a default VPC with a public-facing EC2 instance serving as a bastion host. The goal was to execute aws s3 cp from the private EC2 via SSH, maintaining all traffic within the AWS network.

The solution required five components working together: VPC Peering, route tables, security groups, an IAM role, and an S3 Gateway Endpoint. The architecture diagram illustrated the complete design.

Key challenges included:

1. Lack of Internet Gateway and NAT leading to no default route for the private subnet, resulting in S3 requests timing out.

2. Correctly configuring VPC Peering, as traffic only flows when both route tables reference it.

3. Properly securing security groups to prevent cutting off access.

4. Avoiding hardcoding credentials; using IAM roles instead.

5. Deploying an S3 Gateway Endpoint within the private subnet's route table.

Steps included:

1. Requesting and accepting VPC Peering connections.

2. Building symmetric route tables pointing to each other.

3. Tightening security groups to allow only SSH (22) and ICMP from the exact private IP of the other instance.

4. Attaching an IAM role with S3 permissions to the private EC2 instance.

5. Creating an S3 Gateway Endpoint in the private subnet's route table.

Debugging was facilitated by a hop-by-hop map, highlighting checks at each stage - from the laptop to the S3 bucket. Issues such as timeout or 100% packet loss indicated network problems, while AccessDenied errors pointed to IAM role or bucket policy issues.

The outcome was a secure, low-cost design where authentication came from IAM roles, and all traffic to S3 remained within the AWS network, eliminating the need for static credentials and reducing the attack surface.

Rewritten by urgent.news; may contain errors — check the original.

Source: dev.to

Read the original at dev.to →

Report a problem with this story

More in Tech

I Stopped Scheduling My n8n Workflows on the Hour — My 429s Disappeared

I Stopped Scheduling My n8n Workflows on the Hour — My 429s Disappeared Part of my build-in-public series on running LLM workflows in n8n in production.

  • Reporter's workflows failed due to scheduling issues
  • 429 Too Many Requests error caused by parallel LLM calls
  • Staggering schedules and adding random delay resolved issue

Yaadein: Building a Memory Companion for Families, in 24 Hours

This is a submission for the MLH x DEV Writing Challenge What I Built Imagine waking up one morning and your grandmother doesn't recognize you — not your face, not your name, not even the fact that…

  • Yaadein is a memory companion web app developed in 24 hours.
  • Created for families and elderly with early memory loss.
  • Features include Family Photo Quiz, Memory Match game, and Family Dashboard.

Why page 2 repeats the same posts in an Oxygen loop

A pagination link can change the URL while leaving the cards exactly as they were. That happened in a private Oxygen 6.2.0-beta.9 test: a static Text query returned six posts on page 1, and clicking…

  • Same posts repeat on page 2 due to URL alteration without changing content.
  • Component pulls data from Custom query, displays six posts on page 1.
  • Identical Read guide URLs confirm query stuck on first six posts.

Ufone Achieves Global Recognition at Dragons of Asia 2026

Pak Telecom Mobile Limited (PTML), through its brand Ufone 5G, has won two awards at the Dragons of Asia Awards …

  • Ufone wins two awards at Dragons of Asia 2026
  • Ufone 5G secures Gold in Best in Media for Super 5 campaign
  • Babar Azam’s Lost Phone campaign garners Black Dragon award

More from Saturday, 17 October 2026 →