tailscale-dev / tailscale-dev/examples-infrastructure-as-code

terraform/aws: example for routing one S3 bucket over PrivateLink

Open
#52 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
HCL
Stars
37
Forks
4
Avg merge
1m
Merged PRs (30d)
1

Description

Pointing an app connector at a public S3 endpoint does not work well. S3 regional endpoints resolve to a large pool of addresses that rotates. The connector keeps discovering new addresses, so the route set grows and never settles. Clients see the churn as ERR_NETWORK_CHANGED in Chrome.

People hit this because the guidance points both ways. Tailscale ships an aws-s3-<region> preset app, while the best-practices guide recommends serving multi-tenant content outside app connectors. S3 regional endpoints are shared multi-tenant address space, but nothing connects those two pages.

The fix is to give the bucket a stable private address first, then advertise that. Three pieces have to line up:

  1. An S3 interface VPC endpoint with private_dns_only_for_inbound_resolver_endpoint = false. Resolving the bucket domain inside the VPC now returns the endpoint ENI.
  2. A split DNS entry on the exact bucket FQDN. Split DNS does not match siblings, so other buckets stay public. This is what scopes the change to one bucket.
  3. The connector advertises the VPC resolver and the endpoint ENI. The resolver is the only one that knows the private DNS mapping, and a client outside the VPC cannot reach it directly.

The same shape applies to any interface-endpoint service, not just S3.

I have this built as terraform/aws/aws-app-connector-s3-privatelink. It passes tflint, fmt, and validate, and I have applied it and confirmed the private path end to end.

Opened as a draft PR in #51.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The requested example is in terraform/aws/aws-app-connector-s3-privatelink; start by reviewing the existing draft PR in #51 and its Terraform configuration. Check that the example covers the S3 interface endpoint, bucket-specific split DNS, and connector advertisement, then run tflint, fmt, and validate as described in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, terraform
Domain
cloud, infrastructure, networking
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.