After adding an S3 gateway endpoint, EC2 instances get `AccessDenied` on buckets they could read before.
IntermediateTroubleshootingCloud networking: VPC, firewalls, NAT, VPN and proxies
Answer
Likely causes → Traffic now goes through the endpoint, and either the endpoint policy is restrictive (only allows certain buckets), or the bucket policy uses aws:SourceIp conditions that no longer match (requests via a gateway endpoint carry private IPs, not the NAT EIP).
Diagnose →
aws ec2 describe-vpc-endpoints --vpc-endpoint-ids <vpce> --query 'VpcEndpoints[0].PolicyDocument'
aws s3api get-bucket-policy --bucket <bucket> --query Policy --output text | jq .
Fix → Allow the bucket in the endpoint policy, and replace aws:SourceIp conditions with aws:SourceVpce or aws:SourceVpc.
Prevent → Use aws:SourceVpce from the start for private-access buckets and test endpoint rollouts in one subnet first.
More on Cloud networking: VPC, firewalls, NAT, VPN and proxies
An EC2 instance in a private subnet hangs on `apt-get update` at `Connecting to archive.ubuntu.com`.BeginnerA new EC2 instance in a "public" subnet can't be reached over SSH from the internet; the SG allows port 22 from your IP.BeginnerThe SG allows inbound 443 and the app works from inside the VPC, but internet clients time out. The subnet NACL allows inbound 443.IntermediateA VPC peering connection is `Active`, but instances in the two VPCs can't ping each other.BeginnerALB targets are `unhealthy` with reason `Target.Timeout`, and VPC Flow Logs show `REJECT` from the ALB's IPs to the instances.BeginnerTwo VPCs are attached to a Transit Gateway, but traffic between them fails.Intermediate