# Cloud workstations (GCP, AWS, Azure)

> For the complete documentation index, see [llms.txt](https://docs-stg.ringleader.dev/llms.txt).


> A cloud workstation runs as a virtual machine in your organization's cloud account: a Compute Engine VM, an Azure VM or an EC2 instance.


A cloud workstation runs as a virtual machine in your organization's cloud account: a Compute
Engine VM, an Azure VM or an EC2 instance. You choose its size, and a namespace
administrator decides where it goes and how it connects.

## Cloud workstation requirements

A cloud workstation needs three things before Ringleader can create it:

- Your organization's cloud account set up for Ringleader, as
  [Cloud accounts](https://docs-stg.ringleader.dev/cloud-accounts/) describes.
- A namespace on Ringleader. Log in with `rl auth login` first. The `local` namespace stays on
  your computer, so create the workstation in another one, as
  [Wait behavior](https://docs-stg.ringleader.dev/reference/cli/commands/imperative-creation/#wait-behavior) explains.
- A [CloudIdentity](https://docs-stg.ringleader.dev/reference/resources/cloudidentity/) in that namespace whose selector
  matches the workstation's labels. A namespace administrator creates it.

`--provider` adds no label to the workstation. The examples on this site label it
`cloud: gcp`, which matches the CloudIdentity examples, which select `cloud: gcp`. Without a
matching label the workstation fails, and `--wait` reports the failure.

## Keys you set and keys an administrator sets

A cloud workstation's `providerConfig.<cloud>` block has two kinds of key:

- You set the keys that size and shape the virtual machine, label it, or ask for a public
  address.
- A namespace administrator sets every key that places the virtual machine or shapes its
  network. They set it on the CloudIdentity that selects your workstation, in its
  `defaultProviderConfig` or `overrideProviderConfig`.

[Keys a namespace member may set](https://docs-stg.ringleader.dev/reference/providers/images-keys/#keys-a-namespace-member-may-set) lists the keys
you may set for each cloud. If that is all you need, you are done: size the workstation and let
the CloudIdentity place it.

If you write any other key, Ringleader refuses the write. It also refuses a key the list
doesn't name, and a key spelled with different capitals. The refusal names the cloud, the key
and the places that set it:

```text
Workstation dev/cloud-box sets providerConfig key(s) a namespace member may not set (gcp zone).
A namespace admin sets them on a CloudIdentity's spec.defaultProviderConfig or
spec.overrideProviderConfig, or holds the cloudconfig right on workstations and may set them here
```

Ringleader refuses only a write that adds or changes one of those keys. A workstation that
already carries one keeps it, so stopping, starting and restarting it still work, and so does
removing the key. Naming a placement key with a `null` counts as setting it, because it would
erase the CloudIdentity's value. Ringleader judges a
WorkstationPool the same way when you write it, on its template. There, only the `cloudconfig` verb counts, because a Grant names one
workstation. The fields of a pool are in
[WorkstationPool and WorkstationPoolLease](https://docs-stg.ringleader.dev/reference/resources/workstationpool/).

[Placement delegation](https://docs-stg.ringleader.dev/cloud-accounts/cloud-identities/placement-delegation/) says what changes who may set a key: the `cloudconfig` right, and the CloudIdentity's `allow` and `deny` lists.

The key that names the virtual machine's runtime identity is the one exception to all three.
Nobody sets it on a workstation, and the CloudIdentity sets it, as the
[Provider images and keys](https://docs-stg.ringleader.dev/reference/providers/images-keys/) page says for each cloud.

## GCP workstations

The `gcp` provider creates a Compute Engine VM. Ringleader signs in to GCP through the
CloudIdentity, using its `cloudAccountRef`. The CloudIdentity usually supplies `project` and
`zone` through its `overrideProviderConfig`, so the workstation needs only the keys that size
it.

The in-VM agent owns the workstation's `authorized_keys`, on GCP as on every provider. GCP
doesn't write `ssh-keys` instance metadata. Who may connect over SSH depends only on who owns
the workstation and on [Grants](https://docs-stg.ringleader.dev/reference/resources/grant/).

## Azure workstations

The `azure` provider creates a VM in one resource group, and signs in through a CloudIdentity
as the `gcp` provider does. Ringleader creates a network interface for each VM in the subnet the
CloudIdentity names, and deletes it with the VM. So the CloudIdentity needs a `subnetId`,
unless it names an existing network interface instead.

The CloudIdentity carries the placement, as the Azure example under
[Per-organization federation](https://docs-stg.ringleader.dev/reference/resources/cloudidentity/#per-organization-federation)
in the CloudIdentity reference shows.

## AWS workstations

The `aws` provider creates an EC2 instance, and signs in through a CloudIdentity as the `gcp`
and `azure` providers do. [Onboard AWS](https://docs-stg.ringleader.dev/guides/onboard-aws/) covers the
IAM role to create in your account. The CloudIdentity carries the region, the subnet and the
security groups, as the AWS example under
[Per-organization federation](https://docs-stg.ringleader.dev/reference/resources/cloudidentity/#per-organization-federation)
shows.

### AWS availability zones

A namespace administrator sets `zone`, which places the instance in an availability zone. What
it does depends on the subnet:

- With a `subnetId`, the instance takes the subnet's zone, so `zone` is a check. If `zone`
  isn't the subnet's zone, Ringleader refuses the instance before creating it, and the message
  names the subnet's zone.
- With no `subnetId`, EC2 picks a subnet of the region's default VPC in that zone.

Ringleader also refuses a zone outside `region`. If you change `zone` on an existing
workstation, the workstation fails, and its instance keeps running. To move a workstation to
another zone, delete it and create it again.

### AWS security groups

A namespace administrator names security groups by ID in `securityGroupIds`, by name in
`securityGroupNames`, or both. The instance gets every group either list names. Ringleader looks
up a name in the VPC of the workstation's subnet, or in the region's default VPC when there is
no `subnetId`. A group name is unique only within one VPC. If a name contains `*` or
`?`, or the VPC has no group of that name, Ringleader refuses the instance before creating it.

Ringleader reads both lists only when it creates the instance. Editing either on an existing
workstation changes nothing, so to change a workstation's groups, delete it and create it again.

If neither list names a group, the instance gets the VPC's default security group, beside the
SSH security group Ringleader creates. What the default group must allow depends on whether the
workstation has an egress policy:

- With no egress policy, the workstation needs outbound access to finish setting up. If the
  default group has no outbound rule, Ringleader refuses the create. The message says to set
  `securityGroupIds` to a group that allows outbound traffic.
- With an egress policy (see
  [outbound restrictions](https://docs-stg.ringleader.dev/security/outbound/outbound-restrictions/)),
  the default group must have no outbound rule, like every other group beside the policy's own.
  [Security groups on AWS](https://docs-stg.ringleader.dev/security/outbound/enforcement/#security-groups-on-aws)
  explains why.

A workstation can sit on a default group with no outbound rule. If you remove its egress
policy, it has no outbound access, and Ringleader logs a warning. Delete the workstation
and create it again with a group that allows outbound traffic.

## Cloud workstation reachability

`rl shell` connects to a cloud workstation directly over SSH, with no bastion and no tunnel. Ringleader writes a firewall rule that admits SSH to each workstation it creates, and a workstation takes a public address by default. [Cloud accounts and reachability](https://docs-stg.ringleader.dev/cloud-accounts/accounts-reachability/) covers the rule, the `SSHAdmissionMissing` and `PublicAddressChangeNotApplied` conditions, and the outbound route a workstation with no public address needs. A workstation behind an Edge is reached through a port on the Edge's virtual machine instead, as [Access to a workstation behind an Edge](https://docs-stg.ringleader.dev/security/outbound/edge-management/#access-to-a-workstation-behind-an-edge) explains.

## Create a cloud workstation

To create a cloud workstation from the command line, name its cloud and a label its
CloudIdentity selects:

```bash
rl workstation create my-cloud-box --provider gcp -l cloud=gcp -n dev --wait
```

To create one from a file, name the cloud in `spec.provider`, and set its size under
`providerConfig.<cloud>`:

```yaml
apiVersion: workstations.ringleader.dev/v1
kind: Workstation
metadata:
  name: my-cloud-box
  namespace: dev
  labels:
    cloud: gcp
spec:
  provider: gcp
  providerConfig:
    gcp:
      machineType: e2-standard-4
      diskGiB: 100
```

Then apply the file with `rl apply -f`. The workstation boots Debian 13, because it names no
image. For Azure, set `provider: azure` and size it with `size` and `osDiskGiB` under
`providerConfig.azure`. For AWS, set `provider: aws` and size it with `instanceType` and
`rootVolumeGiB` under `providerConfig.aws`.

## Make a cloud workstation private

To create a workstation with no public address, set its public address key to `false` when you create it. The key is `assignPublicIp` on GCP and AWS, and `publicIp` on Azure. [Turn off public addresses](https://docs-stg.ringleader.dev/cloud-accounts/accounts-reachability/#turn-off-public-addresses) shows the setting and the warning that it applies only at creation.

## Next steps

- [Provider images and keys](https://docs-stg.ringleader.dev/reference/providers/images-keys/) lists each cloud's images and
  `providerConfig` keys.
- [CloudIdentity](https://docs-stg.ringleader.dev/reference/resources/cloudidentity/) covers how an administrator sets
  where workstations go and which keys members may set.
- [Cloud accounts](https://docs-stg.ringleader.dev/cloud-accounts/) covers setting up your
  organization's cloud account, its network and its firewall rules.

