Skip to content

Create terraform code to setup workspaces infrastructure on AWS

MR: https://gitlab.com/gitlab-org/workspaces/examples/workspaces-infrastructure-setup-aws

Description

To make it easier for users to try out Workspaces, we should provide a terraform/opentofu code as a starting point.

For the scope of this issue, we will create a terraform/opentofu code for setting up Workspaces on AWS.

Acceptance criteria

Implementation plan

In order to run this OpenTofu code, the following are the prerequisites -

  1. Domain
  2. TLS Certificates for the following
    1. Domain where OAuth callback will be available. We call this GitLab Workspaces Proxy Domain.
    2. Wildcard domain where all workspaces will be abailable. We call this GitLab Workspaces Proxy Wildcard Domain.
  3. Signing key made up of random keys consisting of letters numbers and special chars.
  4. SSH host key.
  5. OAuth application.
  6. GitLab Agent for Kubernetes token

When you run this OpenTofu code, the following resources will be created in AWS -

  1. VPC
  2. EKS cluster
  3. GitLab Agent for Kubernetes Helm release
  4. GitLab Workspaces Proxy Helm release
  5. Ingress Nginx Helm release

When this OpenTofu code runs, it will output the following -

  1. Ingress Nginx Address - Update the DNS record of type A to point the GitLab Workspaces Proxy Domain and GitLab Workspaces Proxy Wildcard Domain to this address.
Edited by Vishal Tak