Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

OpenTofu (AWS)

AWS infrastructure is provisioned with OpenTofu (open-source Terraform fork) in infra/aws/tofu/.

Resources

FileResources
vpc.tfVPC, public/private subnets, IGW, conditional NAT, S3 VPC endpoint
security.tfBastion SG (SSH from WARP CGNAT), RKE2 cluster SG
ec2.tfUbuntu 24.04 AMI, SSH key pair, bastion, control plane, workers
s3.tfEncrypted data bucket with public access blocked
outputs.tfBastion IP, node IPs, SSH key path, S3 bucket name

Network Architecture

Air-Gap Mode

Setting airgap_mode = true in terraform.tfvars:

  • Removes the NAT gateway (no outbound internet from private subnet)
  • S3 access preserved via VPC gateway endpoint
  • All software must be pre-staged via Zarf packages

Variables

Key variables in variables.tf:

VariableDefaultDescription
projectsignals-360Resource naming prefix
aws_regionus-east-1AWS region
control_plane_count1Number of control plane nodes
worker_count4Number of worker nodes
worker_instance_typer6i.xlargeWorker EC2 instance type
data_volume_size100Worker data volume (GB)
allowed_ssh_cidrs100.96.0.0/12WARP CGNAT range for SSH
airgap_modefalseEnable air-gap (no NAT)

Usage

cd infra/aws/tofu

# Initialize
tofu init

# Plan with policy check
tofu plan -out=plan.tfplan
conftest test plan.tfplan -p ../../policy/tofu/

# Apply
tofu apply plan.tfplan

# Outputs for Ansible inventory
tofu output -json