grafana.FolderPermissionItem
Explore with Pulumi AI
Manages a single permission item for a folder. Conflicts with the “grafana.oss.FolderPermission” resource which manages the entire set of permissions for a folder. * Official documentation * HTTP API
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const team = new grafana.oss.Team("team", {name: "Team Name"});
const user = new grafana.oss.User("user", {
email: "user.name@example.com",
login: "user.name",
password: "my-password",
});
const collection = new grafana.oss.Folder("collection", {title: "Folder Title"});
const onRole = new grafana.oss.FolderPermissionItem("on_role", {
folderUid: collection.uid,
role: "Viewer",
permission: "Edit",
});
const onTeam = new grafana.oss.FolderPermissionItem("on_team", {
folderUid: collection.uid,
team: team.id,
permission: "View",
});
const onUser = new grafana.oss.FolderPermissionItem("on_user", {
folderUid: collection.uid,
user: user.id,
permission: "Admin",
});
import pulumi
import pulumiverse_grafana as grafana
team = grafana.oss.Team("team", name="Team Name")
user = grafana.oss.User("user",
email="user.name@example.com",
login="user.name",
password="my-password")
collection = grafana.oss.Folder("collection", title="Folder Title")
on_role = grafana.oss.FolderPermissionItem("on_role",
folder_uid=collection.uid,
role="Viewer",
permission="Edit")
on_team = grafana.oss.FolderPermissionItem("on_team",
folder_uid=collection.uid,
team=team.id,
permission="View")
on_user = grafana.oss.FolderPermissionItem("on_user",
folder_uid=collection.uid,
user=user.id,
permission="Admin")
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/oss"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
team, err := oss.NewTeam(ctx, "team", &oss.TeamArgs{
Name: pulumi.String("Team Name"),
})
if err != nil {
return err
}
user, err := oss.NewUser(ctx, "user", &oss.UserArgs{
Email: pulumi.String("user.name@example.com"),
Login: pulumi.String("user.name"),
Password: pulumi.String("my-password"),
})
if err != nil {
return err
}
collection, err := oss.NewFolder(ctx, "collection", &oss.FolderArgs{
Title: pulumi.String("Folder Title"),
})
if err != nil {
return err
}
_, err = oss.NewFolderPermissionItem(ctx, "on_role", &oss.FolderPermissionItemArgs{
FolderUid: collection.Uid,
Role: pulumi.String("Viewer"),
Permission: pulumi.String("Edit"),
})
if err != nil {
return err
}
_, err = oss.NewFolderPermissionItem(ctx, "on_team", &oss.FolderPermissionItemArgs{
FolderUid: collection.Uid,
Team: team.ID(),
Permission: pulumi.String("View"),
})
if err != nil {
return err
}
_, err = oss.NewFolderPermissionItem(ctx, "on_user", &oss.FolderPermissionItemArgs{
FolderUid: collection.Uid,
User: user.ID(),
Permission: pulumi.String("Admin"),
})
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 team = new Grafana.Oss.Team("team", new()
{
Name = "Team Name",
});
var user = new Grafana.Oss.User("user", new()
{
Email = "user.name@example.com",
Login = "user.name",
Password = "my-password",
});
var collection = new Grafana.Oss.Folder("collection", new()
{
Title = "Folder Title",
});
var onRole = new Grafana.Oss.FolderPermissionItem("on_role", new()
{
FolderUid = collection.Uid,
Role = "Viewer",
Permission = "Edit",
});
var onTeam = new Grafana.Oss.FolderPermissionItem("on_team", new()
{
FolderUid = collection.Uid,
Team = team.Id,
Permission = "View",
});
var onUser = new Grafana.Oss.FolderPermissionItem("on_user", new()
{
FolderUid = collection.Uid,
User = user.Id,
Permission = "Admin",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.Team;
import com.pulumi.grafana.oss.TeamArgs;
import com.pulumi.grafana.oss.User;
import com.pulumi.grafana.oss.UserArgs;
import com.pulumi.grafana.oss.Folder;
import com.pulumi.grafana.oss.FolderArgs;
import com.pulumi.grafana.oss.FolderPermissionItem;
import com.pulumi.grafana.oss.FolderPermissionItemArgs;
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 team = new Team("team", TeamArgs.builder()
.name("Team Name")
.build());
var user = new User("user", UserArgs.builder()
.email("user.name@example.com")
.login("user.name")
.password("my-password")
.build());
var collection = new Folder("collection", FolderArgs.builder()
.title("Folder Title")
.build());
var onRole = new FolderPermissionItem("onRole", FolderPermissionItemArgs.builder()
.folderUid(collection.uid())
.role("Viewer")
.permission("Edit")
.build());
var onTeam = new FolderPermissionItem("onTeam", FolderPermissionItemArgs.builder()
.folderUid(collection.uid())
.team(team.id())
.permission("View")
.build());
var onUser = new FolderPermissionItem("onUser", FolderPermissionItemArgs.builder()
.folderUid(collection.uid())
.user(user.id())
.permission("Admin")
.build());
}
}
resources:
team:
type: grafana:oss:Team
properties:
name: Team Name
user:
type: grafana:oss:User
properties:
email: user.name@example.com
login: user.name
password: my-password
collection:
type: grafana:oss:Folder
properties:
title: Folder Title
onRole:
type: grafana:oss:FolderPermissionItem
name: on_role
properties:
folderUid: ${collection.uid}
role: Viewer
permission: Edit
onTeam:
type: grafana:oss:FolderPermissionItem
name: on_team
properties:
folderUid: ${collection.uid}
team: ${team.id}
permission: View
onUser:
type: grafana:oss:FolderPermissionItem
name: on_user
properties:
folderUid: ${collection.uid}
user: ${user.id}
permission: Admin
Create FolderPermissionItem Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new FolderPermissionItem(name: string, args: FolderPermissionItemArgs, opts?: CustomResourceOptions);
@overload
def FolderPermissionItem(resource_name: str,
args: FolderPermissionItemArgs,
opts: Optional[ResourceOptions] = None)
@overload
def FolderPermissionItem(resource_name: str,
opts: Optional[ResourceOptions] = None,
folder_uid: Optional[str] = None,
org_id: Optional[str] = None,
permission: Optional[str] = None,
role: Optional[str] = None,
team: Optional[str] = None,
user: Optional[str] = None)
func NewFolderPermissionItem(ctx *Context, name string, args FolderPermissionItemArgs, opts ...ResourceOption) (*FolderPermissionItem, error)
public FolderPermissionItem(string name, FolderPermissionItemArgs args, CustomResourceOptions? opts = null)
public FolderPermissionItem(String name, FolderPermissionItemArgs args)
public FolderPermissionItem(String name, FolderPermissionItemArgs args, CustomResourceOptions options)
type: grafana:FolderPermissionItem
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 FolderPermissionItemArgs
- 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 FolderPermissionItemArgs
- 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 FolderPermissionItemArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args FolderPermissionItemArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args FolderPermissionItemArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
FolderPermissionItem 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 FolderPermissionItem resource accepts the following input properties:
- Folder
Uid string - The UID of the folder.
- Permission string
- the permission to be assigned
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Role string
- the role onto which the permission is to be assigned
- Team string
- the team onto which the permission is to be assigned
- User string
- the user or service account onto which the permission is to be assigned
- Folder
Uid string - The UID of the folder.
- Permission string
- the permission to be assigned
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Role string
- the role onto which the permission is to be assigned
- Team string
- the team onto which the permission is to be assigned
- User string
- the user or service account onto which the permission is to be assigned
- folder
Uid String - The UID of the folder.
- permission String
- the permission to be assigned
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- role String
- the role onto which the permission is to be assigned
- team String
- the team onto which the permission is to be assigned
- user String
- the user or service account onto which the permission is to be assigned
- folder
Uid string - The UID of the folder.
- permission string
- the permission to be assigned
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- role string
- the role onto which the permission is to be assigned
- team string
- the team onto which the permission is to be assigned
- user string
- the user or service account onto which the permission is to be assigned
- folder_
uid str - The UID of the folder.
- permission str
- the permission to be assigned
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- role str
- the role onto which the permission is to be assigned
- team str
- the team onto which the permission is to be assigned
- user str
- the user or service account onto which the permission is to be assigned
- folder
Uid String - The UID of the folder.
- permission String
- the permission to be assigned
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- role String
- the role onto which the permission is to be assigned
- team String
- the team onto which the permission is to be assigned
- user String
- the user or service account onto which the permission is to be assigned
Outputs
All input properties are implicitly available as output properties. Additionally, the FolderPermissionItem 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 FolderPermissionItem Resource
Get an existing FolderPermissionItem 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?: FolderPermissionItemState, opts?: CustomResourceOptions): FolderPermissionItem
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
folder_uid: Optional[str] = None,
org_id: Optional[str] = None,
permission: Optional[str] = None,
role: Optional[str] = None,
team: Optional[str] = None,
user: Optional[str] = None) -> FolderPermissionItem
func GetFolderPermissionItem(ctx *Context, name string, id IDInput, state *FolderPermissionItemState, opts ...ResourceOption) (*FolderPermissionItem, error)
public static FolderPermissionItem Get(string name, Input<string> id, FolderPermissionItemState? state, CustomResourceOptions? opts = null)
public static FolderPermissionItem get(String name, Output<String> id, FolderPermissionItemState 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.
- Folder
Uid string - The UID of the folder.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Permission string
- the permission to be assigned
- Role string
- the role onto which the permission is to be assigned
- Team string
- the team onto which the permission is to be assigned
- User string
- the user or service account onto which the permission is to be assigned
- Folder
Uid string - The UID of the folder.
- Org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- Permission string
- the permission to be assigned
- Role string
- the role onto which the permission is to be assigned
- Team string
- the team onto which the permission is to be assigned
- User string
- the user or service account onto which the permission is to be assigned
- folder
Uid String - The UID of the folder.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permission String
- the permission to be assigned
- role String
- the role onto which the permission is to be assigned
- team String
- the team onto which the permission is to be assigned
- user String
- the user or service account onto which the permission is to be assigned
- folder
Uid string - The UID of the folder.
- org
Id string - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permission string
- the permission to be assigned
- role string
- the role onto which the permission is to be assigned
- team string
- the team onto which the permission is to be assigned
- user string
- the user or service account onto which the permission is to be assigned
- folder_
uid str - The UID of the folder.
- org_
id str - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permission str
- the permission to be assigned
- role str
- the role onto which the permission is to be assigned
- team str
- the team onto which the permission is to be assigned
- user str
- the user or service account onto which the permission is to be assigned
- folder
Uid String - The UID of the folder.
- org
Id String - The Organization ID. If not set, the Org ID defined in the provider block will be used.
- permission String
- the permission to be assigned
- role String
- the role onto which the permission is to be assigned
- team String
- the team onto which the permission is to be assigned
- user String
- the user or service account onto which the permission is to be assigned
Import
$ pulumi import grafana:index/folderPermissionItem:FolderPermissionItem name "{{ folderUID }}:{{ type (role, team, or user) }}:{{ identifier }}"
$ pulumi import grafana:index/folderPermissionItem:FolderPermissionItem name "{{ orgID }}:{{ folderUID }}:{{ type (role, team, or user) }}:{{ identifier }}"
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.