Skip to content

Networking

All applications in an environment share a common network (VPC).

The default VPC for your environment set up by this guide is: {Environment}

Step 1: Create a new configuration file

Create a new configuration file for networking:

repo-iac/environments/dev/_config/networking.yml
StackName: "networking"
VpcEndpoints:
  Enable: false
  Ecr: false
  Dkr: false
  Logs: false
  SsmMessages: false
  Prometheus: false
  Ssm: false
  S3: false
  Xray: false

The VpcEndpoints section is used to enable or disable VPC endpoints for the current network. The default value is false for all services. To enable a VPC endpoint, set the value to true.

Step 2: Add and install the networking package

Run the following command in the repo-iac/environments/dev/ directory:

repo-iac/environments/dev/
ok pkg add networking

This will add the package you want to install to packages.yml. If you want to know more about how this works, read the reference documentation for packages.yml.

Then, run the following command to install the package:

repo-iac/environments/dev/
ok pkg install networking

Step 3: Initialize and apply the networking stack

repo-iac/environments/dev
cd networking/
terraform init
terraform apply

Step 4: Verify

Run the following command:

aws ec2 describe-vpcs | jq '.Vpcs[].Tags[] | select(.Key == "Name") | .Value'

The output list should contain the name of the VPC you just created.

Login to the AWS console and navigate to VPC. Select Your VPCs in the left-hand menu.

The list should contain the name of the VPC you just created.


Commit your files

At this stage it is a good idea to commit your files.

Next step

Set up databases.