virtuOSo docs v0.8.1

AWS provider

Setup steps

The AWS provider lets you launch EC2 instances from the same Apps page as your on-prem VMs. All apps (Compute, Docker, Kubernetes, PostgreSQL, MySQL and Gitea) work on both providers.

1
Create an IAM User or Role

Configure AWS permissions so virtuOSo can manage EC2 resources, create VPCs, and run SSM commands.

2
Configure AWS in Settings

Go to Settings > AWS and enter your Access Key ID, Secret Access Key, and default region.

3
Launch an App on AWS

Go to any app page, select AWS as the provider, and choose a region. virtuOSo automatically creates a VPC with public subnets if one doesn't exist. Configure firewall rules and launch.

IAM Role Setup

virtuOSo needs the following AWS permissions to manage EC2 resources. Create an IAM user (for access keys) or role with this policy attached.

Required IAM Policy

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "VirtuOSoEC2",
            "Effect": "Allow",
            "Action": [
                "ec2:RunInstances",
                "ec2:TerminateInstances",
                "ec2:DescribeInstances",
                "ec2:DescribeVpcs",
                "ec2:CreateVpc",
                "ec2:ModifyVpcAttribute",
                "ec2:DescribeSubnets",
                "ec2:CreateSubnet",
                "ec2:ModifySubnetAttribute",
                "ec2:DescribeSecurityGroups",
                "ec2:DescribeNetworkInterfaces",
                "ec2:CreateSecurityGroup",
                "ec2:DeleteSecurityGroup",
                "ec2:AuthorizeSecurityGroupIngress",
                "ec2:RevokeSecurityGroupIngress",
                "ec2:CreateInternetGateway",
                "ec2:AttachInternetGateway",
                "ec2:DescribeInternetGateways",
                "ec2:DescribeRouteTables",
                "ec2:CreateRoute",
                "ec2:DescribeAvailabilityZones",
                "ec2:CreateTags",
                "ec2:DescribeImages"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:RequestedRegion": ["us-east-1","us-east-2","us-west-1","us-west-2"]
                }
            }
        },
        {
            "Sid": "VirtuOSoLifecycleAndSnapshotCleanup",
            "Effect": "Allow",
            "Action": [
                "ec2:StartInstances",
                "ec2:StopInstances",
                "ec2:DeleteSnapshot"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:ResourceTag/ManagedBy": "virtuoso",
                    "aws:RequestedRegion": ["us-east-1","us-east-2","us-west-1","us-west-2"]
                }
            }
        },
        {
            "Sid": "VirtuOSoSnapshotsAndRestore",
            "Effect": "Allow",
            "Action": [
                "ec2:DescribeRegions",
                "ec2:DescribeVolumes",
                "ec2:CreateSnapshot",
                "ec2:DescribeSnapshots",
                "ec2:CreateReplaceRootVolumeTask",
                "ec2:DescribeReplaceRootVolumeTasks"
            ],
            "Resource": "*",
            "Condition": {
                "StringEquals": {
                    "aws:RequestedRegion": ["us-east-1","us-east-2","us-west-1","us-west-2"]
                }
            }
        },
        {
            "Sid": "VirtuOSoSSMParameters",
            "Effect": "Allow",
            "Action": ["ssm:GetParameter"],
            "Resource": [
                "arn:aws:ssm:*:*:parameter/aws/service/canonical/*",
                "arn:aws:ssm:*:*:parameter/aws/service/ami-amazon-linux-latest/*",
                "arn:aws:ssm:*:*:parameter/aws/service/debian/*"
            ]
        },
        {
            "Sid": "VirtuOSoSSMRunCommand",
            "Effect": "Allow",
            "Action": ["ssm:SendCommand"],
            "Resource": [
                "arn:aws:ec2:*:*:instance/*",
                "arn:aws:ssm:*::document/AWS-RunShellScript"
            ]
        },
        {
            "Sid": "VirtuOSoSSMCommandResults",
            "Effect": "Allow",
            "Action": ["ssm:GetCommandInvocation"],
            "Resource": "*"
        },
        {
            "Sid": "VirtuOSoInstanceRole",
            "Effect": "Allow",
            "Action": [
                "iam:CreateRole",
                "iam:TagRole",
                "iam:CreateInstanceProfile",
                "iam:TagInstanceProfile",
                "iam:AddRoleToInstanceProfile",
                "iam:GetInstanceProfile"
            ],
            "Resource": [
                "arn:aws:iam::*:role/virtuoso-instance",
                "arn:aws:iam::*:instance-profile/virtuoso-instance"
            ]
        },
        {
            "Sid": "VirtuOSoAttachSSMPolicy",
            "Effect": "Allow",
            "Action": ["iam:AttachRolePolicy"],
            "Resource": "arn:aws:iam::*:role/virtuoso-instance",
            "Condition": {
                "ArnEquals": {
                    "iam:PolicyARN": "arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore"
                }
            }
        },
        {
            "Sid": "VirtuOSoPassRole",
            "Effect": "Allow",
            "Action": ["iam:PassRole"],
            "Resource": "arn:aws:iam::*:role/virtuoso-instance",
            "Condition": {
                "StringEquals": {
                    "iam:PassedToService": "ec2.amazonaws.com"
                }
            }
        }
    ]
}
Schedules, snapshots and restore. The two statements named VirtuOSoLifecycleAndSnapshotCleanup and VirtuOSoSnapshotsAndRestore are only needed to start and stop instances on a schedule, take EBS snapshots, and restore them. Starting, stopping and deleting snapshots are limited to resources tagged ManagedBy=virtuoso, which virtuOSo adds to everything it creates, so these permissions cannot touch other instances in the account. If an action is refused, virtuOSo names the permission that is missing.
Note: Adjust the region list under aws:RequestedRegion to match the regions you plan to use. The IAM permissions are limited to one role and one instance profile, both named virtuoso-instance, which virtuOSo creates so your EC2 instances can use SSM. The only policy it can attach to that role is AmazonSSMManagedInstanceCore, and the role can only be passed to EC2, so these keys cannot be used to grant themselves wider access. ec2:DescribeNetworkInterfaces lets virtuOSo check that a security group is unused before removing it.

