Network
Getting Started
The Statista AWS accounts have a pre-created VPC (if it's missing, please contact the CDX team). In case an application should be installed into the VPC, there could be the need to run through the network setup process (e.g. if the application needs access to the internet).
The network setup creates an InternetGateway and adds the following routes:
- The public subnet of the VPC is routed to the InternetGateway
- The private subnet of the VPC is routed to the TransitGateway
[!NOTE]
The network setup is not automatically configured for each account during VPC creation, as the provisioned infrastructure is optional, not required by every team, and incurs additional costs.
Schematic view of the network setup
{
"title": "Network Setup",
"icons": [],
"colors": [
{
"id": "blue",
"value": "#0066cc"
},
{
"id": "green",
"value": "#00aa00"
},
{
"id": "red",
"value": "#cc0000"
},
{
"id": "orange",
"value": "#ff9900"
},
{
"id": "purple",
"value": "#9900cc"
},
{
"id": "black",
"value": "#000000"
},
{
"id": "gray",
"value": "#666666"
}
],
"items": [
{
"id": "591dd928-032e-4087-9bee-c0807d68692c",
"name": "Lambda App",
"icon": "aws-lambda"
},
{
"id": "6bfaf0e2-d2de-4382-8eea-265933d12875",
"name": "Untitled",
"icon": "aws-fargate"
},
{
"id": "a1ed08ab-132f-4ff7-a1c2-d38230247825",
"name": "Untitled",
"icon": "aws-fargate"
},
{
"id": "27be9827-a532-4609-b614-f30e4efcdf95",
"name": "Untitled",
"icon": "aws-fargate"
},
{
"id": "9bb80713-a772-4f83-91fc-601f2dcb28ff",
"name": "Fargate App",
"icon": "aws-fargate"
},
{
"id": "0ae068c4-facb-44dd-91de-69d9da666a02",
"name": "Transit Gateway",
"icon": "aws-transit-gateway"
},
{
"id": "e68510d5-b041-4977-9f35-aae10c4080c7",
"name": "Internet Gateway",
"icon": "aws-transit-gateway"
}
],
"views": [
{
"name": "Untitled view",
"items": [
{
"labelHeight": 60,
"id": "e68510d5-b041-4977-9f35-aae10c4080c7",
"tile": {
"x": 0,
"y": 0
}
},
{
"labelHeight": 60,
"id": "0ae068c4-facb-44dd-91de-69d9da666a02",
"tile": {
"x": 4,
"y": 0
}
},
{
"labelHeight": 60,
"id": "9bb80713-a772-4f83-91fc-601f2dcb28ff",
"tile": {
"x": 2,
"y": -1
}
},
{
"labelHeight": 60,
"id": "591dd928-032e-4087-9bee-c0807d68692c",
"tile": {
"x": 2,
"y": 1
}
}
],
"connectors": [
{
"id": "41eb16d9-e4df-48d0-a24a-0ff0c0669547",
"color": "blue",
"anchors": [
{
"id": "f432fcd2-bb8c-40a4-838a-b13d069ef240",
"ref": {
"item": "e68510d5-b041-4977-9f35-aae10c4080c7"
}
},
{
"id": "f9a86511-c9ed-4ef2-8526-6253c16080e0",
"ref": {
"tile": {
"x": -4,
"y": 0
}
}
}
],
"width": 10,
"labels": [
{
"id": "17f2588c-261f-46d4-b8c4-ebeb351e6de5",
"text": "Public Traffic",
"position": 50,
"height": 0,
"line": "1",
"showLine": true
}
],
"customColor": "",
"style": "SOLID",
"lineType": "SINGLE",
"showArrow": false,
"path": {
"tiles": [
{
"x": 1,
"y": 1
},
{
"x": 2,
"y": 1
},
{
"x": 3,
"y": 1
},
{
"x": 4,
"y": 1
},
{
"x": 5,
"y": 1
},
{
"x": 6,
"y": 1
}
],
"rectangle": {
"from": {
"x": 1,
"y": 1
},
"to": {
"x": -6,
"y": -1
}
}
}
},
{
"id": "d05c813f-3d65-4f7e-92b6-82f1d5e1ce94",
"color": "blue",
"anchors": [
{
"id": "e8b5173b-a0c3-42b8-bf4f-b4157c08f996",
"ref": {
"item": "9bb80713-a772-4f83-91fc-601f2dcb28ff"
}
},
{
"id": "ca3b7f6d-057c-45fb-948b-bf7f9a67b297",
"ref": {
"item": "e68510d5-b041-4977-9f35-aae10c4080c7"
}
}
]
},
{
"id": "15a26706-a99d-4cad-89fc-c2a8e0c0e7f8",
"color": "blue",
"anchors": [
{
"id": "95d91c7d-54bc-47de-a1f7-53513a73b508",
"ref": {
"item": "591dd928-032e-4087-9bee-c0807d68692c"
}
},
{
"id": "69f3af6a-ec9b-467a-97c5-c09e246c68bf",
"ref": {
"item": "e68510d5-b041-4977-9f35-aae10c4080c7"
}
}
]
},
{
"id": "c55b0f44-83bd-4d5e-a57a-4dba92c93abf",
"color": "blue",
"anchors": [
{
"id": "e5e90d5c-d3c9-4b56-8118-4e35d397d9fe",
"ref": {
"item": "0ae068c4-facb-44dd-91de-69d9da666a02"
},
"ordering": 0
},
{
"id": "723a27b2-dc67-4349-993c-d2b18372e243",
"ref": {
"tile": {
"x": 8,
"y": 0
}
},
"ordering": 5
},
{
"id": "e62af38e-7566-4057-a7b5-ad2dc965e5d6",
"ref": {
"tile": {
"x": 11,
"y": 0
}
},
"ordering": 8
}
],
"width": 10,
"labels": [
{
"id": "f8c0fde6-3926-495e-bdcf-9afb78a1b55d",
"text": "Internal Traffic",
"position": 50,
"height": 0,
"line": "1"
}
],
"customColor": "",
"style": "SOLID",
"lineType": "SINGLE",
"showArrow": false,
"path": {
"tiles": [
{
"x": 9,
"y": 1
},
{
"x": 8,
"y": 1
},
{
"x": 7,
"y": 1
},
{
"x": 6,
"y": 1
},
{
"x": 5,
"y": 1
},
{
"x": 5,
"y": 1
},
{
"x": 4,
"y": 1
},
{
"x": 3,
"y": 1
},
{
"x": 2,
"y": 1
},
{
"x": 1,
"y": 1
}
],
"rectangle": {
"from": {
"x": 13,
"y": 1
},
"to": {
"x": 3,
"y": -1
}
}
}
},
{
"id": "156171ce-9951-4fec-94d3-c06fddf2eab0",
"color": "blue",
"anchors": [
{
"id": "b451b5c5-a3d5-4b88-9917-1b2e5ecf9eaa",
"ref": {
"item": "9bb80713-a772-4f83-91fc-601f2dcb28ff"
}
},
{
"id": "46e92e30-2ce4-4e79-97af-2cfe9f570a31",
"ref": {
"item": "0ae068c4-facb-44dd-91de-69d9da666a02"
}
}
]
},
{
"id": "ff3bb2b4-a3fa-46da-86cd-2440edb3d7b0",
"color": "blue",
"anchors": [
{
"id": "44543bd8-8af1-4b0c-bf68-22d9b35004bf",
"ref": {
"item": "591dd928-032e-4087-9bee-c0807d68692c"
}
},
{
"id": "ffd9c5d4-9a3a-48c7-b4d0-52a05ec3128a",
"ref": {
"item": "0ae068c4-facb-44dd-91de-69d9da666a02"
}
}
]
}
],
"rectangles": [
{
"id": "90669139-366c-47a0-88d7-13f3321b6543",
"color": "green",
"from": {
"x": 11,
"y": 3
},
"to": {
"x": 12,
"y": -2
},
"customColor": ""
},
{
"id": "89a02ac1-7abd-4617-b8df-464af41434b9",
"color": "blue",
"from": {
"x": -5,
"y": 1
},
"to": {
"x": -4,
"y": -1
}
},
{
"id": "33d9ef01-b349-40c7-a12a-332e50e5846f",
"color": "blue",
"from": {
"x": 8,
"y": 3
},
"to": {
"x": 9,
"y": -2
}
},
{
"id": "e1c3fab3-f6ef-45f6-9927-57e385a42fde",
"color": "gray",
"from": {
"x": 5,
"y": 3
},
"to": {
"x": -1,
"y": -2
},
"customColor": "#9daa4d"
},
{
"id": "1ca6ec95-d9b2-430f-8e66-f6ead1894f4c",
"color": "blue",
"from": {
"x": 6,
"y": 4
},
"to": {
"x": -2,
"y": -3
},
"customColor": "#6675a9"
}
],
"textBoxes": [
{
"orientation": "Y",
"fontSize": 0.3,
"content": "Other AWS Accounts",
"id": "f92459eb-ddbe-414f-a17c-704421887aca",
"tile": {
"x": 12,
"y": 3
}
},
{
"orientation": "X",
"fontSize": 0.3,
"content": "Internet",
"id": "a798f301-d6bb-4c6c-9e0d-5547d421588f",
"tile": {
"x": -5,
"y": 1
}
},
{
"orientation": "Y",
"fontSize": 0.3,
"content": "Networking Account",
"id": "638b0ab5-e68b-41b4-aa2c-673858e1aee0",
"tile": {
"x": 9,
"y": 3
}
},
{
"orientation": "Y",
"fontSize": 0.3,
"content": "VPC",
"id": "bcf65eda-6130-4007-b6de-9e23fa4c31fd",
"tile": {
"x": 5,
"y": 3
}
},
{
"orientation": "Y",
"fontSize": 0.3,
"content": "AWS Account",
"id": "3f8e0643-6bec-4364-9411-1e9c80fc4154",
"tile": {
"x": 6,
"y": 4
}
}
],
"id": "67a0586b-d79a-497f-8888-64869cbb0885",
"lastUpdated": "2025-10-20T15:19:35.208Z"
}
],
"fitToScreen": true
}
Using the network setup from an application
This construct does a lookup of the network setup created.
Usage Example
import { StatistaNetwork } from '@pit-shared/cdk/network/lookup'
declare const scope: import('aws-cdk-lib').Stack
// ... this is inside the stack the network should be used in ...
// to look up the network multiple times, use a different identifier
// as the second parameter to avoid errors with the CDK
const network = new StatistaNetwork(scope, 'network')
network.vpc
network.privateSubnets
network.publicSubnets
network.internetGateway
To customize the setup behavior extend the class and override the necessary methods.
API
/**
* The VPC ID to use for network lookup
*/
vpcId?: string
/**
* The Internet Gateway ID to use for network lookup
*/
internetGatewayId?: string
Creating the network setup
[!NOTE]
The network setup can only be done once per account. Once it's done, you don't have to rerun it.
There are two ways to create the network setup.
- Using cdk-remix-setup
- Use the construct manually
The cdk-remix-setup tool
This is a tool to run different setup steps in your AWS account. One of it is the network setup. It's a guided approach.
The construct
This construct creates a networking setup and the Network Account integration for Statista.
It adds an InternetGateway to your account, attaches it to your VPC, and configures the necessary RouteTable entries to handle incoming and outgoing traffic for the specified subnets.
Usage Example
import { StatistaNetwork } from '@pit-shared/cdk/network'
declare const scope: import('aws-cdk-lib').Stack
new StatistaNetwork(scope, 'StatistaNetwork', {
vpcId: 'your-vpc-id',
transitGatewayId: 'your-transit-gateway-id',
})
To customize the setup behavior extend the class and override the necessary methods.
API
/**
* The VPC ID to use for network setup
*/
vpcId: string
/**
* The Transit Gateway ID to use for network setup
*/
transitGatewayId: string