published on Saturday, Oct 31, 2026 by Pulumi
published on Saturday, Oct 31, 2026 by Pulumi
The gitlab.ProjectProtectedEnvironment resource manages the lifecycle of a protected environment in a project.
In order to use a user or group in the
deployAccessLevelsAttributeconfiguration, you need to make sure that users have access to the project and groups must have this project shared. You may use thegitlab.ProjectMembershipandgitlabProjectSharedGroupresources to achieve this. Unfortunately, the GitLab API does not complain about users and groups without access to the project and just ignores those. In case this happens you will get perpetual state diffs.
Upstream API: GitLab REST API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
const _this = new gitlab.ProjectEnvironment("this", {
project: "123",
name: "example",
externalUrl: "www.example.com",
});
// Example with access-level based approval rules
const exampleWithAccessLevel = new gitlab.ProjectProtectedEnvironment("example_with_access_level", {
project: _this.project,
environment: _this.name,
deployAccessLevelsAttributes: [{
accessLevel: "developer",
}],
approvalRules: [{
accessLevel: "developer",
requiredApprovals: 2,
}],
});
// Example with multiple approval rules, using access level, user, and group
const exampleWithMultiple = new gitlab.ProjectProtectedEnvironment("example_with_multiple", {
project: _this.project,
environment: _this.name,
deployAccessLevelsAttributes: [{
accessLevel: "developer",
}],
approvalRules: [
{
userId: 789,
},
{
accessLevel: "developer",
requiredApprovals: 2,
},
{
groupId: 456,
},
],
});
// Example with deployment access level attribute
const exampleAccessLevelsAttribute = new gitlab.ProjectProtectedEnvironment("example_access_levels_attribute", {
project: _this.project,
environment: _this.name,
deployAccessLevelsAttributes: [{
accessLevel: "developer",
}],
});
// Example with group-based deployment level attribute
const exampleAccessLevelsAttributeWithGroup = new gitlab.ProjectProtectedEnvironment("example_access_levels_attribute_with_group", {
project: _this.project,
environment: _this.name,
deployAccessLevelsAttributes: [{
groupId: 456,
}],
});
// Example with user-based deployment level attribute
const exampleAccessLevelsAttributeWithUser = new gitlab.ProjectProtectedEnvironment("example_access_levels_attribute_with_user", {
project: _this.project,
environment: _this.name,
deployAccessLevelsAttributes: [{
userId: 789,
}],
});
// Example with multiple deployment access levels attribute
const exampleAccessLevelsAttributeWithMultiple = new gitlab.ProjectProtectedEnvironment("example_access_levels_attribute_with_multiple", {
project: _this.project,
environment: _this.name,
deployAccessLevelsAttributes: [
{
accessLevel: "developer",
},
{
groupId: 456,
},
{
userId: 789,
},
],
});
import pulumi
import pulumi_gitlab as gitlab
this = gitlab.ProjectEnvironment("this",
project="123",
name="example",
external_url="www.example.com")
# Example with access-level based approval rules
example_with_access_level = gitlab.ProjectProtectedEnvironment("example_with_access_level",
project=this.project,
environment=this.name,
deploy_access_levels_attributes=[{
"access_level": "developer",
}],
approval_rules=[{
"access_level": "developer",
"required_approvals": 2,
}])
# Example with multiple approval rules, using access level, user, and group
example_with_multiple = gitlab.ProjectProtectedEnvironment("example_with_multiple",
project=this.project,
environment=this.name,
deploy_access_levels_attributes=[{
"access_level": "developer",
}],
approval_rules=[
{
"user_id": 789,
},
{
"access_level": "developer",
"required_approvals": 2,
},
{
"group_id": 456,
},
])
# Example with deployment access level attribute
example_access_levels_attribute = gitlab.ProjectProtectedEnvironment("example_access_levels_attribute",
project=this.project,
environment=this.name,
deploy_access_levels_attributes=[{
"access_level": "developer",
}])
# Example with group-based deployment level attribute
example_access_levels_attribute_with_group = gitlab.ProjectProtectedEnvironment("example_access_levels_attribute_with_group",
project=this.project,
environment=this.name,
deploy_access_levels_attributes=[{
"group_id": 456,
}])
# Example with user-based deployment level attribute
example_access_levels_attribute_with_user = gitlab.ProjectProtectedEnvironment("example_access_levels_attribute_with_user",
project=this.project,
environment=this.name,
deploy_access_levels_attributes=[{
"user_id": 789,
}])
# Example with multiple deployment access levels attribute
example_access_levels_attribute_with_multiple = gitlab.ProjectProtectedEnvironment("example_access_levels_attribute_with_multiple",
project=this.project,
environment=this.name,
deploy_access_levels_attributes=[
{
"access_level": "developer",
},
{
"group_id": 456,
},
{
"user_id": 789,
},
])
package main
import (
"github.com/pulumi/pulumi-gitlab/sdk/v10/go/gitlab"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
this, err := gitlab.NewProjectEnvironment(ctx, "this", &gitlab.ProjectEnvironmentArgs{
Project: pulumi.String("123"),
Name: pulumi.String("example"),
ExternalUrl: pulumi.String("www.example.com"),
})
if err != nil {
return err
}
// Example with access-level based approval rules
_, err = gitlab.NewProjectProtectedEnvironment(ctx, "example_with_access_level", &gitlab.ProjectProtectedEnvironmentArgs{
Project: this.Project,
Environment: this.Name,
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
AccessLevel: pulumi.String("developer"),
},
},
ApprovalRules: gitlab.ProjectProtectedEnvironmentApprovalRuleArray{
&gitlab.ProjectProtectedEnvironmentApprovalRuleArgs{
AccessLevel: pulumi.String("developer"),
RequiredApprovals: pulumi.Int(2),
},
},
})
if err != nil {
return err
}
// Example with multiple approval rules, using access level, user, and group
_, err = gitlab.NewProjectProtectedEnvironment(ctx, "example_with_multiple", &gitlab.ProjectProtectedEnvironmentArgs{
Project: this.Project,
Environment: this.Name,
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
AccessLevel: pulumi.String("developer"),
},
},
ApprovalRules: gitlab.ProjectProtectedEnvironmentApprovalRuleArray{
&gitlab.ProjectProtectedEnvironmentApprovalRuleArgs{
UserId: pulumi.Int(789),
},
&gitlab.ProjectProtectedEnvironmentApprovalRuleArgs{
AccessLevel: pulumi.String("developer"),
RequiredApprovals: pulumi.Int(2),
},
&gitlab.ProjectProtectedEnvironmentApprovalRuleArgs{
GroupId: pulumi.Int(456),
},
},
})
if err != nil {
return err
}
// Example with deployment access level attribute
_, err = gitlab.NewProjectProtectedEnvironment(ctx, "example_access_levels_attribute", &gitlab.ProjectProtectedEnvironmentArgs{
Project: this.Project,
Environment: this.Name,
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
AccessLevel: pulumi.String("developer"),
},
},
})
if err != nil {
return err
}
// Example with group-based deployment level attribute
_, err = gitlab.NewProjectProtectedEnvironment(ctx, "example_access_levels_attribute_with_group", &gitlab.ProjectProtectedEnvironmentArgs{
Project: this.Project,
Environment: this.Name,
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
GroupId: pulumi.Int(456),
},
},
})
if err != nil {
return err
}
// Example with user-based deployment level attribute
_, err = gitlab.NewProjectProtectedEnvironment(ctx, "example_access_levels_attribute_with_user", &gitlab.ProjectProtectedEnvironmentArgs{
Project: this.Project,
Environment: this.Name,
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
UserId: pulumi.Int(789),
},
},
})
if err != nil {
return err
}
// Example with multiple deployment access levels attribute
_, err = gitlab.NewProjectProtectedEnvironment(ctx, "example_access_levels_attribute_with_multiple", &gitlab.ProjectProtectedEnvironmentArgs{
Project: this.Project,
Environment: this.Name,
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
AccessLevel: pulumi.String("developer"),
},
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
GroupId: pulumi.Int(456),
},
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
UserId: pulumi.Int(789),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
var @this = new GitLab.ProjectEnvironment("this", new()
{
Project = "123",
Name = "example",
ExternalUrl = "www.example.com",
});
// Example with access-level based approval rules
var exampleWithAccessLevel = new GitLab.ProjectProtectedEnvironment("example_with_access_level", new()
{
Project = @this.Project,
Environment = @this.Name,
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
AccessLevel = "developer",
},
},
ApprovalRules = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentApprovalRuleArgs
{
AccessLevel = "developer",
RequiredApprovals = 2,
},
},
});
// Example with multiple approval rules, using access level, user, and group
var exampleWithMultiple = new GitLab.ProjectProtectedEnvironment("example_with_multiple", new()
{
Project = @this.Project,
Environment = @this.Name,
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
AccessLevel = "developer",
},
},
ApprovalRules = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentApprovalRuleArgs
{
UserId = 789,
},
new GitLab.Inputs.ProjectProtectedEnvironmentApprovalRuleArgs
{
AccessLevel = "developer",
RequiredApprovals = 2,
},
new GitLab.Inputs.ProjectProtectedEnvironmentApprovalRuleArgs
{
GroupId = 456,
},
},
});
// Example with deployment access level attribute
var exampleAccessLevelsAttribute = new GitLab.ProjectProtectedEnvironment("example_access_levels_attribute", new()
{
Project = @this.Project,
Environment = @this.Name,
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
AccessLevel = "developer",
},
},
});
// Example with group-based deployment level attribute
var exampleAccessLevelsAttributeWithGroup = new GitLab.ProjectProtectedEnvironment("example_access_levels_attribute_with_group", new()
{
Project = @this.Project,
Environment = @this.Name,
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
GroupId = 456,
},
},
});
// Example with user-based deployment level attribute
var exampleAccessLevelsAttributeWithUser = new GitLab.ProjectProtectedEnvironment("example_access_levels_attribute_with_user", new()
{
Project = @this.Project,
Environment = @this.Name,
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
UserId = 789,
},
},
});
// Example with multiple deployment access levels attribute
var exampleAccessLevelsAttributeWithMultiple = new GitLab.ProjectProtectedEnvironment("example_access_levels_attribute_with_multiple", new()
{
Project = @this.Project,
Environment = @this.Name,
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
AccessLevel = "developer",
},
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
GroupId = 456,
},
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
UserId = 789,
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.ProjectEnvironment;
import com.pulumi.gitlab.ProjectEnvironmentArgs;
import com.pulumi.gitlab.ProjectProtectedEnvironment;
import com.pulumi.gitlab.ProjectProtectedEnvironmentArgs;
import com.pulumi.gitlab.inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs;
import com.pulumi.gitlab.inputs.ProjectProtectedEnvironmentApprovalRuleArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
var this_ = new ProjectEnvironment("this", ProjectEnvironmentArgs.builder()
.project("123")
.name("example")
.externalUrl("www.example.com")
.build());
// Example with access-level based approval rules
var exampleWithAccessLevel = new ProjectProtectedEnvironment("exampleWithAccessLevel", ProjectProtectedEnvironmentArgs.builder()
.project(this_.project())
.environment(this_.name())
.deployAccessLevelsAttributes(ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.accessLevel("developer")
.build())
.approvalRules(ProjectProtectedEnvironmentApprovalRuleArgs.builder()
.accessLevel("developer")
.requiredApprovals(2)
.build())
.build());
// Example with multiple approval rules, using access level, user, and group
var exampleWithMultiple = new ProjectProtectedEnvironment("exampleWithMultiple", ProjectProtectedEnvironmentArgs.builder()
.project(this_.project())
.environment(this_.name())
.deployAccessLevelsAttributes(ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.accessLevel("developer")
.build())
.approvalRules(
ProjectProtectedEnvironmentApprovalRuleArgs.builder()
.userId(789)
.build(),
ProjectProtectedEnvironmentApprovalRuleArgs.builder()
.accessLevel("developer")
.requiredApprovals(2)
.build(),
ProjectProtectedEnvironmentApprovalRuleArgs.builder()
.groupId(456)
.build())
.build());
// Example with deployment access level attribute
var exampleAccessLevelsAttribute = new ProjectProtectedEnvironment("exampleAccessLevelsAttribute", ProjectProtectedEnvironmentArgs.builder()
.project(this_.project())
.environment(this_.name())
.deployAccessLevelsAttributes(ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.accessLevel("developer")
.build())
.build());
// Example with group-based deployment level attribute
var exampleAccessLevelsAttributeWithGroup = new ProjectProtectedEnvironment("exampleAccessLevelsAttributeWithGroup", ProjectProtectedEnvironmentArgs.builder()
.project(this_.project())
.environment(this_.name())
.deployAccessLevelsAttributes(ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.groupId(456)
.build())
.build());
// Example with user-based deployment level attribute
var exampleAccessLevelsAttributeWithUser = new ProjectProtectedEnvironment("exampleAccessLevelsAttributeWithUser", ProjectProtectedEnvironmentArgs.builder()
.project(this_.project())
.environment(this_.name())
.deployAccessLevelsAttributes(ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.userId(789)
.build())
.build());
// Example with multiple deployment access levels attribute
var exampleAccessLevelsAttributeWithMultiple = new ProjectProtectedEnvironment("exampleAccessLevelsAttributeWithMultiple", ProjectProtectedEnvironmentArgs.builder()
.project(this_.project())
.environment(this_.name())
.deployAccessLevelsAttributes(
ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.accessLevel("developer")
.build(),
ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.groupId(456)
.build(),
ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.userId(789)
.build())
.build());
}
}
resources:
this:
type: gitlab:ProjectEnvironment
properties:
project: 123
name: example
externalUrl: www.example.com
# Example with access-level based approval rules
exampleWithAccessLevel:
type: gitlab:ProjectProtectedEnvironment
name: example_with_access_level
properties:
project: ${this.project}
environment: ${this.name}
deployAccessLevelsAttributes:
- accessLevel: developer
approvalRules:
- accessLevel: developer
requiredApprovals: 2
# Example with multiple approval rules, using access level, user, and group
exampleWithMultiple:
type: gitlab:ProjectProtectedEnvironment
name: example_with_multiple
properties:
project: ${this.project}
environment: ${this.name}
deployAccessLevelsAttributes:
- accessLevel: developer
approvalRules:
- userId: 789
- accessLevel: developer
requiredApprovals: 2
- groupId: 456
# Example with deployment access level attribute
exampleAccessLevelsAttribute:
type: gitlab:ProjectProtectedEnvironment
name: example_access_levels_attribute
properties:
project: ${this.project}
environment: ${this.name}
deployAccessLevelsAttributes:
- accessLevel: developer
# Example with group-based deployment level attribute
exampleAccessLevelsAttributeWithGroup:
type: gitlab:ProjectProtectedEnvironment
name: example_access_levels_attribute_with_group
properties:
project: ${this.project}
environment: ${this.name}
deployAccessLevelsAttributes:
- groupId: 456
# Example with user-based deployment level attribute
exampleAccessLevelsAttributeWithUser:
type: gitlab:ProjectProtectedEnvironment
name: example_access_levels_attribute_with_user
properties:
project: ${this.project}
environment: ${this.name}
deployAccessLevelsAttributes:
- userId: 789
# Example with multiple deployment access levels attribute
exampleAccessLevelsAttributeWithMultiple:
type: gitlab:ProjectProtectedEnvironment
name: example_access_levels_attribute_with_multiple
properties:
project: ${this.project}
environment: ${this.name}
deployAccessLevelsAttributes:
- accessLevel: developer
- groupId: 456
- userId: 789
terraform {
required_providers {
gitlab = {
source = "pulumi/gitlab"
}
}
}
resource "gitlab_project_environment" "this" {
lifecycle {
create_before_destroy = true
}
project = 123
name = "example"
external_url = "www.example.com"
}
# Example with access-level based approval rules
resource "gitlab_project_protected_environment" "example_with_access_level" {
lifecycle {
create_before_destroy = true
}
project = gitlab_project_environment.this.project
environment = gitlab_project_environment.this.name
deploy_access_levels_attribute = [{
access_level = "developer"
}]
approval_rules = [{
access_level = "developer"
required_approvals = 2
}]
}
# Example with multiple approval rules, using access level, user, and group
resource "gitlab_project_protected_environment" "example_with_multiple" {
lifecycle {
create_before_destroy = true
}
project = gitlab_project_environment.this.project
environment = gitlab_project_environment.this.name
deploy_access_levels_attribute = [{
access_level = "developer"
}]
approval_rules = [{
user_id = 789
}, {
access_level = "developer"
required_approvals = 2
}, {
group_id = 456
}]
}
# Example with deployment access level attribute
resource "gitlab_project_protected_environment" "example_access_levels_attribute" {
lifecycle {
create_before_destroy = true
}
project = gitlab_project_environment.this.project
environment = gitlab_project_environment.this.name
deploy_access_levels_attribute = [{
access_level = "developer"
}]
}
# Example with group-based deployment level attribute
resource "gitlab_project_protected_environment" "example_access_levels_attribute_with_group" {
lifecycle {
create_before_destroy = true
}
project = gitlab_project_environment.this.project
environment = gitlab_project_environment.this.name
deploy_access_levels_attribute = [{
group_id = 456
}]
}
# Example with user-based deployment level attribute
resource "gitlab_project_protected_environment" "example_access_levels_attribute_with_user" {
lifecycle {
create_before_destroy = true
}
project = gitlab_project_environment.this.project
environment = gitlab_project_environment.this.name
deploy_access_levels_attribute = [{
user_id = 789
}]
}
# Example with multiple deployment access levels attribute
resource "gitlab_project_protected_environment" "example_access_levels_attribute_with_multiple" {
lifecycle {
create_before_destroy = true
}
project = gitlab_project_environment.this.project
environment = gitlab_project_environment.this.name
deploy_access_levels_attribute = [{
access_level = "developer"
}, {
group_id = 456
}, {
user_id = 789
}]
}
Create ProjectProtectedEnvironment Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectProtectedEnvironment(name: string, args: ProjectProtectedEnvironmentArgs, opts?: CustomResourceOptions);@overload
def ProjectProtectedEnvironment(resource_name: str,
args: ProjectProtectedEnvironmentArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectProtectedEnvironment(resource_name: str,
opts: Optional[ResourceOptions] = None,
environment: Optional[str] = None,
project: Optional[str] = None,
approval_rules: Optional[Sequence[ProjectProtectedEnvironmentApprovalRuleArgs]] = None,
deploy_access_levels_attributes: Optional[Sequence[ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs]] = None)func NewProjectProtectedEnvironment(ctx *Context, name string, args ProjectProtectedEnvironmentArgs, opts ...ResourceOption) (*ProjectProtectedEnvironment, error)public ProjectProtectedEnvironment(string name, ProjectProtectedEnvironmentArgs args, CustomResourceOptions? opts = null)
public ProjectProtectedEnvironment(String name, ProjectProtectedEnvironmentArgs args)
public ProjectProtectedEnvironment(String name, ProjectProtectedEnvironmentArgs args, CustomResourceOptions options)
type: gitlab:ProjectProtectedEnvironment
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "gitlab_project_protected_environment" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ProjectProtectedEnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args ProjectProtectedEnvironmentArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args ProjectProtectedEnvironmentArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectProtectedEnvironmentArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectProtectedEnvironmentArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var projectProtectedEnvironmentResource = new GitLab.ProjectProtectedEnvironment("projectProtectedEnvironmentResource", new()
{
Environment = "string",
Project = "string",
ApprovalRules = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentApprovalRuleArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
GroupInheritanceType = 0,
Id = 0,
RequiredApprovals = 0,
UserId = 0,
},
},
DeployAccessLevelsAttributes = new[]
{
new GitLab.Inputs.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
{
AccessLevel = "string",
AccessLevelDescription = "string",
GroupId = 0,
GroupInheritanceType = 0,
Id = 0,
UserId = 0,
},
},
});
example, err := gitlab.NewProjectProtectedEnvironment(ctx, "projectProtectedEnvironmentResource", &gitlab.ProjectProtectedEnvironmentArgs{
Environment: pulumi.String("string"),
Project: pulumi.String("string"),
ApprovalRules: gitlab.ProjectProtectedEnvironmentApprovalRuleArray{
&gitlab.ProjectProtectedEnvironmentApprovalRuleArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
GroupInheritanceType: pulumi.Int(0),
Id: pulumi.Int(0),
RequiredApprovals: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
DeployAccessLevelsAttributes: gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArray{
&gitlab.ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs{
AccessLevel: pulumi.String("string"),
AccessLevelDescription: pulumi.String("string"),
GroupId: pulumi.Int(0),
GroupInheritanceType: pulumi.Int(0),
Id: pulumi.Int(0),
UserId: pulumi.Int(0),
},
},
})
resource "gitlab_project_protected_environment" "projectProtectedEnvironmentResource" {
lifecycle {
create_before_destroy = true
}
environment = "string"
project = "string"
approval_rules {
access_level = "string"
access_level_description = "string"
group_id = 0
group_inheritance_type = 0
id = 0
required_approvals = 0
user_id = 0
}
deploy_access_levels_attributes {
access_level = "string"
access_level_description = "string"
group_id = 0
group_inheritance_type = 0
id = 0
user_id = 0
}
}
var projectProtectedEnvironmentResource = new ProjectProtectedEnvironment("projectProtectedEnvironmentResource", ProjectProtectedEnvironmentArgs.builder()
.environment("string")
.project("string")
.approvalRules(ProjectProtectedEnvironmentApprovalRuleArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.groupInheritanceType(0)
.id(0)
.requiredApprovals(0)
.userId(0)
.build())
.deployAccessLevelsAttributes(ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs.builder()
.accessLevel("string")
.accessLevelDescription("string")
.groupId(0)
.groupInheritanceType(0)
.id(0)
.userId(0)
.build())
.build());
project_protected_environment_resource = gitlab.ProjectProtectedEnvironment("projectProtectedEnvironmentResource",
environment="string",
project="string",
approval_rules=[{
"access_level": "string",
"access_level_description": "string",
"group_id": 0,
"group_inheritance_type": 0,
"id": 0,
"required_approvals": 0,
"user_id": 0,
}],
deploy_access_levels_attributes=[{
"access_level": "string",
"access_level_description": "string",
"group_id": 0,
"group_inheritance_type": 0,
"id": 0,
"user_id": 0,
}])
const projectProtectedEnvironmentResource = new gitlab.ProjectProtectedEnvironment("projectProtectedEnvironmentResource", {
environment: "string",
project: "string",
approvalRules: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
groupInheritanceType: 0,
id: 0,
requiredApprovals: 0,
userId: 0,
}],
deployAccessLevelsAttributes: [{
accessLevel: "string",
accessLevelDescription: "string",
groupId: 0,
groupInheritanceType: 0,
id: 0,
userId: 0,
}],
});
type: gitlab:ProjectProtectedEnvironment
properties:
approvalRules:
- accessLevel: string
accessLevelDescription: string
groupId: 0
groupInheritanceType: 0
id: 0
requiredApprovals: 0
userId: 0
deployAccessLevelsAttributes:
- accessLevel: string
accessLevelDescription: string
groupId: 0
groupInheritanceType: 0
id: 0
userId: 0
environment: string
project: string
ProjectProtectedEnvironment Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectProtectedEnvironment resource accepts the following input properties:
- Environment string
- The name of the environment.
- Project string
- The ID or full path of the project which the protected environment is created against.
- Approval
Rules List<Pulumi.Git Lab. Inputs. Project Protected Environment Approval Rule> - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - Deploy
Access List<Pulumi.Levels Attributes Git Lab. Inputs. Project Protected Environment Deploy Access Levels Attribute> - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
- Environment string
- The name of the environment.
- Project string
- The ID or full path of the project which the protected environment is created against.
- Approval
Rules []ProjectProtected Environment Approval Rule Args - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - Deploy
Access []ProjectLevels Attributes Protected Environment Deploy Access Levels Attribute Args - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
- environment string
- The name of the environment.
- project string
- The ID or full path of the project which the protected environment is created against.
- approval_
rules list(object) - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy_
access_ list(object)levels_ attributes - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
- environment String
- The name of the environment.
- project String
- The ID or full path of the project which the protected environment is created against.
- approval
Rules List<ProjectProtected Environment Approval Rule> - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy
Access List<ProjectLevels Attributes Protected Environment Deploy Access Levels Attribute> - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
- environment string
- The name of the environment.
- project string
- The ID or full path of the project which the protected environment is created against.
- approval
Rules ProjectProtected Environment Approval Rule[] - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy
Access ProjectLevels Attributes Protected Environment Deploy Access Levels Attribute[] - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
- environment str
- The name of the environment.
- project str
- The ID or full path of the project which the protected environment is created against.
- approval_
rules Sequence[ProjectProtected Environment Approval Rule Args] - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy_
access_ Sequence[Projectlevels_ attributes Protected Environment Deploy Access Levels Attribute Args] - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
- environment String
- The name of the environment.
- project String
- The ID or full path of the project which the protected environment is created against.
- approval
Rules List<Property Map> - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy
Access List<Property Map>Levels Attributes - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel.
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectProtectedEnvironment resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ProjectProtectedEnvironment Resource
Get an existing ProjectProtectedEnvironment resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: ProjectProtectedEnvironmentState, opts?: CustomResourceOptions): ProjectProtectedEnvironment@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
approval_rules: Optional[Sequence[ProjectProtectedEnvironmentApprovalRuleArgs]] = None,
deploy_access_levels_attributes: Optional[Sequence[ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs]] = None,
environment: Optional[str] = None,
project: Optional[str] = None) -> ProjectProtectedEnvironmentfunc GetProjectProtectedEnvironment(ctx *Context, name string, id IDInput, state *ProjectProtectedEnvironmentState, opts ...ResourceOption) (*ProjectProtectedEnvironment, error)public static ProjectProtectedEnvironment Get(string name, Input<string> id, ProjectProtectedEnvironmentState? state, CustomResourceOptions? opts = null)public static ProjectProtectedEnvironment get(String name, Output<String> id, ProjectProtectedEnvironmentState state, CustomResourceOptions options)resources: _: type: gitlab:ProjectProtectedEnvironment get: id: ${id}import {
to = gitlab_project_protected_environment.example
id = "${id}"
}
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Approval
Rules List<Pulumi.Git Lab. Inputs. Project Protected Environment Approval Rule> - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - Deploy
Access List<Pulumi.Levels Attributes Git Lab. Inputs. Project Protected Environment Deploy Access Levels Attribute> - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - Environment string
- The name of the environment.
- Project string
- The ID or full path of the project which the protected environment is created against.
- Approval
Rules []ProjectProtected Environment Approval Rule Args - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - Deploy
Access []ProjectLevels Attributes Protected Environment Deploy Access Levels Attribute Args - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - Environment string
- The name of the environment.
- Project string
- The ID or full path of the project which the protected environment is created against.
- approval_
rules list(object) - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy_
access_ list(object)levels_ attributes - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - environment string
- The name of the environment.
- project string
- The ID or full path of the project which the protected environment is created against.
- approval
Rules List<ProjectProtected Environment Approval Rule> - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy
Access List<ProjectLevels Attributes Protected Environment Deploy Access Levels Attribute> - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - environment String
- The name of the environment.
- project String
- The ID or full path of the project which the protected environment is created against.
- approval
Rules ProjectProtected Environment Approval Rule[] - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy
Access ProjectLevels Attributes Protected Environment Deploy Access Levels Attribute[] - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - environment string
- The name of the environment.
- project string
- The ID or full path of the project which the protected environment is created against.
- approval_
rules Sequence[ProjectProtected Environment Approval Rule Args] - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy_
access_ Sequence[Projectlevels_ attributes Protected Environment Deploy Access Levels Attribute Args] - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - environment str
- The name of the environment.
- project str
- The ID or full path of the project which the protected environment is created against.
- approval
Rules List<Property Map> - Array of approval rules to deploy, with each described by a hash. Elements in the
approvalRulesshould be one ofuserId,groupIdoraccessLevel. - deploy
Access List<Property Map>Levels Attributes - Array of access levels allowed to deploy, with each described by a hash. Elements in the
deployAccessLevelsAttributeshould be one ofuserId,groupIdoraccessLevel. - environment String
- The name of the environment.
- project String
- The ID or full path of the project which the protected environment is created against.
Supporting Types
ProjectProtectedEnvironmentApprovalRule, ProjectProtectedEnvironmentApprovalRuleArgs
- Access
Level string - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - Access
Level stringDescription - Readable description of level of access.
- Group
Id int - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - Group
Inheritance intType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - Id int
- The unique ID of the Approval Rules object.
- Required
Approvals int - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- User
Id int - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- Access
Level string - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - Access
Level stringDescription - Readable description of level of access.
- Group
Id int - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - Group
Inheritance intType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - Id int
- The unique ID of the Approval Rules object.
- Required
Approvals int - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- User
Id int - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access_
level string - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access_
level_ stringdescription - Readable description of level of access.
- group_
id number - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group_
inheritance_ numbertype - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id number
- The unique ID of the Approval Rules object.
- required_
approvals number - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- user_
id number - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access
Level String - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access
Level StringDescription - Readable description of level of access.
- group
Id Integer - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group
Inheritance IntegerType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id Integer
- The unique ID of the Approval Rules object.
- required
Approvals Integer - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- user
Id Integer - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access
Level string - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access
Level stringDescription - Readable description of level of access.
- group
Id number - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group
Inheritance numberType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id number
- The unique ID of the Approval Rules object.
- required
Approvals number - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- user
Id number - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access_
level str - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access_
level_ strdescription - Readable description of level of access.
- group_
id int - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group_
inheritance_ inttype - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id int
- The unique ID of the Approval Rules object.
- required_
approvals int - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- user_
id int - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access
Level String - Levels of access allowed to approve a deployment to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access
Level StringDescription - Readable description of level of access.
- group
Id Number - The ID of the group allowed to approve a deployment to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group
Inheritance NumberType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id Number
- The unique ID of the Approval Rules object.
- required
Approvals Number - The number of approval required to allow deployment to this protected environment. This is mutually exclusive with user_id.
- user
Id Number - The ID of the user allowed to approve a deployment to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
ProjectProtectedEnvironmentDeployAccessLevelsAttribute, ProjectProtectedEnvironmentDeployAccessLevelsAttributeArgs
- Access
Level string - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - Access
Level stringDescription - Readable description of level of access.
- Group
Id int - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - Group
Inheritance intType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - Id int
- The unique ID of the Deploy Access Level object.
- User
Id int - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- Access
Level string - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - Access
Level stringDescription - Readable description of level of access.
- Group
Id int - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - Group
Inheritance intType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - Id int
- The unique ID of the Deploy Access Level object.
- User
Id int - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access_
level string - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access_
level_ stringdescription - Readable description of level of access.
- group_
id number - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group_
inheritance_ numbertype - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id number
- The unique ID of the Deploy Access Level object.
- user_
id number - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access
Level String - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access
Level StringDescription - Readable description of level of access.
- group
Id Integer - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group
Inheritance IntegerType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id Integer
- The unique ID of the Deploy Access Level object.
- user
Id Integer - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access
Level string - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access
Level stringDescription - Readable description of level of access.
- group
Id number - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group
Inheritance numberType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id number
- The unique ID of the Deploy Access Level object.
- user
Id number - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access_
level str - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access_
level_ strdescription - Readable description of level of access.
- group_
id int - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group_
inheritance_ inttype - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id int
- The unique ID of the Deploy Access Level object.
- user_
id int - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
- access
Level String - Levels of access required to deploy to this protected environment. Mutually exclusive with
userIdandgroupId. Valid values aredeveloper,maintainer. - access
Level StringDescription - Readable description of level of access.
- group
Id Number - The ID of the group allowed to deploy to this protected environment. The project must be shared with the group. Mutually exclusive with
accessLevelanduserId. - group
Inheritance NumberType - Group inheritance allows deploy access levels to take inherited group membership into account. Valid values are
0,1.0=> Direct group membership only,1=> All inherited groups. Default:0 - id Number
- The unique ID of the Deploy Access Level object.
- user
Id Number - The ID of the user allowed to deploy to this protected environment. The user must be a member of the project. Mutually exclusive with
accessLevelandgroupId.
Import
Starting in Terraform v1.5.0, you can use an import block to import gitlab.ProjectProtectedEnvironment. For example:
Importing using the CLI is supported with the following syntax:
GitLab protected environments can be imported using an id made up of projectId:environmentName, for example:
$ pulumi import gitlab:index/projectProtectedEnvironment:ProjectProtectedEnvironment bar 123:production
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- GitLab pulumi/pulumi-gitlab
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
gitlabTerraform Provider.
published on Saturday, Oct 31, 2026 by Pulumi