
Grafana v0.0.10, May 21 23

Grafana v0.0.10, May 21 23
grafana.Role
Explore with Pulumi AI
Note: This resource is available only with Grafana Enterprise 8.+.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.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 main
import (
"github.com/lbrlabs/pulumi-grafana/sdk/go/grafana"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
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
})
}
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());
}
}
import pulumi
import lbrlabs_pulumi_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)
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@lbrlabs/pulumi-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,
});
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
new Role(name: string, args: RoleArgs, opts?: CustomResourceOptions);
@overload
def Role(resource_name: str,
opts: Optional[ResourceOptions] = 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,
permissions: Optional[Sequence[RolePermissionArgs]] = None,
uid: Optional[str] = None,
version: Optional[int] = None)
@overload
def Role(resource_name: str,
args: RoleArgs,
opts: Optional[ResourceOptions] = None)
func NewRole(ctx *Context, name string, args RoleArgs, opts ...ResourceOption) (*Role, error)
public Role(string name, RoleArgs args, CustomResourceOptions? opts = null)
type: grafana:Role
properties: # The arguments to resource properties.
options: # 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.
- 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.
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:
- Version int
Version of the role. A role is updated only on version increase.
- 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
- Permissions
List<Lbrlabs.
Pulumi Package. Grafana. Inputs. 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.
- 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
- Permissions
[]Role
Permission Args 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.
- 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
- permissions
List<Role
Permission Args> 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.
- 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
- 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.
- 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
- permissions
Sequence[Role
Permission Args] Specific set of actions granted by the role.
- uid str
Unique identifier of the role. Used for assignments.
- version Number
Version of the role. A role is updated only on version increase.
- 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
- permissions List<Property Map>
Specific set of actions granted by the role.
- uid String
Unique identifier of the role. Used for assignments.
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,
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,
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.
- 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
- Permissions
List<Lbrlabs.
Pulumi Package. Grafana. Inputs. 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.
- 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
- 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.
- 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
- permissions
List<Role
Permission Args> 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.
- 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
- permissions
Role
Permission Args[] 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.
- 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
- 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.
- 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
- 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.
Supporting Types
RolePermission
Import
$ pulumi import grafana:index/role:Role role_name {{uid}}
Package Details
- Repository
- grafana lbrlabs/pulumi-grafana
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
grafana
Terraform Provider.