Sharing AWS VPC Endpoints Across VPCs: A Guide to Centralized Architecture and Configuration

Interface Endpoint | Transit Gateway | VPC Peering | Route 53 | Cross-Account | Cost and Security

In AWS, the core of "sharing a VPC Endpoint across different VPCs" is not simply attaching an Endpoint directly to multiple VPCs, but rather:

Centralize the Interface VPC Endpoints in a single Central/Shared Services VPC, and then allow other VPCs to access the private IP of this Endpoint through a Transit Gateway or VPC Peering, while using Route 53 to unify the DNS.

AWS officially refers to this model as... Centralized access to VPC private endpoints。

But first, it is essential to distinguish between them. Interface Endpoint and Gateway Endpoint。

First, let's state the most important conclusion.

Suppose you currently have:

VPC-A
VPC-B
VPC-C

All three VPCs need:

SSM
EC2 API
ECR
CloudWatch
KMS
Secrets Manager
STS
...

You have two designs.

Option A: Each VPC creates its own Endpoint.

VPC-A
 β”œβ”€ SSM Endpoint
 β”œβ”€ EC2 Endpoint
 β”œβ”€ ECR Endpoint
 β”œβ”€ Logs Endpoint
 └─ KMS Endpoint

VPC-B
 β”œβ”€ SSM Endpoint
 β”œβ”€ EC2 Endpoint
 β”œβ”€ ECR Endpoint
 β”œβ”€ Logs Endpoint
 └─ KMS Endpoint

VPC-C
 β”œβ”€ SSM Endpoint
 β”œβ”€ EC2 Endpoint
 β”œβ”€ ECR Endpoint
 β”œβ”€ Logs Endpoint
 └─ KMS Endpoint

This is the simplest and most isolated design.

However, the number of endpoints will expand rapidly.

for example:

10 VPCs × 20 AWS Service Endpoints × 2 AZs = 400 Endpoint ENIs

Interface Endpoint is based on Endpoint × AZ × HourThere is a fee, plus a data processing fee.

Therefore, as the scale increases, the costs and maintenance will increase significantly.

II. Architecture of Centralized VPC Endpoint

Establish a:

Network VPC / Shared Services VPC

All endpoints are placed here.

For example:

                  AWS Services
                       β”‚
                PrivateLink
                       β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚  Network VPC      β”‚
             β”‚  10.0.0.0/16      β”‚
             β”‚                   β”‚
             β”‚ SSM Endpoint      β”‚
             β”‚ KMS Endpoint      β”‚
             β”‚ ECR Endpoint      β”‚
             β”‚ Logs Endpoint     β”‚
             β”‚ STS Endpoint      β”‚
             β”‚ Secrets Endpoint  β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                       β”‚
                Transit Gateway
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚         β”‚         β”‚
             β”‚         β”‚         β”‚
          VPC-A      VPC-B      VPC-C
       10.10/16   10.20/16   10.30/16

then:

EC2 in VPC-A ↓ ssm.ap-northeast-1.amazonaws.com ↓ Route 53 ↓ Resolves to Private IP of SSM Endpoint in Shared VPC ↓ Transit Gateway ↓ Interface Endpoint ENI ↓ AWS PrivateLink ↓ SSM

AWS officially supports this centralized design.

III. A particularly important exception: S3 / DynamoDB

This needs to be discussed separately.

Gateway endpoints cannot be shared in this way.

S3 and DynamoDB have:

Gateway VPC Endpoint

For example:

com.amazonaws.ap-northeast-1.s3
com.amazonaws.ap-northeast-1.dynamodb

It is completely different from a regular Interface Endpoint.

Gateway Endpoint:

  • Do not use PrivateLink
  • Do not create ENI
  • Essentially, it's a combination of Route Table and AWS Managed Prefix List.
  • free
  • It can only be used by the VPC it resides in.

AWS has officially stated:

Gateway Endpoints cannot extend beyond the VPC; resources from the other end of a VPC Peering, Transit Gateway, VPN, or Direct Connect cannot borrow from this Gateway Endpoint.

Therefore, it should not be designed as follows:

VPC-A ──TGW── Shared VPC ── S3 Gateway Endpoint

Then we want VPC-A to use the S3 Gateway Endpoint of Shared VPC.

no.

IV. Correct Practices for S3 / DynamoDB

Normally it should be:

VPC-A β†’ Your own S3 Gateway Endpoint VPC-B β†’ Your own S3 Gateway Endpoint VPC-C β†’ Your own S3 Gateway Endpoint

because:

Gateway endpoints are not charged extra.

Therefore, there is no need to centralize the S3 Gateway Endpoint in order to "reduce the number of Endpoints".

recommend:

                  S3
             ↑     ↑     ↑
             β”‚     β”‚     β”‚
           GW EP  GW EP  GW EP
             β”‚     β”‚     β”‚
           VPC-A VPC-B VPC-C

and:

SSM
KMS
STS
ECR
ECR Docker
CloudWatch
CloudWatch Logs
Secrets Manager
SNS
SQS
etc.

These Interface VPC Endpoint That's what makes centralization suitable.

5. Why can Interface Endpoint be used across VPCs?

Because an Interface Endpoint is essentially:

Create an ENI with a Private IP address in your specified subnet.

According to AWS's official documentation, an Interface Endpoint creates an Endpoint Network Interface in the subnet you choose and assigns a private IP address to that subnet.

For example:

Shared VPC
10.0.0.0/16

AZ-a:
Endpoint ENI
10.0.10.50

AZ-c:
Endpoint ENI
10.0.20.60

For the other VPC, as long as:

VPC-A β†’ Can route to 10.0.10.50

and:

Security Group 10.0.10.50 allows VPC-A

In reality, the network can already access the Endpoint.

Therefore, the so-called:

Shared VPC Endpoint

What actually happened was:

Other VPCs ↓ Cross-VPC Network ↓ Access Central VPC Endpoint ENI

No:

A vpce-xxx can be attached to three VPCs simultaneously.

These are two completely different concepts.

VI. Three Practical Implementation Methods

In reality, it can be divided into three types.

method Recommendation level Suitable
Transit Gateway ⭐⭐⭐⭐⭐ Large-scale, multi-VPC
VPC Peering ⭐⭐⭐⭐ 2 to 5 VPCs
Use Endpoint DNS directly ⭐⭐⭐ Test/Special Application
Independent Endpoint per VPC ⭐⭐⭐⭐⭐ Prioritize isolation, small-scale

VII. Method 1: Transit Gateway + Central Endpoint

This is the most common solution for enterprise environments.

Assuming Tokyo Region:

ap-northeast-1

network:

Network VPC
10.0.0.0/16

App VPC-A
10.10.0.0/16

App VPC-B
10.20.0.0/16

App VPC-C
10.30.0.0/16

Architecture:

                       AWS SSM
                          β–²
                          β”‚
                     PrivateLink
                          β”‚
                 SSM Interface EP
                 10.0.10.50
                 10.0.20.50
                          β”‚
                β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
                β”‚   Network VPC   β”‚
                β”‚   10.0.0.0/16   β”‚
                β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                         β”‚
                       TGW
              β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
              β”‚          β”‚          β”‚
            VPC-A      VPC-B      VPC-C
          10.10/16   10.20/16   10.30/16

Transit Gateway (TGW) is designed by AWS for central routing across multiple VPCs and supports transient routing; AWS also recommends prioritizing TGW for large-scale multi-VPC networks.

VIII. Specific Operating Procedures

The following is a breakdown of the actual configuration.

Step 1: Create a Network VPC

For example:

VPC:
shared-endpoint-vpc

CIDR:
10.0.0.0/16

Two AZs:

ap-northeast-1a
Endpoint subnet:
10.0.10.0/24

ap-northeast-1c
Endpoint subnet:
10.0.20.0/24

It is recommended to have at least 2 AZs.

9. Step 2: Create a Transit Gateway

VPC Console:

Transit Gateways
β†’ Create transit gateway

For example:

Name:
core-tgw

Then create a VPC Attachment:

core-tgw
β”‚
β”œβ”€ shared-endpoint-vpc
β”œβ”€ app-vpc-a
β”œβ”€ app-vpc-b
└─ app-vpc-c

