gitlab_project_environment (Resource)

The gitlab_project_environment resource allows to manage the lifecycle of an environment in a project.

Upstream API: GitLab REST API docs

Example Usage

resource "gitlab_group" "this" {
  name        = "example"
  path        = "example"
  description = "An example group"
}

resource "gitlab_project" "this" {
  name                   = "example"
  namespace_id           = gitlab_group.this.id
  initialize_with_readme = true
}

resource "gitlab_project_environment" "this" {
  project      = gitlab_project.this.id
  name         = "example"
  external_url = "www.example.com"
}

Schema

Required

Optional

Read-Only

Import

Import is supported using the following syntax:

# GitLab project environments can be imported using an id made up of `projectId:environmenId`, e.g.
terraform import gitlab_project_environment.bar 123:321