VPC peering
At installation time, RunsOn created a new VPC and subnets in the region you selected. Sometimes, you have existing (private) resources in another VPC, and you want to be able to reach them from the runners launched by RunsOn (e.g. Kubernetes cluster, internal services, etc.).
This is where VPC peering comes into play.

AWS provides a (free) service called VPC peering ↗ that allows you to connect two VPCs together. Until v2.5.0 you had to do this manually or with something like Terraform, but RunsOn now provides a CloudFormation template that you can use to set up VPC peering between RunsOn’s VPC and your existing VPC.
Select the region
To get started, simply select the region where your existing RunsOn stack resides.
This will redirect you to the CloudFormation interface:
Fill in the CloudFormation stack parameters
The CloudFormation stack accepts 3 parameters:

-
RunsOnStackName:
- Type: String
- Description: “Name of the existing CloudFormation stack for RunsOn.”
- Default: “runs-on”
-
DestinationVpcId:
- Type: AWS::EC2::VPC::Id
- Description: “ID of the destination VPC to peer with.”
-
DestinationVpcCidr:
- Type: String
- Description: “CIDR block of the destination VPC.”
- Default: “10.0.0.0/16”
Once you have filled in the parameters, you can click on the “Create stack” button to create the stack. It will add the necessary routes to your existing RunsOn VPC to allow the runners to reach your private resources.
Create a route back to RunsOn VPC in your existing VPC
The only manual step left is to create a route in the route tables of your existing VPC so that traffic can flow back from your private resources to the runners in RunsOn VPC:

If you wanted to automate the route creation (e.g. with Terraform or a script), you can use the following output parameters exposed by the CloudFormation stacks:
RunsOnVpcPeeringConnectionId
, exposed by the VPC peering stack.RunsOnVpcCidrBlock
, exposed by the RunsOn stack.
As an example, you can then use the following AWS CLI command to create the route:
aws ec2 create-route --route-table-id <your-route-table-id> --destination-cidr-block <runs-on-vpc-cidr-block> --vpc-peering-connection-id <vpc-peering-connection-id>