If you have different AWS accounts, you can also share the Transit Gateway via AWS RAM. AWS officially supports sharing the TGW across accounts.

10. Step 3: Configure VPC Route Table

Assumption:

Shared VPC:
10.0.0.0/16

VPC-A:
10.10.0.0/16

VPC-B:
10.20.0.0/16

VPC-A:

Destination        Target

10.10.0.0/16       local
10.0.0.0/16        tgw-xxxxxxxx

VPC-B:

Destination        Target

10.20.0.0/16       local
10.0.0.0/16        tgw-xxxxxxxx

Shared Endpoint VPC:

Destination        Target

10.0.0.0/16        local
10.10.0.0/16       tgw-xxxxxxxx
10.20.0.0/16       tgw-xxxxxxxx

Otherwise, the following will occur:

VPC-A β†’ Endpoint

You can go, but:

Endpoint β†’ VPC-A

They can't come back.

11. Step 4: Configure the TGW Route Table

TGW Route Table:

10.0.0.0/16
    β†’ shared-endpoint-vpc attachment

10.10.0.0/16
    β†’ VPC-A attachment

10.20.0.0/16
    β†’ VPC-B attachment

10.30.0.0/16
    β†’ VPC-C attachment

If there is no special need for network isolation, route propagation can be used.

The corporate environment is usually broken down:

Spoke TGW RT
Shared Services TGW RT
Inspection TGW RT

Avoid allowing all VPCs to communicate with each other by default.

12. Step 5: Create Interface Endpoint

For example, if sharing is required:

AWS Systems Manager

create:

VPC
β†’ Endpoints
β†’ Create endpoint

Service:

com.amazonaws.ap-northeast-1.ssm

VPC:

shared-endpoint-vpc

Subnets:

ap-northeast-1a
10.0.10.0/24

ap-northeast-1c
10.0.20.0/24

Thus, the following arises:

vpce-0123456789

ENI-A:
10.0.10.50

ENI-C:
10.0.20.50

Thirteenth, and most importantly: Do not directly enable Private DNS.

When a VPC normally uses its own Endpoint:

Enable Private DNS
βœ“

Very convenient.

For example, originally:

ssm.ap-northeast-1.amazonaws.com

It will automatically parse into:

10.0.10.50
10.0.20.50

The AWS SDK requires absolutely no modification.

However, centralized architecture has a problem.

Private DNS automatically creates an AWS-managed Private Hosted Zone, which only works within the VPC where the Endpoint resides.

therefore:

Shared VPC

Know:

ssm.ap-northeast-1.amazonaws.com
=
10.0.10.50

but:

VPC-A
VPC-B

I don't know.

Therefore, AWS's official central endpoint architecture recommends:

In the Central Endpoint scenario, disable the automatic Private DNS for Endpoint and then manually create the Route 53 Private Hosted Zone.

14. Step 6: Create Route 53 Private Hosted Zone

create:

Route 53
β†’ Hosted zones
β†’ Create hosted zone

Domain:

ssm.ap-northeast-1.amazonaws.com

Type:

Private Hosted Zone

First, associate:

shared-endpoint-vpc

15. Step 7: Create Alias

Enter:

ssm.ap-northeast-1.amazonaws.com

Create record。

Record:

ssm.ap-northeast-1.amazonaws.com

Type:

A

choose:

Alias

Target selection:

VPC Endpoint

Then:

vpce-0123456789...

AWS's official central endpoint solution is:

AWS Service DNS
↓
Route53 PHZ
↓
Alias
↓
Central Interface Endpoint

Instead of manually making the application use the Endpoint IP.

16. Step 8: Associate PHZ with all VPCs

Private Hosted Zone:

ssm.ap-northeast-1.amazonaws.com

Related:

shared-endpoint-vpc
app-vpc-a
app-vpc-b
app-vpc-c

A Private Hosted Zone in AWS Route 53 can be associated with multiple VPCs.

then:

VPC-A

implement:

nslookup ssm.ap-northeast-1.amazonaws.com

get:

10.0.10.50
10.0.20.50

VPC-B

same:

