grafana.cloud.StackServiceAccount
Explore with Pulumi AI
Manages service accounts of a Grafana Cloud stack using the Cloud API This can be used to bootstrap a management service account for a new stack
Required access policy scopes:
- stacks:read
- stack-service-accounts:write
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@pulumiverse/grafana";
const cloudSa = new grafana.cloud.StackServiceAccount("cloud_sa", {
stackSlug: "<your stack slug>",
name: "cloud service account",
role: "Admin",
isDisabled: false,
});
import pulumi
import pulumiverse_grafana as grafana
cloud_sa = grafana.cloud.StackServiceAccount("cloud_sa",
stack_slug="<your stack slug>",
name="cloud service account",
role="Admin",
is_disabled=False)
package main
import (
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
"github.com/pulumiverse/pulumi-grafana/sdk/go/grafana/cloud"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := cloud.NewStackServiceAccount(ctx, "cloud_sa", &cloud.StackServiceAccountArgs{
StackSlug: pulumi.String("<your stack slug>"),
Name: pulumi.String("cloud service account"),
Role: pulumi.String("Admin"),
IsDisabled: pulumi.Bool(false),
})
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 cloudSa = new Grafana.Cloud.StackServiceAccount("cloud_sa", new()
{
StackSlug = "<your stack slug>",
Name = "cloud service account",
Role = "Admin",
IsDisabled = false,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.cloud.StackServiceAccount;
import com.pulumi.grafana.cloud.StackServiceAccountArgs;
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 cloudSa = new StackServiceAccount("cloudSa", StackServiceAccountArgs.builder()
.stackSlug("<your stack slug>")
.name("cloud service account")
.role("Admin")
.isDisabled(false)
.build());
}
}
resources:
cloudSa:
type: grafana:cloud:StackServiceAccount
name: cloud_sa
properties:
stackSlug: <your stack slug>
name: cloud service account
role: Admin
isDisabled: false
Create StackServiceAccount Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new StackServiceAccount(name: string, args: StackServiceAccountArgs, opts?: CustomResourceOptions);
@overload
def StackServiceAccount(resource_name: str,
args: StackServiceAccountArgs,
opts: Optional[ResourceOptions] = None)
@overload
def StackServiceAccount(resource_name: str,
opts: Optional[ResourceOptions] = None,
role: Optional[str] = None,
stack_slug: Optional[str] = None,
is_disabled: Optional[bool] = None,
name: Optional[str] = None)
func NewStackServiceAccount(ctx *Context, name string, args StackServiceAccountArgs, opts ...ResourceOption) (*StackServiceAccount, error)
public StackServiceAccount(string name, StackServiceAccountArgs args, CustomResourceOptions? opts = null)
public StackServiceAccount(String name, StackServiceAccountArgs args)
public StackServiceAccount(String name, StackServiceAccountArgs args, CustomResourceOptions options)
type: grafana:cloud:StackServiceAccount
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name
This property is required. string - The unique name of the resource.
- args
This property is required. StackServiceAccountArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name
This property is required. str - The unique name of the resource.
- args
This property is required. StackServiceAccountArgs - The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. StackServiceAccountArgs - The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name
This property is required. string - The unique name of the resource.
- args
This property is required. StackServiceAccountArgs - The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name
This property is required. String - The unique name of the resource.
- args
This property is required. StackServiceAccountArgs - The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var stackServiceAccountResource = new Grafana.Cloud.StackServiceAccount("stackServiceAccountResource", new()
{
Role = "string",
StackSlug = "string",
IsDisabled = false,
Name = "string",
});
example, err := cloud.NewStackServiceAccount(ctx, "stackServiceAccountResource", &cloud.StackServiceAccountArgs{
Role: pulumi.String("string"),
StackSlug: pulumi.String("string"),
IsDisabled: pulumi.Bool(false),
Name: pulumi.String("string"),
})
var stackServiceAccountResource = new StackServiceAccount("stackServiceAccountResource", StackServiceAccountArgs.builder()
.role("string")
.stackSlug("string")
.isDisabled(false)
.name("string")
.build());
stack_service_account_resource = grafana.cloud.StackServiceAccount("stackServiceAccountResource",
role="string",
stack_slug="string",
is_disabled=False,
name="string")
const stackServiceAccountResource = new grafana.cloud.StackServiceAccount("stackServiceAccountResource", {
role: "string",
stackSlug: "string",
isDisabled: false,
name: "string",
});
type: grafana:cloud:StackServiceAccount
properties:
isDisabled: false
name: string
role: string
stackSlug: string
StackServiceAccount 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 StackServiceAccount resource accepts the following input properties:
- Role
This property is required. Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- Stack
Slug This property is required. Changes to this property will trigger replacement.
- Is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - Name
Changes to this property will trigger replacement.
- The name of the service account.
- Role
This property is required. Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- Stack
Slug This property is required. Changes to this property will trigger replacement.
- Is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - Name
Changes to this property will trigger replacement.
- The name of the service account.
- role
This property is required. Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack
Slug This property is required. Changes to this property will trigger replacement.
- is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
This property is required. Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack
Slug This property is required. Changes to this property will trigger replacement.
- is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
This property is required. Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack_
slug This property is required. Changes to this property will trigger replacement.
- is_
disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
This property is required. Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack
Slug This property is required. Changes to this property will trigger replacement.
- is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
Outputs
All input properties are implicitly available as output properties. Additionally, the StackServiceAccount 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 StackServiceAccount Resource
Get an existing StackServiceAccount 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?: StackServiceAccountState, opts?: CustomResourceOptions): StackServiceAccount
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
is_disabled: Optional[bool] = None,
name: Optional[str] = None,
role: Optional[str] = None,
stack_slug: Optional[str] = None) -> StackServiceAccount
func GetStackServiceAccount(ctx *Context, name string, id IDInput, state *StackServiceAccountState, opts ...ResourceOption) (*StackServiceAccount, error)
public static StackServiceAccount Get(string name, Input<string> id, StackServiceAccountState? state, CustomResourceOptions? opts = null)
public static StackServiceAccount get(String name, Output<String> id, StackServiceAccountState state, CustomResourceOptions options)
resources: _: type: grafana:cloud:StackServiceAccount get: id: ${id}
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - The unique provider ID of the resource to lookup.
- name
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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
This property is required. - The unique name of the resulting resource.
- id
This property is required. - 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.
- Is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - Name
Changes to this property will trigger replacement.
- The name of the service account.
- Role
Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- Stack
Slug Changes to this property will trigger replacement.
- Is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - Name
Changes to this property will trigger replacement.
- The name of the service account.
- Role
Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- Stack
Slug Changes to this property will trigger replacement.
- is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack
Slug Changes to this property will trigger replacement.
- is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack
Slug Changes to this property will trigger replacement.
- is_
disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack_
slug Changes to this property will trigger replacement.
- is
Disabled Changes to this property will trigger replacement.
- The disabled status for the service account. Defaults to
false
. - name
Changes to this property will trigger replacement.
- The name of the service account.
- role
Changes to this property will trigger replacement.
- The basic role of the service account in the organization.
- stack
Slug Changes to this property will trigger replacement.
Import
$ pulumi import grafana:cloud/stackServiceAccount:StackServiceAccount name "{{ stackSlug }}:{{ serviceAccountID }}"
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.