tailscale-dev / tailscale-dev/examples-infrastructure-as-code
terraform/aws: example for routing one S3 bucket over PrivateLink
Nessuno ha ancora preso questa issue.
- Lingua principale
- HCL
- Stelle
- 37
- Fork
- 4
- Merge medio
- 1m
- PR unite (30g)
- 1
Descrizione
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:
- 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. - 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.
- 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.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
L'esempio richiesto si trova in terraform/aws/aws-app-connector-s3-privatelink; inizia esaminando la PR di bozza esistente in #51 e la relativa configurazione Terraform. Verifica che l'esempio includa l'endpoint di interfaccia S3, lo split DNS specifico del bucket e l'annuncio del connettore, quindi esegui tflint, fmt e validate come descritto nell'issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- aws, terraform
- Ambito
- cloud, infrastructure, networking
- Tipo di issue
- Funzionalità
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Specificata chiaramente
- Idoneità per principianti
- 25/100