Guide · AWS VPC Lattice · Multi-Account
VPC Lattice Multi-Account Architecture for MCP Server Platforms
When your MCP server platform spans multiple AWS accounts — a common pattern in enterprise environments where each team or environment lives in its own account — VPC Lattice's Resource Access Manager (RAM) integration lets you maintain a central service network while letting each team's VPC join it and reach internal services. This guide covers the central service network pattern, sharing service networks and services across accounts via RAM, cross-account auth policy configuration, and infrastructure-as-code with CDK.
TL;DR
The recommended pattern has three account types: a platform account (owns the service network + publishes shared services), service accounts (own individual backend services, share them to the platform account for association), and consumer accounts (own MCP server VPCs, receive RAM share of the service network, then associate their VPCs). RAM sharing requires AWS Organizations trust. After sharing, each account manages its own associations independently. Auth policies use aws:PrincipalAccount or aws:PrincipalOrgID to scope cross-account access.
Account topology
A production MCP server platform typically separates concerns across three account types:
| Account type | What it owns | RAM action |
|---|---|---|
| Platform account | Service network, service network auth policy, shared infrastructure services (registry, identity proxy) | Shares service network TO consumer accounts; receives service shares FROM service accounts |
| Service account(s) | Individual backend services (data APIs, ML inference, auth services) with their own VPCs and target groups | Shares services TO platform account; platform account creates service-network-service association |
| Consumer accounts | MCP server VPCs; ECS/EC2 running MCP server processes | Receives service network share FROM platform account; creates VPC association in their own account |
Step 1: Platform account shares the service network
In the platform account, create a RAM resource share that allows consumer account VPCs to associate with the service network. Best practice: share to an entire OU rather than individual account IDs so new accounts in the OU automatically get access.
// Platform account — us-east-1
import { RAMClient, CreateResourceShareCommand } from "@aws-sdk/client-ram";
const ram = new RAMClient({ region: "us-east-1" });
const share = await ram.send(new CreateResourceShareCommand({
name: "mcp-platform-service-network",
resourceArns: [
// Share the service network
"arn:aws:vpc-lattice:us-east-1:111111111111:servicenetwork/sn-0abc123def456789a",
],
principals: [
// Share to the entire MCP consumer OU
"arn:aws:organizations::111111111111:ou/o-abc123def456/ou-mcp0consumers1",
// Or individual accounts:
// "222222222222", // consumer account 1
// "333333333333", // consumer account 2
],
allowExternalPrincipals: false, // restrict to org members
tags: [
{ key: "ManagedBy", value: "platform-team" },
{ key: "Resource", value: "mcp-service-network" },
],
}));
console.log("RAM share ARN:", share.resourceShare?.resourceShareArn);
When sharing to an OU, existing and future accounts in the OU all receive the share — no need to update the RAM resource share when a new consumer account is added. If allowExternalPrincipals: false, only accounts in the same AWS Organization can be listed as principals.
Step 2: Consumer accounts accept the share and associate VPCs
When RAM is used with AWS Organizations and sharing is enabled organization-wide, resource shares are auto-accepted in member accounts — no manual acceptance needed. If auto-accept is not configured, member accounts accept via the RAM console or AcceptResourceShareInvitationCommand.
// Consumer account — same region (us-east-1)
import {
VpcLatticeClient,
CreateServiceNetworkVpcAssociationCommand,
GetServiceNetworkVpcAssociationCommand,
} from "@aws-sdk/client-vpc-lattice";
const lattice = new VpcLatticeClient({ region: "us-east-1" });
// Use the platform account's service network ARN directly
const vpcAssoc = await lattice.send(new CreateServiceNetworkVpcAssociationCommand({
serviceNetworkIdentifier:
"arn:aws:vpc-lattice:us-east-1:111111111111:servicenetwork/sn-0abc123def456789a",
vpcIdentifier: "vpc-0consumer1mcp2server", // VPC in this consumer account
securityGroupIds: ["sg-0consumer1outbound"], // SG in consumer account's VPC
}));
// Poll for ACTIVE
while (true) {
const detail = await lattice.send(new GetServiceNetworkVpcAssociationCommand({
serviceNetworkVpcAssociationIdentifier: vpcAssoc.id,
}));
if (detail.status === "ACTIVE") break;
if (detail.status === "CREATE_FAILED") {
throw new Error(`VPC association failed: check security group and RAM share`);
}
await new Promise(r => setTimeout(r, 3000));
}
console.log("VPC associated — services now reachable from this VPC");
Key point: the CreateServiceNetworkVpcAssociationCommand is called in the consumer account using the platform account's service network ARN. The VPC and security group IDs are from the consumer account. VPC Lattice resolves the cross-account reference via the RAM share.
Step 3: Service account shares a service
Backend service teams operate in their own accounts. They create a VPC Lattice service in their account and share it to the platform account via RAM so the platform team can associate it with the central service network.
// Service account (234567890123) — us-east-1
import { RAMClient, CreateResourceShareCommand } from "@aws-sdk/client-ram";
const ram = new RAMClient({ region: "us-east-1" });
// Service account shares the service to the platform account
await ram.send(new CreateResourceShareCommand({
name: "mcp-data-service-share",
resourceArns: [
"arn:aws:vpc-lattice:us-east-1:234567890123:service/svc-0data1service2abc3",
],
principals: ["111111111111"], // platform account ID
allowExternalPrincipals: false,
}));
Step 4: Platform account creates the service-network association
Once the service share is accepted by the platform account, the platform team associates the service with the central service network. This is the step that makes the service's DNS name visible to all consumer VPCs.
// Platform account — associate the shared service with the service network
import {
CreateServiceNetworkServiceAssociationCommand,
GetServiceNetworkServiceAssociationCommand,
} from "@aws-sdk/client-vpc-lattice";
const svcAssoc = await lattice.send(new CreateServiceNetworkServiceAssociationCommand({
serviceNetworkIdentifier: "sn-0abc123def456789a",
serviceIdentifier:
"arn:aws:vpc-lattice:us-east-1:234567890123:service/svc-0data1service2abc3",
// Cross-account association using service ARN from service account
}));
console.log("DNS name:", svcAssoc.dnsEntry?.domainName);
// mcp-data-service-0a1b2c.mcp-platform-3d4e5f.vpc-lattice-svcs.us-east-1.on.aws
// All consumer VPCs can now reach this service at the DNS name above
Cross-account auth policy
The service's auth policy is set in the service account. It must explicitly allow principals from consumer accounts — without this, all cross-account requests return 403 regardless of the service network policy:
// Service account — allow consumers from the platform's consumer OU
import { VpcLatticeClient, PutAuthPolicyCommand } from "@aws-sdk/client-vpc-lattice";
const latticeSvcAccount = new VpcLatticeClient({ region: "us-east-1" });
await latticeSvcAccount.send(new PutAuthPolicyCommand({
resourceIdentifier: "svc-0data1service2abc3",
policy: JSON.stringify({
Version: "2012-10-17",
Statement: [
{
Sid: "AllowConsumerAccountMcpServers",
Effect: "Allow",
Principal: "*",
Action: "vpc-lattice-svcs:Invoke",
Resource: "*",
Condition: {
StringEquals: {
"aws:PrincipalOrgID": "o-abc123def456",
},
StringLike: {
// Only task roles, not arbitrary human users
"aws:PrincipalArn": [
"arn:aws:iam::*:role/mcp-server-task-role",
"arn:aws:iam::*:role/mcp-server-*",
],
},
},
},
],
}),
}));
The service network auth policy (set in the platform account) works as the outer gate; the service auth policy is the inner gate. The common approach is a permissive network policy (allow entire org) + restrictive service policies (allow specific role patterns per service). This avoids updating the network policy when new services are added.
DNS resolution across accounts
VPC Lattice DNS names are publicly resolvable at the .on.aws domain — but the IP addresses they resolve to only work from within an associated VPC. Consumer account EC2 instances and ECS tasks use the standard AWS resolver (169.254.169.253 or the VPC +2 resolver), which automatically routes *.vpc-lattice-svcs.{region}.on.aws queries through the Lattice data plane once the VPC is associated.
No Route 53 Resolver rules or private hosted zones are needed for the standard case. If your VPC uses a custom resolver (common in on-premises DNS forwarding setups), add a forwarding rule for vpc-lattice-svcs.{region}.on.aws to 169.254.169.253.
# Verify DNS resolution from within a consumer VPC instance:
$ nslookup mcp-data-service-0a1b2c.mcp-platform-3d4e5f.vpc-lattice-svcs.us-east-1.on.aws
Server: 169.254.169.253
Address: 169.254.169.253#53
Non-authoritative answer:
Name: mcp-data-service-0a1b2c.mcp-platform-3d4e5f.vpc-lattice-svcs.us-east-1.on.aws
Address: 169.254.171.0 # Lattice-managed IP — not routable outside the VPC
CDK infrastructure as code
The aws-cdk-lib/aws-vpclattice module provides L1 constructs (CloudFormation wrappers). For the multi-account pattern, deploy each stack to the appropriate account using CDK environments:
// cdk.ts — platform account stack
import { App, Stack, Environment } from "aws-cdk-lib";
import { CfnServiceNetwork, CfnServiceNetworkVpcAssociation } from "aws-cdk-lib/aws-vpclattice";
const platformEnv: Environment = {
account: "111111111111",
region: "us-east-1",
};
class PlatformServiceNetworkStack extends Stack {
constructor(scope: App) {
super(scope, "PlatformServiceNetworkStack", { env: platformEnv });
const serviceNetwork = new CfnServiceNetwork(this, "McpPlatformNetwork", {
name: "mcp-platform-prod",
authType: "AWS_IAM",
tags: [{ key: "ManagedBy", value: "platform-team" }],
});
// VPC association for the platform account's own VPCs (if any)
new CfnServiceNetworkVpcAssociation(this, "PlatformVpcAssoc", {
serviceNetworkIdentifier: serviceNetwork.attrId,
vpcIdentifier: "vpc-0platform1internal2vpc",
securityGroupIds: ["sg-0platform1outbound"],
});
// RAM share to consumer OU (via CfnResourceShare from aws-cdk-lib/aws-ram)
// ... (RAM CDK constructs follow standard pattern)
}
}
// Consumer account stack — associates consumer VPC
class ConsumerMcpServerStack extends Stack {
constructor(scope: App, consumerEnv: Environment) {
super(scope, "ConsumerMcpServerStack", { env: consumerEnv });
new CfnServiceNetworkVpcAssociation(this, "ConsumerVpcAssoc", {
// Cross-account ARN — works because RAM share is active
serviceNetworkIdentifier:
"arn:aws:vpc-lattice:us-east-1:111111111111:servicenetwork/sn-0abc123def456789a",
vpcIdentifier: "vpc-0consumer1mcp2server",
securityGroupIds: ["sg-0consumer1outbound"],
});
}
}
Monitoring and access logs across accounts
Each account monitors its own side: the platform account sets up access logs on the service network (captures all traffic including cross-account calls), and service accounts monitor their services. Consumer accounts monitor outbound call patterns via their application logs and CloudWatch.
// Platform account — service network access logs to centralized logging account
import { CreateAccessLogSubscriptionCommand } from "@aws-sdk/client-vpc-lattice";
await lattice.send(new CreateAccessLogSubscriptionCommand({
resourceIdentifier: "sn-0abc123def456789a",
// Cross-account Kinesis Firehose — requires resource policy on Firehose
destinationArn:
"arn:aws:firehose:us-east-1:999999999999:deliverystream/central-lattice-logs",
}));
Log records include callerPrincipal (the IAM ARN — shows which account+role made the call), callerVpcId (the consumer VPC), and serviceArn (the service account's service ARN). This gives the platform team a complete picture of cross-account call patterns without needing access to consumer account logs.
Operational runbook: adding a new consumer account
- Ensure the new account is in the RAM-shared OU. If using per-account sharing, add the account ID to the RAM resource share:
AssociateResourceShareCommandwithprincipals: [newAccountId]. - In the new account, deploy the consumer stack that creates
CfnServiceNetworkVpcAssociationwith the shared service network ARN and a properly configured security group (outbound to Lattice managed prefix list). - Verify association status reaches
ACTIVE(monitor withGetServiceNetworkVpcAssociationCommand). - Assign the IAM task role for the MCP server an identity policy granting
vpc-lattice-svcs:Invoke. - Test: from an instance or ECS task in the new VPC, call the Lattice DNS name with SigV4 signing. Expect 200; if 403, check the service auth policy's
aws:PrincipalAccountcondition includes the new account, or useaws:PrincipalOrgID. - Enable access log subscription in the platform account to include the new VPC in observability.
Limits to plan around
| Limit | Default |
|---|---|
| Service networks per account | 5 |
| VPC associations per service network | 200 |
| Service associations per service network | 500 |
| Services per account | 100 |
| Listeners per service | 2 (HTTP + HTTPS) |
| Rules per listener | 50 (default) — request increase for more |
| Target groups per account | 100 |
| Targets per target group | 1,000 (IP), 1,000 (instance) |
The 200 VPC associations limit per service network is the most likely constraint for a large enterprise. If you exceed it, create a second service network in the platform account and share both — services can be associated with multiple service networks simultaneously.