1. Packages
  2. Grafana Cloud
  3. API Docs
  4. oss
  5. getServiceAccount
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

grafana.oss.getServiceAccount

Explore with Pulumi AI

Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumi/grafana";
import * as grafana from "@pulumiverse/grafana";

const adminServiceAccount = new grafana.oss.ServiceAccount("admin", {
    name: "admin sa",
    role: "Admin",
    isDisabled: false,
});
const admin = grafana.oss.getServiceAccountOutput({
    name: adminServiceAccount.name,
});
Copy
import pulumi
import pulumi_grafana as grafana
import pulumiverse_grafana as grafana

admin_service_account = grafana.oss.ServiceAccount("admin",
    name="admin sa",
    role="Admin",
    is_disabled=False)
admin = grafana.oss.get_service_account_output(name=admin_service_account.name)
Copy
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 {
		adminServiceAccount, err := oss.NewServiceAccount(ctx, "admin", &oss.ServiceAccountArgs{
			Name:       pulumi.String("admin sa"),
			Role:       pulumi.String("Admin"),
			IsDisabled: pulumi.Bool(false),
		})
		if err != nil {
			return err
		}
		_ = oss.LookupServiceAccountOutput(ctx, oss.GetServiceAccountOutputArgs{
			Name: adminServiceAccount.Name,
		}, nil)
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Pulumi.Grafana;
using Grafana = Pulumiverse.Grafana;

return await Deployment.RunAsync(() => 
{
    var adminServiceAccount = new Grafana.Oss.ServiceAccount("admin", new()
    {
        Name = "admin sa",
        Role = "Admin",
        IsDisabled = false,
    });

    var admin = Grafana.Oss.GetServiceAccount.Invoke(new()
    {
        Name = adminServiceAccount.Name,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.oss.ServiceAccount;
import com.pulumi.grafana.oss.ServiceAccountArgs;
import com.pulumi.grafana.oss.OssFunctions;
import com.pulumi.grafana.oss.inputs.GetServiceAccountArgs;
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 adminServiceAccount = new ServiceAccount("adminServiceAccount", ServiceAccountArgs.builder()
            .name("admin sa")
            .role("Admin")
            .isDisabled(false)
            .build());

        final var admin = OssFunctions.getServiceAccount(GetServiceAccountArgs.builder()
            .name(adminServiceAccount.name())
            .build());

    }
}
Copy
resources:
  adminServiceAccount:
    type: grafana:oss:ServiceAccount
    name: admin
    properties:
      name: admin sa
      role: Admin
      isDisabled: false
variables:
  admin:
    fn::invoke:
      function: grafana:oss:getServiceAccount
      arguments:
        name: ${adminServiceAccount.name}
Copy

Using getServiceAccount

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 getServiceAccount(args: GetServiceAccountArgs, opts?: InvokeOptions): Promise<GetServiceAccountResult>
function getServiceAccountOutput(args: GetServiceAccountOutputArgs, opts?: InvokeOptions): Output<GetServiceAccountResult>
Copy
def get_service_account(name: Optional[str] = None,
                        org_id: Optional[str] = None,
                        opts: Optional[InvokeOptions] = None) -> GetServiceAccountResult
def get_service_account_output(name: Optional[pulumi.Input[str]] = None,
                        org_id: Optional[pulumi.Input[str]] = None,
                        opts: Optional[InvokeOptions] = None) -> Output[GetServiceAccountResult]
Copy
func LookupServiceAccount(ctx *Context, args *LookupServiceAccountArgs, opts ...InvokeOption) (*LookupServiceAccountResult, error)
func LookupServiceAccountOutput(ctx *Context, args *LookupServiceAccountOutputArgs, opts ...InvokeOption) LookupServiceAccountResultOutput
Copy

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

public static class GetServiceAccount 
{
    public static Task<GetServiceAccountResult> InvokeAsync(GetServiceAccountArgs args, InvokeOptions? opts = null)
    public static Output<GetServiceAccountResult> Invoke(GetServiceAccountInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetServiceAccountResult> getServiceAccount(GetServiceAccountArgs args, InvokeOptions options)
public static Output<GetServiceAccountResult> getServiceAccount(GetServiceAccountArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: grafana:oss/getServiceAccount:getServiceAccount
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Name This property is required. string
The name of the Service Account.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
Name This property is required. string
The name of the Service Account.
OrgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
name This property is required. String
The name of the Service Account.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
name This property is required. string
The name of the Service Account.
orgId Changes to this property will trigger replacement. string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
name This property is required. str
The name of the Service Account.
org_id Changes to this property will trigger replacement. str
The Organization ID. If not set, the Org ID defined in the provider block will be used.
name This property is required. String
The name of the Service Account.
orgId Changes to this property will trigger replacement. String
The Organization ID. If not set, the Org ID defined in the provider block will be used.

getServiceAccount Result

The following output properties are available:

Id string
The provider-assigned unique ID for this managed resource.
IsDisabled bool
The disabled status for the service account.
Name string
The name of the Service Account.
Role string
The basic role of the service account in the organization.
OrgId string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
Id string
The provider-assigned unique ID for this managed resource.
IsDisabled bool
The disabled status for the service account.
Name string
The name of the Service Account.
Role string
The basic role of the service account in the organization.
OrgId string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
id String
The provider-assigned unique ID for this managed resource.
isDisabled Boolean
The disabled status for the service account.
name String
The name of the Service Account.
role String
The basic role of the service account in the organization.
orgId String
The Organization ID. If not set, the Org ID defined in the provider block will be used.
id string
The provider-assigned unique ID for this managed resource.
isDisabled boolean
The disabled status for the service account.
name string
The name of the Service Account.
role string
The basic role of the service account in the organization.
orgId string
The Organization ID. If not set, the Org ID defined in the provider block will be used.
id str
The provider-assigned unique ID for this managed resource.
is_disabled bool
The disabled status for the service account.
name str
The name of the Service Account.
role str
The basic role of the service account in the organization.
org_id str
The Organization ID. If not set, the Org ID defined in the provider block will be used.
id String
The provider-assigned unique ID for this managed resource.
isDisabled Boolean
The disabled status for the service account.
name String
The name of the Service Account.
role String
The basic role of the service account in the organization.
orgId String
The Organization ID. If not set, the Org ID defined in the provider block will be used.

Package Details

Repository
grafana pulumiverse/pulumi-grafana
License
Apache-2.0
Notes
This Pulumi package is based on the grafana Terraform Provider.
Grafana v0.16.3 published on Monday, Apr 7, 2025 by pulumiverse