nslookup ssm.ap-northeast-1.amazonaws.com

Too:

10.0.10.50
10.0.20.50

At this time:

VPC-A
   β”‚
   β”‚ DNS
   β–Ό
ssm.ap-northeast-1.amazonaws.com
   β”‚
   β–Ό
10.0.10.50
   β”‚
   β–Ό
Transit Gateway
   β”‚
   β–Ό
Central VPC
   β”‚
   β–Ό
SSM VPC Endpoint

That completes the story.

17. Step 9: Endpoint Security Group

This is the second very common pitfall.

Endpoint ENI has Security Group.

For example:

endpoint-sg

Inbound:

HTTPS
TCP 443

Source:
10.10.0.0/16
10.20.0.0/16
10.30.0.0/16

It can be made even finer.

For example, only:

10.10.10.0/24
10.20.20.0/24

Allow access to the Endpoint.

If passage is not permitted here:

DNS OK
Routing OK
TGW OK

still:

timeout

18. Final Data Flow

For example, EC2 in VPC-A:

aws ssm describe-instance-information \
    --region ap-northeast-1

SDK request:

https://ssm.ap-northeast-1.amazonaws.com

β‘  DNS:

ssm.ap-northeast-1.amazonaws.com
↓
Route53 Private Hosted Zone
↓
10.0.10.50

β‘‘ Routing:

EC2
10.10.1.50
↓
VPC-A route table
↓
10.0.0.0/16 β†’ TGW

β‘’ TGW:

10.0.10.50
↓
Shared VPC attachment

β‘£ Shared VPC:

Endpoint ENI
10.0.10.50

β‘€ Endpoint:

PrivateLink
↓
AWS SSM

The following is not required throughout the process:

Internet Gateway
NAT Gateway
Public IP

This is one of its greatest significances. The purpose of PrivateLink is to allow access to AWS services through a private network without the need for IGW, NAT, or public IP addresses.

19. How to handle multiple endpoints?

Suppose you need:

SSM
EC2 Messages
SSM Messages
KMS
CloudWatch
CloudWatch Logs
Secrets Manager
ECR API
ECR DKR
STS

Central VPC:

Network VPC

β”œβ”€ vpce-ssm
β”œβ”€ vpce-ssmmessages
β”œβ”€ vpce-ec2messages
β”œβ”€ vpce-kms
β”œβ”€ vpce-monitoring
β”œβ”€ vpce-logs
β”œβ”€ vpce-secretsmanager
β”œβ”€ vpce-ecr-api
β”œβ”€ vpce-ecr-dkr
└─ vpce-sts

Route53:

ssm.ap-northeast-1.amazonaws.com
β†’ SSM Endpoint

ssmmessages.ap-northeast-1.amazonaws.com
β†’ SSM Messages Endpoint

ec2messages.ap-northeast-1.amazonaws.com
β†’ EC2 Messages Endpoint

kms.ap-northeast-1.amazonaws.com
β†’ KMS Endpoint

logs.ap-northeast-1.amazonaws.com
β†’ Logs Endpoint

secretsmanager.ap-northeast-1.amazonaws.com
β†’ Secrets Manager Endpoint

Then PHZ simultaneously associate:

VPC-A
VPC-B
VPC-C
VPC-D
...

Some AWS services have unique DNS structures, such as ECR Docker/OCI endpoints. AWS also notes that some services may require wildcard aliases, so it cannot be assumed that all endpoints have only one simple record.

20. What if they are different AWS Accounts?

For example:

Network Account
111111111111

App Account A
222222222222

App Account B
333333333333

The architecture is perfectly acceptable.

recommend:

AWS Organizations

Network Account
 β”œβ”€ TGW
 β”œβ”€ Shared VPC
 β”œβ”€ Interface Endpoints
 └─ Route53 PHZ

       ↓ AWS RAM

App Account A
 └─ VPC-A

App Account B
 └─ VPC-B

TGW can be accessed through:

AWS Resource Access Manager

share.

Cross-account associations for Private Hosted Zones are a bit more complicated.

21. Cross-account PHZ association

for example:

Network Account:
PHZ Z123456

App Account:
VPC vpc-abcdef

