1. Packages
  2. Grafana Cloud
  3. API Docs
  4. Organization
Grafana v0.7.0 published on Tuesday, Nov 5, 2024 by pulumiverse

grafana.Organization

Explore with Pulumi AI

grafana logo
Grafana v0.7.0 published on Tuesday, Nov 5, 2024 by pulumiverse
    Deprecated: grafana.index/organization.Organization has been deprecated in favor of grafana.oss/organization.Organization

    This resource represents an instance-scoped resource and uses Grafana’s admin APIs. It does not work with API tokens or service accounts which are org-scoped. You must use basic auth.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as grafana from "@pulumiverse/grafana";
    
    const test = new grafana.oss.Organization("test", {
        name: "Test Organization",
        adminUser: "admin",
        createUsers: true,
        admins: ["admin@example.com"],
        editors: [
            "editor-01@example.com",
            "editor-02@example.com",
        ],
        viewers: [
            "viewer-01@example.com",
            "viewer-02@example.com",
        ],
    });
    
    import pulumi
    import pulumiverse_grafana as grafana
    
    test = grafana.oss.Organization("test",
        name="Test Organization",
        admin_user="admin",
        create_users=True,
        admins=["admin@example.com"],
        editors=[
            "editor-01@example.com",
            "editor-02@example.com",
        ],
        viewers=[
            "viewer-01@example.com",
            "viewer-02@example.com",
        ])
    
    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 {
    		_, err := oss.NewOrganization(ctx, "test", &oss.OrganizationArgs{
    			Name:        pulumi.String("Test Organization"),
    			AdminUser:   pulumi.String("admin"),
    			CreateUsers: pulumi.Bool(true),
    			Admins: pulumi.StringArray{
    				pulumi.String("admin@example.com"),
    			},
    			Editors: pulumi.StringArray{
    				pulumi.String("editor-01@example.com"),
    				pulumi.String("editor-02@example.com"),
    			},
    			Viewers: pulumi.StringArray{
    				pulumi.String("viewer-01@example.com"),
    				pulumi.String("viewer-02@example.com"),
    			},
    		})
    		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 test = new Grafana.Oss.Organization("test", new()
        {
            Name = "Test Organization",
            AdminUser = "admin",
            CreateUsers = true,
            Admins = new[]
            {
                "admin@example.com",
            },
            Editors = new[]
            {
                "editor-01@example.com",
                "editor-02@example.com",
            },
            Viewers = new[]
            {
                "viewer-01@example.com",
                "viewer-02@example.com",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.grafana.oss.Organization;
    import com.pulumi.grafana.oss.OrganizationArgs;
    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 test = new Organization("test", OrganizationArgs.builder()
                .name("Test Organization")
                .adminUser("admin")
                .createUsers(true)
                .admins("admin@example.com")
                .editors(            
                    "editor-01@example.com",
                    "editor-02@example.com")
                .viewers(            
                    "viewer-01@example.com",
                    "viewer-02@example.com")
                .build());
    
        }
    }
    
    resources:
      test:
        type: grafana:oss:Organization
        properties:
          name: Test Organization
          adminUser: admin
          createUsers: true
          admins:
            - admin@example.com
          editors:
            - editor-01@example.com
            - editor-02@example.com
          viewers:
            - viewer-01@example.com
            - viewer-02@example.com
    

    Create Organization Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new Organization(name: string, args?: OrganizationArgs, opts?: CustomResourceOptions);
    @overload
    def Organization(resource_name: str,
                     args: Optional[OrganizationArgs] = None,
                     opts: Optional[ResourceOptions] = None)
    
    @overload
    def Organization(resource_name: str,
                     opts: Optional[ResourceOptions] = None,
                     admin_user: Optional[str] = None,
                     admins: Optional[Sequence[str]] = None,
                     create_users: Optional[bool] = None,
                     editors: Optional[Sequence[str]] = None,
                     name: Optional[str] = None,
                     users_without_accesses: Optional[Sequence[str]] = None,
                     viewers: Optional[Sequence[str]] = None)
    func NewOrganization(ctx *Context, name string, args *OrganizationArgs, opts ...ResourceOption) (*Organization, error)
    public Organization(string name, OrganizationArgs? args = null, CustomResourceOptions? opts = null)
    public Organization(String name, OrganizationArgs args)
    public Organization(String name, OrganizationArgs args, CustomResourceOptions options)
    
    type: grafana:Organization
    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 OrganizationArgs
    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 OrganizationArgs
    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 OrganizationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args OrganizationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args OrganizationArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Organization 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 Organization resource accepts the following input properties:

    AdminUser string
    Admins List<string>
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    CreateUsers bool
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    Editors List<string>
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    Name string
    The display name for the Grafana organization created.
    UsersWithoutAccesses List<string>
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    Viewers List<string>
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    AdminUser string
    Admins []string
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    CreateUsers bool
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    Editors []string
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    Name string
    The display name for the Grafana organization created.
    UsersWithoutAccesses []string
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    Viewers []string
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    adminUser String
    admins List<String>
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    createUsers Boolean
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors List<String>
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name String
    The display name for the Grafana organization created.
    usersWithoutAccesses List<String>
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers List<String>
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    adminUser string
    admins string[]
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    createUsers boolean
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors string[]
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name string
    The display name for the Grafana organization created.
    usersWithoutAccesses string[]
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers string[]
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    admin_user str
    admins Sequence[str]
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    create_users bool
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors Sequence[str]
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name str
    The display name for the Grafana organization created.
    users_without_accesses Sequence[str]
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers Sequence[str]
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    adminUser String
    admins List<String>
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    createUsers Boolean
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors List<String>
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name String
    The display name for the Grafana organization created.
    usersWithoutAccesses List<String>
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers List<String>
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the Organization resource produces the following output properties:

    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId int
    The organization id assigned to this organization by Grafana.
    Id string
    The provider-assigned unique ID for this managed resource.
    OrgId int
    The organization id assigned to this organization by Grafana.
    id String
    The provider-assigned unique ID for this managed resource.
    orgId Integer
    The organization id assigned to this organization by Grafana.
    id string
    The provider-assigned unique ID for this managed resource.
    orgId number
    The organization id assigned to this organization by Grafana.
    id str
    The provider-assigned unique ID for this managed resource.
    org_id int
    The organization id assigned to this organization by Grafana.
    id String
    The provider-assigned unique ID for this managed resource.
    orgId Number
    The organization id assigned to this organization by Grafana.

    Look up Existing Organization Resource

    Get an existing Organization 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?: OrganizationState, opts?: CustomResourceOptions): Organization
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            admin_user: Optional[str] = None,
            admins: Optional[Sequence[str]] = None,
            create_users: Optional[bool] = None,
            editors: Optional[Sequence[str]] = None,
            name: Optional[str] = None,
            org_id: Optional[int] = None,
            users_without_accesses: Optional[Sequence[str]] = None,
            viewers: Optional[Sequence[str]] = None) -> Organization
    func GetOrganization(ctx *Context, name string, id IDInput, state *OrganizationState, opts ...ResourceOption) (*Organization, error)
    public static Organization Get(string name, Input<string> id, OrganizationState? state, CustomResourceOptions? opts = null)
    public static Organization get(String name, Output<String> id, OrganizationState 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.
    The following state arguments are supported:
    AdminUser string
    Admins List<string>
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    CreateUsers bool
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    Editors List<string>
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    Name string
    The display name for the Grafana organization created.
    OrgId int
    The organization id assigned to this organization by Grafana.
    UsersWithoutAccesses List<string>
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    Viewers List<string>
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    AdminUser string
    Admins []string
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    CreateUsers bool
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    Editors []string
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    Name string
    The display name for the Grafana organization created.
    OrgId int
    The organization id assigned to this organization by Grafana.
    UsersWithoutAccesses []string
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    Viewers []string
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    adminUser String
    admins List<String>
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    createUsers Boolean
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors List<String>
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name String
    The display name for the Grafana organization created.
    orgId Integer
    The organization id assigned to this organization by Grafana.
    usersWithoutAccesses List<String>
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers List<String>
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    adminUser string
    admins string[]
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    createUsers boolean
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors string[]
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name string
    The display name for the Grafana organization created.
    orgId number
    The organization id assigned to this organization by Grafana.
    usersWithoutAccesses string[]
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers string[]
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    admin_user str
    admins Sequence[str]
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    create_users bool
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors Sequence[str]
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name str
    The display name for the Grafana organization created.
    org_id int
    The organization id assigned to this organization by Grafana.
    users_without_accesses Sequence[str]
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers Sequence[str]
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    adminUser String
    admins List<String>
    A list of email addresses corresponding to users who should be given admin access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    createUsers Boolean
    Whether or not to create Grafana users specified in the organization's membership if they don't already exist in Grafana. If unspecified, this parameter defaults to true, creating placeholder users with the name, login, and email set to the email of the user, and a random password. Setting this option to false will cause an error to be thrown for any users that do not already exist in Grafana. Defaults to true.
    editors List<String>
    A list of email addresses corresponding to users who should be given editor access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.
    name String
    The display name for the Grafana organization created.
    orgId Number
    The organization id assigned to this organization by Grafana.
    usersWithoutAccesses List<String>
    A list of email addresses corresponding to users who should be given none access to the organization. Note: users specified here must already exist in Grafana, unless 'create_users' is set to true. This feature is only available in Grafana 10.2+.
    viewers List<String>
    A list of email addresses corresponding to users who should be given viewer access to the organization. Note: users specified here must already exist in Grafana unless 'create_users' is set to true.

    Import

    $ pulumi import grafana:index/organization:Organization name "{{ id }}"
    

    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.
    grafana logo
    Grafana v0.7.0 published on Tuesday, Nov 5, 2024 by pulumiverse