VPC Setup

virtuOSo automatically creates a VPC when you select a region with no VPCs. The auto-created VPC (virtuoso-vpc) includes:

  • CIDR 10.0.0.0/16 with DNS hostnames enabled
  • 2 public subnets across 2 availability zones (10.0.1.0/24, 10.0.2.0/24)
  • Internet gateway with default route
  • Auto-assign public IPs on both subnets

You can also pre-create VPCs from Settings > AWS > Setup VPC, or use an existing VPC. Just select it in the create form dropdown.

Cost note: VPCs, subnets, internet gateways, and route tables have no hourly charges. You only pay for EC2 instances.
Manual VPC creation (AWS CLI)

If you prefer to create the VPC manually or need a custom configuration:

# Set your region
REGION=us-east-1

# 1. Create the VPC
VPC_ID=$(aws ec2 create-vpc \
    --cidr-block 10.0.0.0/16 \
    --region $REGION \
    --tag-specifications 'ResourceType=vpc,Tags=[{Key=Name,Value=virtuoso-vpc}]' \
    --query 'Vpc.VpcId' --output text)

aws ec2 modify-vpc-attribute --vpc-id $VPC_ID \
    --enable-dns-hostnames '{"Value":true}' --region $REGION

# 2. Create internet gateway
IGW_ID=$(aws ec2 create-internet-gateway --region $REGION \
    --tag-specifications 'ResourceType=internet-gateway,Tags=[{Key=Name,Value=virtuoso-igw}]' \
    --query 'InternetGateway.InternetGatewayId' --output text)
aws ec2 attach-internet-gateway --vpc-id $VPC_ID \
    --internet-gateway-id $IGW_ID --region $REGION

# 3. Create 2 public subnets
SUBNET_A=$(aws ec2 create-subnet --vpc-id $VPC_ID --cidr-block 10.0.1.0/24 \
    --availability-zone ${REGION}a --region $REGION \
    --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=virtuoso-public-1a}]' \
    --query 'Subnet.SubnetId' --output text)
SUBNET_B=$(aws ec2 create-subnet --vpc-id $VPC_ID --cidr-block 10.0.2.0/24 \
    --availability-zone ${REGION}b --region $REGION \
    --tag-specifications 'ResourceType=subnet,Tags=[{Key=Name,Value=virtuoso-public-1b}]' \
    --query 'Subnet.SubnetId' --output text)