Network Account First:

aws route53 create-vpc-association-authorization \
  --hosted-zone-id Z123456 \
  --vpc VPCRegion=ap-northeast-1,VPCId=vpc-abcdef

Then App Account:

aws route53 associate-vpc-with-hosted-zone \
  --hosted-zone-id Z123456 \
  --vpc VPCRegion=ap-northeast-1,VPCId=vpc-abcdef

The official AWS process for cross-Account Private Hosted Zones is as follows:

PHZ Owner
↓
CreateVPCAssociationAuthorization

VPC Owner
↓
AssociateVPCWithHostedZone

Furthermore, this cross-account operation cannot be completed entirely by relying on the Route 53 Console; it requires CLI/API/SDK.

22. Method 2: VPC Peering

If you only have two or three VPCs, you don't necessarily need a TGW.

For example:

           Central VPC
          Endpoint VPC
        10.0.0.0/16
          /       \
         /         \
      Peering     Peering
       /             \
   VPC-A             VPC-B
10.10/16           10.20/16

Configuration:

VPC-A ↔ Central VPC
VPC-B ↔ Central VPC

Then:

VPC-A:

10.0.0.0/16
β†’ pcx-aaa

Central:

10.10.0.0/16
β†’ pcx-aaa

10.20.0.0/16
β†’ pcx-bbb

Endpoint SG:

443
10.10.0.0/16

443
10.20.0.0/16

DNS still:

PHZ
↓
Endpoint Alias
↓
associate VPC-A
associate VPC-B

23. The biggest drawback of Peering

it:

Transitive Routing is not supported.

AWS has made this clear in official statements.

For example:

VPC-A
  β”‚
peering
  β”‚
Central
  β”‚
peering
  β”‚
VPC-B

This cannot be used to conclude that:

A β†’ Central β†’ B

It's possible.

Therefore, if:

2 VPC
3 VPC

Peering is very comfortable.

if:

20 VPC
50 VPC
100 VPC

It will become increasingly difficult to maintain.

Therefore, generally speaking:

Small: VPC Peering Large: Transit Gateway

24. Method 3: Directly use Endpoint DNS

There is also a very simple method, which is especially suitable for testing.

After creating an Endpoint, AWS will generate something like this:

vpce-0123456789abcdef-xxxx.ssm.ap-northeast-1.vpce.amazonaws.com

AWS will create Regional and Zone DNS names for the Interface Endpoint.

Therefore, as long as the VPC-A network can reach the Shared VPC, it can directly:

aws ssm describe-instance-information \
  --endpoint-url \
  https://vpce-xxxx.ssm.ap-northeast-1.vpce.amazonaws.com

This way, you don't even need to do it yourself:

ssm.ap-northeast-1.amazonaws.com

Private Hosted Zone。

advantage

Super easy.

Ideal for:

Validate Routing, Validate SG, Validate TGW, Validate Endpoint

shortcoming

The application must have its configuration modified.

original:

AWS SDK
↓
ssm.ap-northeast-1.amazonaws.com

Now it becomes:

AWS SDK
↓
vpce-xxx....

Many applications are not convenient to modify in this way.

Therefore, the production environment is generally:

PHZ + Alias

most.

25. The greatest advantage of Centralized Endpoint

β‘  Significantly reduce Endpoint

Assumption:

20 VPC
15 Interface Endpoints
2 AZ

Distributed:

20 × 15 × 2
=
600 Endpoint AZ instances

Centralization:

15 × 2
=
30

The difference is huge.

26. Advantage β‘‘: Costs may be significantly reduced.

Interface Endpoint received:

Endpoint/AZ/hour
+
Data Processing / GB

AWS PrivateLink pricing includes an hourly charge per AZ plus data processing. The baseline data processing rate for the first 1 PB is about $0.01/GB; hourly prices vary by Region.

Distributed:

VPC × Service × AZ × endpoint-hour

Central:

Service × AZ × endpoint-hour
+
TGW

The more VPCs there are, the more significant the difference in the number of Endpoints.

27. But TGW is not free.

Many architecture diagrams here deliberately ignore this point.

Transit Gateway received:

