This guide demonstrates a leaf-to-cloud deployment of the Window example introduced in demo1. It walks you through deploying the Window example from demo1 to the cloud using AWS EC2 and Docker. You’ll set up the required infrastructure, build and deploy Docker images, and connect your Zonal Controller and Mobile Application to the cloud Routing Service.
- Goal: Run the Routing Service in the cloud (AWS EC2) to relay data between Zonal Controller and Mobile Application.
- New Components:
- Routing Service (in the cloud)
- Real-Time WAN (RTWAN) Transport for WAN communication
- Complete demo1 and understand its setup.
- Docker installed locally.
- AWS account with CLI configured.
- Terraform installed.
- Permissions to create AWS resources (EC2, S3, DynamoDB).
- Docker Hub (or other registry) account.
- RTI license file (do not include in Docker image).
docker build -t {yourDockerRegistry}/aee .
docker push {yourDockerRegistry}/aeeReplace {yourDockerRegistry} with your Docker Hub username or registry path.
Edit the terraform block in the provided script to use your own S3 bucket and DynamoDB table.
terraform {
required_version = ">= 1.3.0"
backend "s3" {
bucket = "your-own-terraform-backend-bucket"
key = "Automotive-easy-example/backend-state"
region = "us-east-1" # or your preferred region
dynamodb_table = "terraform-locks"
encrypt = true
}
}ssh-keygen -t rsa -b 2048 -f ~/.ssh/id_rsa_terraform -N ""export AWS_ACCESS_KEY_ID="YOUR_ACCESS_KEY"
export AWS_SECRET_ACCESS_KEY="YOUR_SECRET_KEY"
export AWS_SESSION_TOKEN="YOUR_SESSION_TOKEN" # if neededcd terraform-infrastructure
terraform init
terraform apply -var="dockerhub_username=your_dockerhub_username" \
-var="dockerhub_password=your_dockerhub_password" \
-var="rti_license_path=your_rti_license_path"Get the public IP:
terraform outputSSH into the instance:
ssh -i "~/.ssh/id_rsa_terraform" -p 2222 ubuntu@<public_ip>On the EC2 instance, run:
sudo docker run --rm -it -p 80:8080/udp -p 90:8090/udp --name rs \
-e eip01_eip=<public_ip> \
-v $PWD/rti_license.dat:/opt/rti.com/rti_connext_dds-7.3.0/rti_license.dat \
{yourDockerRegistry}/aee \
-cfgFile RSConfig.xml -cfgName example_WanT -verbosity 5Replace <public_ip> and {yourDockerRegistry} as needed.
- Export the EC2 public IP:
export eip01_eip=<public_ip>- Start local Routing Service:
$NDDSHOME/bin/rtiroutingservice -cfgFile RSConfig.xml -cfgName example_WanZonalInternal- Run the Zonal Controller (see main README).
- Export the EC2 public IP:
export eip01_eip=<public_ip>- Start local Routing Service:
$NDDSHOME/bin/rtiroutingservice -cfgFile RSConfig.xml -cfgName example_WanUiInternal- Run the Mobile Application:
python user_interface/application.py --mode mobileapp --domain_id=1- Build and push Docker image.
- Deploy AWS infrastructure with Terraform.
- Run Routing Service in the cloud.
- Connect Zonal Controller and Mobile Application via the cloud Routing Service.