gitlab_pages_domain (Resource)

The gitlab_pages_domain resource allows connecting custom domains and TLS certificates in GitLab Pages.

Upstream API: GitLab REST API docs

Example Usage

# Example using auto_ssl_enabled, which uses lets encrypt to generate a certificate
resource "gitlab_pages_domain" "this" {
  project = 123
  domain  = "example.com"

  auto_ssl_enabled = true
}

# Example using a manually generated certificate and key
resource "gitlab_pages_domain" "this" {
  project = 123
  domain  = "example.com"

  key         = file("${path.module}/key.pem")
  certificate = file("${path.module}/cert.pem")
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

# GitLab pages domain can be imported using an id made up of `projectId:domain` _without_ the http protocol, e.g.
terraform import gitlab_pages_domain.this 123:example.com