Attachment hourly rate + Data Processing / GB

AWS officially charges based on the number of attachment hours and the amount of data flowing through the TGW.

Therefore, what should really be calculated is:

Per VPC Endpoint

Cost = Number of VPCs × Number of Endpoints × Number of AZs × Endpoint hourly + PrivateLink data

Centralized

Cost = Number of Endpoints × Number of AZs × Endpoint hourly + TGW attachment hourly + TGW data processing + PrivateLink data processing + possible cross-AZ data

so:

If a company already has a TGW (Township Gateway), a Central Endpoint is usually very attractive.

But if:

There are only 2 VPCs, only 3 endpoints, and no TGW.

Building a TGW specifically to save on endpoint costs may not be cost-effective.

28. Centralized's biggest drawback: Blast Radius

This is a very important issue.

turn out to be:

VPC-A β†’ Endpoint-A
VPC-B β†’ Endpoint-B
VPC-C β†’ Endpoint-C

There is a problem with Endpoint-A:

Only A has a problem.

Centralization:

A ─┐
B ─┼→ Central Endpoint
C β”€β”˜

Central Endpoint, Shared VPC routing, DNS, or TGW misconfiguration:

A
B
C
D
E
...

They might both be suspended.

so:

The cost of saving money and managing costs is an increased blast radius for shared infrastructure.

AWS also specifically points out that a central endpoint can broaden the scope of policy and failure impacts.

29. Endpoint Policy will also become more complex.

Distributed:

Dev VPC endpoint β†’ Dev permissions Prod VPC endpoint β†’ Prod permissions Security VPC endpoint β†’ Security permissions

Very easy to manage.

Centralization:

A KMS Endpoint for Dev Prod Test Security Monitoring...

All shared.

Endpoint Policy:

Principal
Resource
Action
Conditions

It will become increasingly complicated.

AWS has also issued a special reminder regarding this:

Centralization increases the difficulty of managing least-privilege endpoint policies, and the blast radius of a single endpoint policy is larger; the endpoint policy document itself also has size limitations.

30. Security isolation is also a problem.

for example:

Production VPC
Development VPC

All use:

Central S3 Interface Endpoint

Although:

IAM
Bucket Policy
Endpoint Policy
SG

Permissions can still be controlled, but the physical/network boundaries are no longer completely independent.

Therefore, for particularly demanding environments:

PCI FinancialProduction Security tooling

Possible designs:

Prod Endpoint VPC

NonProd Endpoint VPC

Instead of the whole company:

An Endpoint VPC

31. Recommended Enterprise Structure

It's not that there's only one in the entire company, but rather:

                   AWS Services
                        β”‚
          β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
          β”‚                            β”‚
   Prod Endpoint VPC           NonProd Endpoint VPC
          β”‚                            β”‚
        TGW                         TGW
     β”Œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”                 β”Œβ”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”
     β”‚    β”‚    β”‚                 β”‚    β”‚    β”‚
   Prod Prod Prod              Dev  Test Sandbox
   VPC1 VPC2 VPC3

even:

Security
Production
NonProduction

Create a Shared Endpoint VPC separately.

This way, we can take both into account:

Cost Management Security Isolation Blast Radius

32. Another very practical problem: DNS conflicts.

For example, VPC-A already had its own:

SSM Endpoint
Private DNS = Enabled

Then you associate again:

ssm.ap-northeast-1.amazonaws.com

This is the Central PHZ.

This could lead to DNS namespace conflicts.

Therefore, migration should generally be:

β‘  Create a central endpoint β‘‘ Create a central pHZ β‘’ Test endpoint-specific DNS β‘£ Associate spoke VPC β‘€ Verify DNS β‘₯ Delete the Spoke VPC's own endpoint ⑦ Verify services β‘§ Migrate to the next VPC

Instead of deleting them all at once.

33. Cross-region operations are possible, but overuse is not recommended.

For example:

Tokyo VPC
ap-northeast-1

Osaka VPC
ap-northeast-3

In theory:

Tokyo VPC
    ↓
TGW
    ↓
TGW Peering
    ↓
Osaka
    ↓
Central Endpoint

