grafana.getOrganization

Explore with Pulumi AI

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;
using Grafana = Pulumi.Grafana;

return await Deployment.RunAsync(() => 
{
    var test = new Grafana.Organization("test", new()
    {
        AdminUser = "admin",
        CreateUsers = true,
        Viewers = new[]
        {
            "viewer-01@example.com",
            "viewer-02@example.com",
        },
    });

    var fromName = Grafana.GetOrganization.Invoke(new()
    {
        Name = test.Name,
    });

});
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 {
		test, err := grafana.NewOrganization(ctx, "test", &grafana.OrganizationArgs{
			AdminUser:   pulumi.String("admin"),
			CreateUsers: pulumi.Bool(true),
			Viewers: pulumi.StringArray{
				pulumi.String("viewer-01@example.com"),
				pulumi.String("viewer-02@example.com"),
			},
		})
		if err != nil {
			return err
		}
		_ = grafana.LookupOrganizationOutput(ctx, grafana.GetOrganizationOutputArgs{
			Name: test.Name,
		}, nil)
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.Organization;
import com.pulumi.grafana.OrganizationArgs;
import com.pulumi.grafana.GrafanaFunctions;
import com.pulumi.grafana.inputs.GetOrganizationArgs;
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()        
            .adminUser("admin")
            .createUsers(true)
            .viewers(            
                "viewer-01@example.com",
                "viewer-02@example.com")
            .build());

        final var fromName = GrafanaFunctions.getOrganization(GetOrganizationArgs.builder()
            .name(test.name())
            .build());

    }
}
import pulumi
import lbrlabs_pulumi_grafana as grafana
import pulumi_grafana as grafana

test = grafana.Organization("test",
    admin_user="admin",
    create_users=True,
    viewers=[
        "viewer-01@example.com",
        "viewer-02@example.com",
    ])
from_name = grafana.get_organization_output(name=test.name)
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@lbrlabs/pulumi-grafana";
import * as grafana from "@pulumi/grafana";

const test = new grafana.Organization("test", {
    adminUser: "admin",
    createUsers: true,
    viewers: [
        "viewer-01@example.com",
        "viewer-02@example.com",
    ],
});
const fromName = grafana.getOrganizationOutput({
    name: test.name,
});
resources:
  test:
    type: grafana:Organization
    properties:
      adminUser: admin
      createUsers: true
      viewers:
        - viewer-01@example.com
        - viewer-02@example.com
variables:
  fromName:
    fn::invoke:
      Function: grafana:getOrganization
      Arguments:
        name: ${test.name}

Using getOrganization

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getOrganization(args: GetOrganizationArgs, opts?: InvokeOptions): Promise<GetOrganizationResult>
function getOrganizationOutput(args: GetOrganizationOutputArgs, opts?: InvokeOptions): Output<GetOrganizationResult>
def get_organization(name: Optional[str] = None,
                     opts: Optional[InvokeOptions] = None) -> GetOrganizationResult
def get_organization_output(name: Optional[pulumi.Input[str]] = None,
                     opts: Optional[InvokeOptions] = None) -> Output[GetOrganizationResult]
func LookupOrganization(ctx *Context, args *LookupOrganizationArgs, opts ...InvokeOption) (*LookupOrganizationResult, error)
func LookupOrganizationOutput(ctx *Context, args *LookupOrganizationOutputArgs, opts ...InvokeOption) LookupOrganizationResultOutput

> Note: This function is named LookupOrganization in the Go SDK.

public static class GetOrganization 
{
    public static Task<GetOrganizationResult> InvokeAsync(GetOrganizationArgs args, InvokeOptions? opts = null)
    public static Output<GetOrganizationResult> Invoke(GetOrganizationInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetOrganizationResult> getOrganization(GetOrganizationArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: grafana:index/getOrganization:getOrganization
  arguments:
    # arguments dictionary

The following arguments are supported:

Name string

The name of the Organization.

Name string

The name of the Organization.

name String

The name of the Organization.

name string

The name of the Organization.

name str

The name of the Organization.

name String

The name of the Organization.

getOrganization Result

The following output properties are available:

Admins List<string>

A list of email addresses corresponding to users given admin access to the organization.

Editors List<string>

A list of email addresses corresponding to users given editor access to the organization.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the Organization.

Viewers List<string>

A list of email addresses corresponding to users given viewer access to the organization.

Admins []string

A list of email addresses corresponding to users given admin access to the organization.

Editors []string

A list of email addresses corresponding to users given editor access to the organization.

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the Organization.

Viewers []string

A list of email addresses corresponding to users given viewer access to the organization.

admins List<String>

A list of email addresses corresponding to users given admin access to the organization.

editors List<String>

A list of email addresses corresponding to users given editor access to the organization.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the Organization.

viewers List<String>

A list of email addresses corresponding to users given viewer access to the organization.

admins string[]

A list of email addresses corresponding to users given admin access to the organization.

editors string[]

A list of email addresses corresponding to users given editor access to the organization.

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the Organization.

viewers string[]

A list of email addresses corresponding to users given viewer access to the organization.

admins Sequence[str]

A list of email addresses corresponding to users given admin access to the organization.

editors Sequence[str]

A list of email addresses corresponding to users given editor access to the organization.

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the Organization.

viewers Sequence[str]

A list of email addresses corresponding to users given viewer access to the organization.

admins List<String>

A list of email addresses corresponding to users given admin access to the organization.

editors List<String>

A list of email addresses corresponding to users given editor access to the organization.

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the Organization.

viewers List<String>

A list of email addresses corresponding to users given viewer access to the organization.

Package Details

Repository
grafana lbrlabs/pulumi-grafana
License
Apache-2.0
Notes

This Pulumi package is based on the grafana Terraform Provider.