Learning center

Check the VPC endpoint policy behind an AWS access denial

When only the workload's private network path fails, check the policy of the endpoint the request used. An endpoint policy can restrict access through that endpoint in addition to the other applicable AWS policies.

For example, an S3 reporting job moves into a fictional VPC whose S3 gateway endpoint allows access only to archive buckets. The same reports object is readable in the approved test environment, but the production worker's read fails. Check which route table serves the failing subnet and which endpoint that table uses. An authorized EC2 reader can query the endpoint policy and associated route tables together.

aws ec2 describe-vpc-endpoints --vpc-endpoint-ids vpce-0123456789abcdef0 \
  --query 'VpcEndpoints[0].{Service:ServiceName,Policy:PolicyDocument,RouteTables:RouteTableIds}'

Compare the endpoint's policy with the failed action and bucket. Record the route and endpoint policy together, since another VPC may use a different path. A successful comparison request cannot establish that the endpoint was the only difference. If the endpoint policy excludes the approved reports bucket, take the exact resource and action to the endpoint owner. VPC endpoint policies ยท S3 gateway endpoints

Trace another denied request.

One month of free code review.

New organizations get one calendar month of hosted code review for private and public GitHub repositories. No card or cloud connection required. Eligibility and fair-use terms.

Start free with GitHub

Related reading