AWS also offers a cross-Region Centralized Endpoint architecture, via:

TGW Peering
+
Private Hosted Zones

accomplish.

However, it is generally recommended to:

Tokyo Endpoint VPC
   ↓
Tokyo VPCs

Osaka Endpoint VPC
   ↓
Osaka VPCs

That is to say:

One Region, one Central Endpoint VPC.

so:

Lower latency, simpler network, better disaster isolation, lower cross-region traffic costs

34. Direct Comparison of Four Options

project Per VPC Endpoint Peering Central TGW Central S3 Gateway
Endpoint number a lot of few few per VPC
PrivateLink Costs high Low Low free
TGW Cost none none have none
DNS Management Simple medium medium It's very simple.
Network complexity lowest medium medium lowest
Large-scale VPC ❌ ❌ βœ… βœ…
Isolation ⭐⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐⭐⭐
Blast Radius Small middle big Small
Multiple Accounts Can Can Very suitable Each created
Transitive Routing N/A ❌ βœ… N/A
Recommended number of VPCs 1 to a small amount small amount Medium and large any

35. A design suitable for large-scale environments

Assume the company has:

30 VPCs, 5 AWS Accounts, Tokyo Region

It can be established:

Network Account
β”‚
β”œβ”€ Transit Gateway
β”‚
β”œβ”€ Endpoint VPC
β”‚   β”‚
β”‚   β”œβ”€ SSM
β”‚   β”œβ”€ SSM Messages
β”‚   β”œβ”€ EC2 Messages
β”‚   β”œβ”€ ECR API
β”‚   β”œβ”€ ECR DKR
β”‚   β”œβ”€ STS
β”‚   β”œβ”€ KMS
β”‚   β”œβ”€ Secrets Manager
β”‚   β”œβ”€ CloudWatch
β”‚   β”œβ”€ CloudWatch Logs
β”‚   β”œβ”€ SNS
β”‚   └─ SQS
β”‚
└─ Route53 Private Hosted Zones

Then:

Account A
β”œβ”€ VPC1 ─┐
β”œβ”€ VPC2 ──
└─ VPC3 ──
         β”‚
Account Bβ”‚
β”œβ”€ VPC4 ──
β”œβ”€ VPC5 ──
└─ VPC6 ──
         β–Ό
        TGW
         β”‚
         β–Ό
 Endpoint VPC
         β”‚
         β–Ό
 AWS PrivateLink

but:

S3 Gateway Endpoint
DynamoDB Gateway Endpoint

It is still recommended:

Created separately for each VPC

Because it's free, and Gateway Endpoint itself cannot be used from other VPCs via TGW/Peering.

36. The entire architecture can be remembered as 4 layers.

In fact, when you troubleshoot problems in the future, you only need to remember these four layers:

             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚      DNS        β”‚
             β”‚   Route53 PHZ   β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
                      β–Ό
             Endpoint Private IP
                      β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚     Routing     β”‚
             β”‚   TGW/Peering   β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚    Security     β”‚
             β”‚ Endpoint SG/NACLβ”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                      β”‚
             β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”€β”€β”
             β”‚    IAM Policy   β”‚
             β”‚ Endpoint Policy β”‚
             β”‚ Service Policy  β”‚
             β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

If access is unavailable, please follow these steps:

β‘  DNS
β‘‘ Route
β‘’ Security Group/NACL
β‘£ IAM / Endpoint Policy

Through investigation, problems can usually be found.

The most memorable sentence

A VPC Endpoint is not itself "shared with multiple VPCs" via RAM.

The centralized nature of Interface Endpoints is:

Central VPC
    ↓
Interface Endpoint ENI
    ↑
TGW / VPC Peering
    ↑
Other VPCs

Passed again:

Route53 Private Hosted Zone

In all VPCs:

ssm.ap-northeast-1.amazonaws.com

All were analyzed to be:

Central VPC Endpoint

This completes the whole process. Shared/Centralized VPC Endpoint。

and Don't do this with S3/DynamoDB Gateway Endpoints; build your own for each VPC.Because it's free, and AWS explicitly prohibits its use from the other end, such as TGW or Peering.