# 4. Enable auto-assign public IPs and add a default route to the internet gateway
for SUBNET in $SUBNET_A $SUBNET_B; do
  aws ec2 modify-subnet-attribute --subnet-id $SUBNET --map-public-ip-on-launch --region $REGION
done
RTB_ID=$(aws ec2 create-route-table --vpc-id $VPC_ID --region $REGION \
    --tag-specifications 'ResourceType=route-table,Tags=[{Key=Name,Value=virtuoso-public-rt}]' \
    --query 'RouteTable.RouteTableId' --output text)
aws ec2 create-route --route-table-id $RTB_ID --destination-cidr-block 0.0.0.0/0 \
    --gateway-id $IGW_ID --region $REGION
for SUBNET in $SUBNET_A $SUBNET_B; do
  aws ec2 associate-route-table --route-table-id $RTB_ID --subnet-id $SUBNET --region $REGION
done

Launching Instances on AWS

When AWS is configured, all app create forms show a Provider dropdown. Select AWS to see the AWS-specific fields:

  • Region: AWS region to launch in (defaults to your configured region)
  • VPC: dynamically loaded from your AWS account
  • Subnet: dynamically loaded based on selected VPC
  • Instance Type: the EC2 instance type. The app forms offer t3.micro, t3.small, t3.medium (the default), t3.large, t3.xlarge and t3.2xlarge. The Launch on AWS form on the Launch VM and Fleet pages also offers m5.2xlarge and m5.4xlarge, and shows an hourly price for each type
  • Firewall Rules: per-instance security group rules:
    • My IP: auto-detected, restricts access to your current IP
    • Custom CIDR: any IP range (e.g. 10.0.0.0/8)
    • Public: open to the world (0.0.0.0/0)

SSH port 22 is included by default. virtuOSo automatically creates per-instance and per-user security groups to isolate traffic.

Instance types: when a VM is launched with a virtuOSo size on AWS, the size picks the EC2 type: micro is t3.micro, small is t3.small, medium is t3.medium, large is t3.large, xlarge is t3.xlarge, 2xlarge is t3.2xlarge, 3xlarge is m5.2xlarge and 4xlarge is m5.4xlarge. You can also name an EC2 type directly.

Tailscale on AWS

When Tailscale is configured in Settings > Tailscale, AWS instances automatically join your tailnet with Tailscale SSH enabled. This lets you SSH into cloud instances without managing SSH keys or opening additional ports.

Tailscale SSH ACL Policy

Add this to your Tailscale ACL policy to enable SSH:

"ssh": [
    {
        "action": "accept",
        "src":    ["autogroup:member"],
        "dst":    ["autogroup:self"],
        "users":  ["autogroup:nonroot", "root"]
    }
]

This rule suits instances that join with an auth key owned by a person. Instances that join as tagged devices, which an OAuth client secret requires, are not covered by autogroup:self. For those, put the tag in dst instead, as shown in Tailscale on VMs.

Instances register with the hostname format <username>-<app>-<instance> (e.g. admin-compute-webserver).

Tip: With Tailscale, you can use private subnets (no internet gateway) and still reach your instances securely through the tailnet.

SSH Access

AWS instances support two SSH methods:

MethodCommandRequires
Tailscale SSHssh ubuntu@<TAILSCALE_IP>Tailscale configured + ACL policy
Standard SSHssh ubuntu@<PUBLIC_IP>Port 22 open in firewall rules

virtuOSo's SSH public key is automatically injected into AWS instances, so SSH from the virtuOSo host works without additional key setup.

Default SSH usernames by OS:

Operating SystemUsername
Ubuntu 26.04 LTSubuntu
Ubuntu 24.04 LTSubuntu
Ubuntu 22.04 LTSubuntu
Amazon Linux 2023ec2-user

Kubernetes on AWS

The Kubernetes app works on AWS the same as on-prem. Select AWS as the provider when creating a cluster, and k3s will be installed on EC2 instances.

Worker Nodes on AWS

Workers can be added at creation time or scaled up/down from the cluster detail page. Each worker is a separate EC2 instance in the same VPC. Workers join the cluster automatically via k3s and are drained before removal when scaling down.

Kubeconfig

Download the kubeconfig from the cluster detail page. The server IP in the kubeconfig is set to the instance's IP. If connecting via public IP, ensure port 6443 is open in your firewall rules.

Tip: With Tailscale, you can access the K8s API via the Tailscale IP without opening port 6443 publicly.