grafana.enterprise.Role
Explore with Pulumi AI
Note: This resource is available only with Grafana Enterprise 8.+.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const superUser = new grafana.enterprise.Role("super_user", {
name: "Super User",
description: "My Super User description",
uid: "superuseruid",
version: 1,
global: true,
permissions: [
{
action: "org.users:add",
scope: "users:*",
},
{
action: "org.users:write",
scope: "users:*",
},
{
action: "org.users:read",
scope: "users:*",
},
],
});
import pulumi
import pulumiverse_grafana as grafana
super_user = grafana.enterprise.Role("super_user",
name="Super User",
description="My Super User description",
uid="superuseruid",
version=1,
global_=True,
permissions=[
{
"action": "org.users:add",
"scope": "users:*",
},
{
"action": "org.users:write",
"scope": "users:*",
},
{
"action": "org.users:read",
"scope": "users:*",
},
])
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/enterprise"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := enterprise.NewRole(ctx, "super_user", &enterprise.RoleArgs{
Name: pulumi.String("Super User"),
Description: pulumi.String("My Super User description"),
Uid: pulumi.String("superuseruid"),
Version: pulumi.Int(1),
Global: pulumi.Bool(true),
Permissions: enterprise.RolePermissionArray{
&enterprise.RolePermissionArgs{
Action: pulumi.String("org.users:add"),
Scope: pulumi.String("users:*"),
},
&enterprise.RolePermissionArgs{
Action: pulumi.String("org.users:write"),
Scope: pulumi.String("users:*"),
},
&enterprise.RolePermissionArgs{
Action: pulumi.String("org.users:read"),
Scope: pulumi.String("users:*"),
},
},
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumiverse.Grafana;
return await Deployment.RunAsync(() =>
{
var superUser = new Grafana.Enterprise.Role("super_user", new()
{
Name = "Super User",
Description = "My Super User description",
Uid = "superuseruid",
Version = 1,
Global = true,
Permissions = new[]
{
new Grafana.Enterprise.Inputs.RolePermissionArgs
{
Action = "org.users:add",
Scope = "users:*",
},
new Grafana.Enterprise.Inputs.RolePermissionArgs
{
Action = "org.users:write",
Scope = "users:*",
},
new Grafana.Enterprise.Inputs.RolePermissionArgs
{
Action = "org.users:read",
Scope = "users:*",
},
},
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.enterprise.Role;
import com.pulumi.grafana.enterprise.RoleArgs;
import com.pulumi.grafana.enterprise.inputs.RolePermissionArgs;
import java.util.List;
import java.util.ArrayList;
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 superUser = new Role("superUser", RoleArgs.builder()
.name("Super User")
.description("My Super User description")
.uid("superuseruid")
.version(1)
.global(true)
.permissions(
RolePermissionArgs.builder()
.action("org.users:add")
.scope("users:*")
.build(),
RolePermissionArgs.builder()
.action("org.users:write")
.scope("users:*")
.build(),
RolePermissionArgs.builder()
.action("org.users:read")
.scope("users:*")
.build())
.build());
}
}
resources:
superUser:
type: grafana:enterprise:Role
name: super_user
properties:
name: Super User
description: My Super User description
uid: superuseruid
version: 1
global: true
permissions:
- action: org.users:add
scope: users:*
- action: org.users:write
scope: users:*
- action: org.users:read
scope: users:*
Create Role Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Role(name: string, args?: RoleArgs, opts?: CustomResourceOptions);
@overload
def Role(resource_name: str,
args: Optional[RoleArgs] = None,
opts: Optional[ResourceOptions] = None)
@overload
def Role(resource_name: str,
opts: Optional[ResourceOptions] = None,
auto_increment_version: Optional[bool] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
global_: Optional[bool] = None,
group: Optional[str] = None,
hidden: Optional[bool] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
permissions: Optional[Sequence[RolePermissionArgs]] = None,
uid: Optional[str] = None,
version: Optional[int] = None)
func NewRole(ctx *Context, name string, args *RoleArgs, opts ...ResourceOption) (*Role, error)
public Role(string name, RoleArgs? args = null, CustomResourceOptions? opts = null)
type: grafana:enterprise:Role
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args RoleArgs
- 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 RoleArgs
- 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 RoleArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args RoleArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args RoleArgs
- 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 roleResource = new Grafana.Enterprise.Role("roleResource", new()
{
AutoIncrementVersion = false,
Description = "string",
DisplayName = "string",
Global = false,
Group = "string",
Hidden = false,
Name = "string",
OrgId = "string",
Permissions = new[]
{
new Grafana.Enterprise.Inputs.RolePermissionArgs
{
Action = "string",
Scope = "string",
},
},
Uid = "string",
Version = 0,
});
example, err := enterprise.NewRole(ctx, "roleResource", &enterprise.RoleArgs{
AutoIncrementVersion: pulumi.Bool(false),
Description: pulumi.String("string"),
DisplayName: pulumi.String("string"),
Global: pulumi.Bool(false),
Group: pulumi.String("string"),
Hidden: pulumi.Bool(false),
Name: pulumi.String("string"),
OrgId: pulumi.String("string"),
Permissions: enterprise.RolePermissionArray{
&enterprise.RolePermissionArgs{
Action: pulumi.String("string"),
Scope: pulumi.String("string"),
},
},
Uid: pulumi.String("string"),
Version: pulumi.Int(0),
})
var roleResource = new Role("roleResource", RoleArgs.builder()
.autoIncrementVersion(false)
.description("string")
.displayName("string")
.global(false)
.group("string")
.hidden(false)
.name("string")
.orgId("string")
.permissions(RolePermissionArgs.builder()
.action("string")
.scope("string")
.build())
.uid("string")
.version(0)
.build());
role_resource = grafana.enterprise.Role("roleResource",
auto_increment_version=False,
description="string",
display_name="string",
global_=False,
group="string",
hidden=False,
name="string",
org_id="string",
permissions=[{
"action": "string",
"scope": "string",
}],
uid="string",
version=0)
const roleResource = new grafana.enterprise.Role("roleResource", {
autoIncrementVersion: false,
description: "string",
displayName: "string",
global: false,
group: "string",
hidden: false,
name: "string",
orgId: "string",
permissions: [{
action: "string",
scope: "string",
}],
uid: "string",
version: 0,
});
type: grafana:enterprise:Role
properties:
autoIncrementVersion: false
description: string
displayName: string
global: false
group: string
hidden: false
name: string
orgId: string
permissions:
- action: string
scope: string
uid: string
version: 0
Role 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 Role resource accepts the following input properties:
- Auto
Increment boolVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - Description string
- Description of the role.
- Display
Name string - Display name of the role. Available with Grafana 8.5+.
- Global bool
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - Group string
- Group of the role. Available with Grafana 8.5+.
- bool
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - Name string
- Name of the role
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Permissions
List<Pulumiverse.
Grafana. Enterprise. Inputs. Role Permission> - Specific set of actions granted by the role.
- Uid string
- Unique identifier of the role. Used for assignments.
- Version int
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- Auto
Increment boolVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - Description string
- Description of the role.
- Display
Name string - Display name of the role. Available with Grafana 8.5+.
- Global bool
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - Group string
- Group of the role. Available with Grafana 8.5+.
- bool
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - Name string
- Name of the role
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Permissions
[]Role
Permission Args - Specific set of actions granted by the role.
- Uid string
- Unique identifier of the role. Used for assignments.
- Version int
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto
Increment BooleanVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description String
- Description of the role.
- display
Name String - Display name of the role. Available with Grafana 8.5+.
- global Boolean
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group String
- Group of the role. Available with Grafana 8.5+.
- Boolean
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name String
- Name of the role
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions
List<Role
Permission> - Specific set of actions granted by the role.
- uid String
- Unique identifier of the role. Used for assignments.
- version Integer
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto
Increment booleanVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description string
- Description of the role.
- display
Name string - Display name of the role. Available with Grafana 8.5+.
- global boolean
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group string
- Group of the role. Available with Grafana 8.5+.
- boolean
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name string
- Name of the role
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions
Role
Permission[] - Specific set of actions granted by the role.
- uid string
- Unique identifier of the role. Used for assignments.
- version number
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto_
increment_ boolversion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description str
- Description of the role.
- display_
name str - Display name of the role. Available with Grafana 8.5+.
- global_ bool
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group str
- Group of the role. Available with Grafana 8.5+.
- bool
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name str
- Name of the role
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions
Sequence[Role
Permission Args] - Specific set of actions granted by the role.
- uid str
- Unique identifier of the role. Used for assignments.
- version int
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto
Increment BooleanVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description String
- Description of the role.
- display
Name String - Display name of the role. Available with Grafana 8.5+.
- global Boolean
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group String
- Group of the role. Available with Grafana 8.5+.
- Boolean
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name String
- Name of the role
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions List<Property Map>
- Specific set of actions granted by the role.
- uid String
- Unique identifier of the role. Used for assignments.
- version Number
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
Outputs
All input properties are implicitly available as output properties. Additionally, the Role 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 str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing Role Resource
Get an existing Role 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?: RoleState, opts?: CustomResourceOptions): Role
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
auto_increment_version: Optional[bool] = None,
description: Optional[str] = None,
display_name: Optional[str] = None,
global_: Optional[bool] = None,
group: Optional[str] = None,
hidden: Optional[bool] = None,
name: Optional[str] = None,
org_id: Optional[str] = None,
permissions: Optional[Sequence[RolePermissionArgs]] = None,
uid: Optional[str] = None,
version: Optional[int] = None) -> Role
func GetRole(ctx *Context, name string, id IDInput, state *RoleState, opts ...ResourceOption) (*Role, error)
public static Role Get(string name, Input<string> id, RoleState? state, CustomResourceOptions? opts = null)
public static Role get(String name, Output<String> id, RoleState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- 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.
- Auto
Increment boolVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - Description string
- Description of the role.
- Display
Name string - Display name of the role. Available with Grafana 8.5+.
- Global bool
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - Group string
- Group of the role. Available with Grafana 8.5+.
- bool
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - Name string
- Name of the role
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Permissions
List<Pulumiverse.
Grafana. Enterprise. Inputs. Role Permission> - Specific set of actions granted by the role.
- Uid string
- Unique identifier of the role. Used for assignments.
- Version int
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- Auto
Increment boolVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - Description string
- Description of the role.
- Display
Name string - Display name of the role. Available with Grafana 8.5+.
- Global bool
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - Group string
- Group of the role. Available with Grafana 8.5+.
- bool
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - Name string
- Name of the role
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Permissions
[]Role
Permission Args - Specific set of actions granted by the role.
- Uid string
- Unique identifier of the role. Used for assignments.
- Version int
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto
Increment BooleanVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description String
- Description of the role.
- display
Name String - Display name of the role. Available with Grafana 8.5+.
- global Boolean
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group String
- Group of the role. Available with Grafana 8.5+.
- Boolean
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name String
- Name of the role
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions
List<Role
Permission> - Specific set of actions granted by the role.
- uid String
- Unique identifier of the role. Used for assignments.
- version Integer
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto
Increment booleanVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description string
- Description of the role.
- display
Name string - Display name of the role. Available with Grafana 8.5+.
- global boolean
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group string
- Group of the role. Available with Grafana 8.5+.
- boolean
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name string
- Name of the role
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions
Role
Permission[] - Specific set of actions granted by the role.
- uid string
- Unique identifier of the role. Used for assignments.
- version number
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto_
increment_ boolversion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description str
- Description of the role.
- display_
name str - Display name of the role. Available with Grafana 8.5+.
- global_ bool
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group str
- Group of the role. Available with Grafana 8.5+.
- bool
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name str
- Name of the role
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions
Sequence[Role
Permission Args] - Specific set of actions granted by the role.
- uid str
- Unique identifier of the role. Used for assignments.
- version int
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
- auto
Increment BooleanVersion - Whether the role version should be incremented automatically on updates (and set to 1 on creation). This field or
version
should be set. - description String
- Description of the role.
- display
Name String - Display name of the role. Available with Grafana 8.5+.
- global Boolean
- Boolean to state whether the role is available across all organizations or not. Defaults to
false
. - group String
- Group of the role. Available with Grafana 8.5+.
- Boolean
- Boolean to state whether the role should be visible in the Grafana UI or not. Available with Grafana 8.5+. Defaults to
false
. - name String
- Name of the role
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permissions List<Property Map>
- Specific set of actions granted by the role.
- uid String
- Unique identifier of the role. Used for assignments.
- version Number
- Version of the role. A role is updated only on version increase. This field or
auto_increment_version
should be set.
Supporting Types
RolePermission, RolePermissionArgs
Import
$ pulumi import grafana:enterprise/role:Role name "{{ uid }}"
$ pulumi import grafana:enterprise/role:Role name "{{ orgID }}:{{ uid }}"
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- grafana pulumiverse/pulumi-grafana
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
grafana
Terraform Provider.