The gitlab_project_environment
resource allows to manage the lifecycle of an environment in a project.
Upstream API: GitLab REST API docs
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"
}
name
(String) The name of the environment.project
(String) The ID or full path of the project to environment is created for.external_url
(String) Place to link to for this environment.stop_before_destroy
(Boolean) Determines whether the environment is attempted to be stopped before the environment is deleted.created_at
(String) The ISO8601 date/time that this environment was created at in UTC.id
(String) The ID of this resource.slug
(String) The name of the environment in lowercase, shortened to 63 bytes, and with everything except 0-9 and a-z replaced with -. No leading / trailing -. Use in URLs, host names and domain names.state
(String) State the environment is in. Valid values are available
, stopped
.updated_at
(String) The ISO8601 date/time that this environment was last updated at in UTC.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