published on Thursday, Jul 23, 2026 by Pulumi
published on Thursday, Jul 23, 2026 by Pulumi
The gitlab.AdminRole resource manages the lifecycle of a custom admin role.
Custom admin roles allow an organization to grant read-only access to the Admin Area without granting Administrator access to the whole instance.
Unlike gitlab.MemberRole, admin roles have no baseAccessLevel and are not scoped to a group, since they grant access to instance-wide administration rather than to a namespace.
This resource requires an Ultimate license and is only available for GitLab Self-Managed.
Upstream API: GitLab GraphQL API docs
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as gitlab from "@pulumi/gitlab";
// Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
const example = new gitlab.AdminRole("example", {
name: "Auditor",
description: "Read-only access to the Admin Area for auditing purposes",
enabledPermissions: [
"READ_ADMIN_CICD",
"READ_ADMIN_GROUPS",
"READ_ADMIN_MONITORING",
"READ_ADMIN_PROJECTS",
"READ_ADMIN_SUBSCRIPTION",
"READ_ADMIN_USERS",
],
});
import pulumi
import pulumi_gitlab as gitlab
# Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
example = gitlab.AdminRole("example",
name="Auditor",
description="Read-only access to the Admin Area for auditing purposes",
enabled_permissions=[
"READ_ADMIN_CICD",
"READ_ADMIN_GROUPS",
"READ_ADMIN_MONITORING",
"READ_ADMIN_PROJECTS",
"READ_ADMIN_SUBSCRIPTION",
"READ_ADMIN_USERS",
])
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 {
// Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
_, err := gitlab.NewAdminRole(ctx, "example", &gitlab.AdminRoleArgs{
Name: pulumi.String("Auditor"),
Description: pulumi.String("Read-only access to the Admin Area for auditing purposes"),
EnabledPermissions: pulumi.StringArray{
pulumi.String("READ_ADMIN_CICD"),
pulumi.String("READ_ADMIN_GROUPS"),
pulumi.String("READ_ADMIN_MONITORING"),
pulumi.String("READ_ADMIN_PROJECTS"),
pulumi.String("READ_ADMIN_SUBSCRIPTION"),
pulumi.String("READ_ADMIN_USERS"),
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using GitLab = Pulumi.GitLab;
return await Deployment.RunAsync(() =>
{
// Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
var example = new GitLab.AdminRole("example", new()
{
Name = "Auditor",
Description = "Read-only access to the Admin Area for auditing purposes",
EnabledPermissions = new[]
{
"READ_ADMIN_CICD",
"READ_ADMIN_GROUPS",
"READ_ADMIN_MONITORING",
"READ_ADMIN_PROJECTS",
"READ_ADMIN_SUBSCRIPTION",
"READ_ADMIN_USERS",
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gitlab.AdminRole;
import com.pulumi.gitlab.AdminRoleArgs;
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) {
// Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
var example = new AdminRole("example", AdminRoleArgs.builder()
.name("Auditor")
.description("Read-only access to the Admin Area for auditing purposes")
.enabledPermissions(
"READ_ADMIN_CICD",
"READ_ADMIN_GROUPS",
"READ_ADMIN_MONITORING",
"READ_ADMIN_PROJECTS",
"READ_ADMIN_SUBSCRIPTION",
"READ_ADMIN_USERS")
.build());
}
}
resources:
# Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
example:
type: gitlab:AdminRole
properties:
name: Auditor
description: Read-only access to the Admin Area for auditing purposes
enabledPermissions:
- READ_ADMIN_CICD
- READ_ADMIN_GROUPS
- READ_ADMIN_MONITORING
- READ_ADMIN_PROJECTS
- READ_ADMIN_SUBSCRIPTION
- READ_ADMIN_USERS
pulumi {
required_providers {
gitlab = {
source = "pulumi/gitlab"
}
}
}
# Example is creating a custom admin role for an auditor, with read-only access to several Admin Area pages.
resource "gitlab_adminrole" "example" {
name = "Auditor"
description = "Read-only access to the Admin Area for auditing purposes"
enabled_permissions = ["READ_ADMIN_CICD", "READ_ADMIN_GROUPS", "READ_ADMIN_MONITORING", "READ_ADMIN_PROJECTS", "READ_ADMIN_SUBSCRIPTION", "READ_ADMIN_USERS"]
}
Create AdminRole Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new AdminRole(name: string, args: AdminRoleArgs, opts?: CustomResourceOptions);@overload
def AdminRole(resource_name: str,
args: AdminRoleArgs,
opts: Optional[ResourceOptions] = None)
@overload
def AdminRole(resource_name: str,
opts: Optional[ResourceOptions] = None,
enabled_permissions: Optional[Sequence[str]] = None,
description: Optional[str] = None,
name: Optional[str] = None)func NewAdminRole(ctx *Context, name string, args AdminRoleArgs, opts ...ResourceOption) (*AdminRole, error)public AdminRole(string name, AdminRoleArgs args, CustomResourceOptions? opts = null)
public AdminRole(String name, AdminRoleArgs args)
public AdminRole(String name, AdminRoleArgs args, CustomResourceOptions options)
type: gitlab:AdminRole
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "gitlab_admin_role" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args AdminRoleArgs
- 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 AdminRoleArgs
- 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 AdminRoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args AdminRoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args AdminRoleArgs
- 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 adminRoleResource = new GitLab.AdminRole("adminRoleResource", new()
{
EnabledPermissions = new[]
{
"string",
},
Description = "string",
Name = "string",
});
example, err := gitlab.NewAdminRole(ctx, "adminRoleResource", &gitlab.AdminRoleArgs{
EnabledPermissions: pulumi.StringArray{
pulumi.String("string"),
},
Description: pulumi.String("string"),
Name: pulumi.String("string"),
})
resource "gitlab_admin_role" "adminRoleResource" {
lifecycle {
create_before_destroy = true
}
enabled_permissions = ["string"]
description = "string"
name = "string"
}
var adminRoleResource = new AdminRole("adminRoleResource", AdminRoleArgs.builder()
.enabledPermissions("string")
.description("string")
.name("string")
.build());
admin_role_resource = gitlab.AdminRole("adminRoleResource",
enabled_permissions=["string"],
description="string",
name="string")
const adminRoleResource = new gitlab.AdminRole("adminRoleResource", {
enabledPermissions: ["string"],
description: "string",
name: "string",
});
type: gitlab:AdminRole
properties:
description: string
enabledPermissions:
- string
name: string
AdminRole 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 AdminRole resource accepts the following input properties:
- Enabled
Permissions List<string> - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - Description string
- Description for the admin role.
- Name string
- Name for the admin role.
- Enabled
Permissions []string - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - Description string
- Description for the admin role.
- Name string
- Name for the admin role.
- enabled_
permissions list(string) - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - description string
- Description for the admin role.
- name string
- Name for the admin role.
- enabled
Permissions List<String> - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - description String
- Description for the admin role.
- name String
- Name for the admin role.
- enabled
Permissions string[] - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - description string
- Description for the admin role.
- name string
- Name for the admin role.
- enabled_
permissions Sequence[str] - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - description str
- Description for the admin role.
- name str
- Name for the admin role.
- enabled
Permissions List<String> - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - description String
- Description for the admin role.
- name String
- Name for the admin role.
Outputs
All input properties are implicitly available as output properties. Additionally, the AdminRole resource produces the following output properties:
- created_
at string - Timestamp of when the admin role was created.
- edit_
path string - The Web UI path to edit the admin role
- id string
- The provider-assigned unique ID for this managed resource.
- iid number
- The id integer value extracted from the
idattribute
- created_
at str - Timestamp of when the admin role was created.
- edit_
path str - The Web UI path to edit the admin role
- id str
- The provider-assigned unique ID for this managed resource.
- iid int
- The id integer value extracted from the
idattribute
Look up Existing AdminRole Resource
Get an existing AdminRole 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?: AdminRoleState, opts?: CustomResourceOptions): AdminRole@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
created_at: Optional[str] = None,
description: Optional[str] = None,
edit_path: Optional[str] = None,
enabled_permissions: Optional[Sequence[str]] = None,
iid: Optional[int] = None,
name: Optional[str] = None) -> AdminRolefunc GetAdminRole(ctx *Context, name string, id IDInput, state *AdminRoleState, opts ...ResourceOption) (*AdminRole, error)public static AdminRole Get(string name, Input<string> id, AdminRoleState? state, CustomResourceOptions? opts = null)public static AdminRole get(String name, Output<String> id, AdminRoleState state, CustomResourceOptions options)resources: _: type: gitlab:AdminRole get: id: ${id}import {
to = gitlab_admin_role.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.
- Created
At string - Timestamp of when the admin role was created.
- Description string
- Description for the admin role.
- Edit
Path string - The Web UI path to edit the admin role
- Enabled
Permissions List<string> - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - Iid int
- The id integer value extracted from the
idattribute - Name string
- Name for the admin role.
- Created
At string - Timestamp of when the admin role was created.
- Description string
- Description for the admin role.
- Edit
Path string - The Web UI path to edit the admin role
- Enabled
Permissions []string - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - Iid int
- The id integer value extracted from the
idattribute - Name string
- Name for the admin role.
- created_
at string - Timestamp of when the admin role was created.
- description string
- Description for the admin role.
- edit_
path string - The Web UI path to edit the admin role
- enabled_
permissions list(string) - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - iid number
- The id integer value extracted from the
idattribute - name string
- Name for the admin role.
- created
At String - Timestamp of when the admin role was created.
- description String
- Description for the admin role.
- edit
Path String - The Web UI path to edit the admin role
- enabled
Permissions List<String> - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - iid Integer
- The id integer value extracted from the
idattribute - name String
- Name for the admin role.
- created
At string - Timestamp of when the admin role was created.
- description string
- Description for the admin role.
- edit
Path string - The Web UI path to edit the admin role
- enabled
Permissions string[] - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - iid number
- The id integer value extracted from the
idattribute - name string
- Name for the admin role.
- created_
at str - Timestamp of when the admin role was created.
- description str
- Description for the admin role.
- edit_
path str - The Web UI path to edit the admin role
- enabled_
permissions Sequence[str] - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - iid int
- The id integer value extracted from the
idattribute - name str
- Name for the admin role.
- created
At String - Timestamp of when the admin role was created.
- description String
- Description for the admin role.
- edit
Path String - The Web UI path to edit the admin role
- enabled
Permissions List<String> - All permissions enabled for the admin role. Valid values are:
READ_ADMIN_CICD,READ_ADMIN_GROUPS,READ_ADMIN_MONITORING,READ_ADMIN_PROJECTS,READ_ADMIN_SUBSCRIPTION,READ_ADMIN_USERS - iid Number
- The id integer value extracted from the
idattribute - name String
- Name for the admin role.
Import
Starting in Terraform v1.5.0, you can use an import block to import gitlab.AdminRole. For example:
Importing using the CLI is supported with the following syntax:
GitLab admin role can be imported using the id made up of gid://gitlab/MemberRole/<ID> for example:
$ pulumi import gitlab:index/adminRole:AdminRole example 'gid://gitlab/MemberRole/123'
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 Thursday, Jul 23, 2026 by Pulumi