Hosting AWS VPC Interface Endpoints in Shared Model

What is VPC Endpoint

A VPC endpoint enables private connections between your VPC and supported AWS services. Endpoints are classified as Interface and Gateways endpoints. In this blog, I will be showing how to host interface endpoints in shared model

Do you have Multi AWS Accounts in Organization?

When you have multi accounts structure in your Organization then creating endpoints in each accounts will increase the costs and IPs, in this blog I will explain how you can deploy endpoints in Shared Services Account and associate the member accounts VPCs with Private Hosted zone.

Below is the Architectural diagram which I will be showing in detail on how to setup and also how the flow works
Architecture Diagram
Architecture Design

AWS Services/Components required

  1. VPC
  2. Subnets
  3. Endpoints
  4. Hosted zone and Record set
  5. Transit Gateway

Implementation Steps

  • Create a VPC in shared services account and enable DNS hostname and resolution. Create the Subnets as per your requirement

  • Create required VPC endpoints and based on the HA setup, select required subnets to have endpoints hosted. Don't check or enable DNS name
    1*PNL7Qvw7yDIZ3Xkm-5hT_g

  • Create Private hosted zone with exact DNS name of the endpoints name, some DNS name will not have same as endpoints name, like for ecs agent, DNS name is “ecs-a.${AWS::Region}.amazonaws.com” and for ecs telemetry its DNS name is “ecs-t.${AWS::Region}.amazonaws.com” so make sure the DNS name is accurate in Private hosted zone
    1*gH2mJuxEb8tUIAAXYvG4uA

  • Create an “A” record and choose regional VPC endpoints for traffic to route
    1*MqYDpPyc258h1t_gB4uRBw



Last step is to associate a production account’s VPC to hosted zone created in Shared services account. Currently we can associate only via SDK or Route53 API or AWS CLI. We need to create VPC association authorization in shared account and then associate the VPC to the hosted zone in production account.Below AWS blog has given the detailed steps: 
Associate a Route 53 private hosted zone with a VPC in a different AWS account

  • From network account, where TGW is configured, you have to share the TGW to both production account and Shared account, also its possible to share to the OU, since Network account is part of same Organizations. Create the Transit gateway attachments in Shared and Prod account with the shared TGW. Configure the routes in Network account to have connectivity between shared and prod accounts

Testing

Launch an EC2 instance in prod account and run nslookup ssm.us-east-1.amazonaws.com in cmd where it will resolve Shared service Endpoints Subnets IP address and without hosting endpoints in production account, it resolved SSM endpoints privately

1*1ib3aIfrJt1KOMMORCGCqA
DNS resolved shared services endpoint for ssm




Traffic Flow

1*1ThipoJCuukRvyveqF2VoQ
Design Workflow

How it works? 

When you try to access VPC endpoint, say ssm.us-east-1.amazonaws.com then first AWS VPC DNS checks the associated PHZ in Shared account then it will connect to Shared services VPC endpoints through Transit Gateway and do the operation and traffic will be internal.

Limitations

Throughput:

Each Endpoint ENI can sustain 10Gbps with bursts up to 40Gbps and TGW provides 10 Gbps

VPCs per Private Hosted Zone:

By default, 100 VPCs can be associated with Private hosted zone and hard limit is 1,000

1000 VPCs can be associated with a single Private hosted zone. We can create a new private hosted zone for the endpoint which will have a unique zone ID and associate the 1001 VPCs to the new private zone, so that there will be no limitation in VPC association.

VPC Interface Endpoints per VPC:

Default is 50 but it can be increased to include all AWS services that have VPC endpoints.

Endpoint Policy Length:

Hard limit of 20,480 characters, important if you plan to use custom policies

Advantages 

  • Host Endpoints only in Shared Services account
  • Establish secure private connection towards AWS service for multiple VPCs
  • Have minimal cost impact to provide this connection
  • Saves huge number of IP space
  • Finally, save huge number of $

Conclusion

In this blog post, I have shown you how cost effective VPC endpoints solutions can be used in Multi Account Organization structure. Hope this blog helped you in your similar use case.

Thank you for reading!

Comments

Popular posts from this blog

Connect to Linux EC2 Instance if Key pair is lost after Initial Launch

Setup Grafana on AWS EKS and integrate with AWS Cloudwatch

Start or Stop services in multiple Windows EC2 Instances using AWS Systems Manager

Concourse CI Installation and Configuration in Windows

Install SSM Agent in Amazon EC2 Instance

Deploy AWS infrastructure using Terraform and GitHub Actions

Automate Permission Boundary Attachment to IAM roles and Users

AWS Route 53 Inbound Resolver to resolve DNS for Multi Account Organization

Import Existing Resources using Terraform