grafana.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.Role("superUser", {
description: "My Super User description",
global: true,
permissions: [
{
action: "org.users:add",
scope: "users:*",
},
{
action: "org.users:write",
scope: "users:*",
},
{
action: "org.users:read",
scope: "users:*",
},
],
uid: "superuseruid",
version: 1,
});
import pulumi
import pulumiverse_grafana as grafana
super_user = grafana.Role("superUser",
description="My Super User description",
global_=True,
permissions=[
grafana.RolePermissionArgs(
action="org.users:add",
scope="users:*",
),
grafana.RolePermissionArgs(
action="org.users:write",
scope="users:*",
),
grafana.RolePermissionArgs(
action="org.users:read",
scope="users:*",
),
],
uid="superuseruid",
version=1)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := grafana.NewRole(ctx, "superUser", &grafana.RoleArgs{
Description: pulumi.String("My Super User description"),
Global: pulumi.Bool(true),
Permissions: grafana.RolePermissionArray{
&grafana.RolePermissionArgs{
Action: pulumi.String("org.users:add"),
Scope: pulumi.String("users:*"),
},
&grafana.RolePermissionArgs{
Action: pulumi.String("org.users:write"),
Scope: pulumi.String("users:*"),
},
&grafana.RolePermissionArgs{
Action: pulumi.String("org.users:read"),
Scope: pulumi.String("users:*"),
},
},
Uid: pulumi.String("superuseruid"),
Version: pulumi.Int(1),
})
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.Role("superUser", new()
{
Description = "My Super User description",
Global = true,
Permissions = new[]
{
new Grafana.Inputs.RolePermissionArgs
{
Action = "org.users:add",
Scope = "users:*",
},
new Grafana.Inputs.RolePermissionArgs
{
Action = "org.users:write",
Scope = "users:*",
},
new Grafana.Inputs.RolePermissionArgs
{
Action = "org.users:read",
Scope = "users:*",
},
},
Uid = "superuseruid",
Version = 1,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.Role;
import com.pulumi.grafana.RoleArgs;
import com.pulumi.grafana.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()
.description("My Super User description")
.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())
.uid("superuseruid")
.version(1)
.build());
}
}
resources:
superUser:
type: grafana:Role
properties:
description: My Super User description
global: true
permissions:
- action: org.users:add
scope: users:*
- action: org.users:write
scope: users:*
- action: org.users:read
scope: users:*
uid: superuseruid
version: 1
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: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.Role("roleResource", new()
{
AutoIncrementVersion = false,
Description = "string",
DisplayName = "string",
Global = false,
Group = "string",
Hidden = false,
Name = "string",
OrgId = "string",
Permissions = new[]
{
new Grafana.Inputs.RolePermissionArgs
{
Action = "string",
Scope = "string",
},
},
Uid = "string",
Version = 0,
});
example, err := grafana.NewRole(ctx, "roleResource", &grafana.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: grafana.RolePermissionArray{
&grafana.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.Role("roleResource",
auto_increment_version=False,
description="string",
display_name="string",
global_=False,
group="string",
hidden=False,
name="string",
org_id="string",
permissions=[grafana.RolePermissionArgs(
action="string",
scope="string",
)],
uid="string",
version=0)
const roleResource = new grafana.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: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
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. 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. 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:index/role:Role name "{{ uid }}"
$ pulumi import grafana:index/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.