
Grafana v0.0.10, May 21 23

Grafana v0.0.10, May 21 23
grafana.ServiceAccountToken
Explore with Pulumi AI
Note: This resource is available only with Grafana 9.1+.
Example Usage
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Grafana = Lbrlabs.PulumiPackage.Grafana;
return await Deployment.RunAsync(() =>
{
var foo = new Grafana.ServiceAccountToken("foo", new()
{
ServiceAccountId = "1",
});
var bar = new Grafana.ServiceAccountToken("bar", new()
{
ServiceAccountId = "1",
SecondsToLive = 30,
});
return new Dictionary<string, object?>
{
["serviceAccountTokenFooKeyOnly"] = foo.Key,
["serviceAccountTokenBar"] = bar,
};
});
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 {
foo, err := grafana.NewServiceAccountToken(ctx, "foo", &grafana.ServiceAccountTokenArgs{
ServiceAccountId: pulumi.String("1"),
})
if err != nil {
return err
}
bar, err := grafana.NewServiceAccountToken(ctx, "bar", &grafana.ServiceAccountTokenArgs{
ServiceAccountId: pulumi.String("1"),
SecondsToLive: pulumi.Int(30),
})
if err != nil {
return err
}
ctx.Export("serviceAccountTokenFooKeyOnly", foo.Key)
ctx.Export("serviceAccountTokenBar", bar)
return nil
})
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.grafana.ServiceAccountToken;
import com.pulumi.grafana.ServiceAccountTokenArgs;
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 foo = new ServiceAccountToken("foo", ServiceAccountTokenArgs.builder()
.serviceAccountId(1)
.build());
var bar = new ServiceAccountToken("bar", ServiceAccountTokenArgs.builder()
.serviceAccountId(1)
.secondsToLive(30)
.build());
ctx.export("serviceAccountTokenFooKeyOnly", foo.key());
ctx.export("serviceAccountTokenBar", bar);
}
}
import pulumi
import lbrlabs_pulumi_grafana as grafana
foo = grafana.ServiceAccountToken("foo", service_account_id="1")
bar = grafana.ServiceAccountToken("bar",
service_account_id="1",
seconds_to_live=30)
pulumi.export("serviceAccountTokenFooKeyOnly", foo.key)
pulumi.export("serviceAccountTokenBar", bar)
import * as pulumi from "@pulumi/pulumi";
import * as grafana from "@lbrlabs/pulumi-grafana";
const foo = new grafana.ServiceAccountToken("foo", {serviceAccountId: "1"});
const bar = new grafana.ServiceAccountToken("bar", {
serviceAccountId: "1",
secondsToLive: 30,
});
export const serviceAccountTokenFooKeyOnly = foo.key;
export const serviceAccountTokenBar = bar;
resources:
foo:
type: grafana:ServiceAccountToken
properties:
serviceAccountId: 1
bar:
type: grafana:ServiceAccountToken
properties:
serviceAccountId: 1
secondsToLive: 30
outputs:
serviceAccountTokenFooKeyOnly: ${foo.key}
serviceAccountTokenBar: ${bar}
Create ServiceAccountToken Resource
new ServiceAccountToken(name: string, args: ServiceAccountTokenArgs, opts?: CustomResourceOptions);
@overload
def ServiceAccountToken(resource_name: str,
opts: Optional[ResourceOptions] = None,
name: Optional[str] = None,
seconds_to_live: Optional[int] = None,
service_account_id: Optional[str] = None)
@overload
def ServiceAccountToken(resource_name: str,
args: ServiceAccountTokenArgs,
opts: Optional[ResourceOptions] = None)
func NewServiceAccountToken(ctx *Context, name string, args ServiceAccountTokenArgs, opts ...ResourceOption) (*ServiceAccountToken, error)
public ServiceAccountToken(string name, ServiceAccountTokenArgs args, CustomResourceOptions? opts = null)
public ServiceAccountToken(String name, ServiceAccountTokenArgs args)
public ServiceAccountToken(String name, ServiceAccountTokenArgs args, CustomResourceOptions options)
type: grafana:ServiceAccountToken
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceAccountTokenArgs
- 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 ServiceAccountTokenArgs
- 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 ServiceAccountTokenArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ServiceAccountTokenArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ServiceAccountTokenArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
ServiceAccountToken Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The ServiceAccountToken resource accepts the following input properties:
- Service
Account stringId - Name string
- Seconds
To intLive
- Service
Account stringId - Name string
- Seconds
To intLive
- service
Account StringId - name String
- seconds
To IntegerLive
- service
Account stringId - name string
- seconds
To numberLive
- service_
account_ strid - name str
- seconds_
to_ intlive
- service
Account StringId - name String
- seconds
To NumberLive
Outputs
All input properties are implicitly available as output properties. Additionally, the ServiceAccountToken resource produces the following output properties:
- Expiration string
- Has
Expired bool - Id string
The provider-assigned unique ID for this managed resource.
- Key string
- Expiration string
- Has
Expired bool - Id string
The provider-assigned unique ID for this managed resource.
- Key string
- expiration String
- has
Expired Boolean - id String
The provider-assigned unique ID for this managed resource.
- key String
- expiration string
- has
Expired boolean - id string
The provider-assigned unique ID for this managed resource.
- key string
- expiration str
- has_
expired bool - id str
The provider-assigned unique ID for this managed resource.
- key str
- expiration String
- has
Expired Boolean - id String
The provider-assigned unique ID for this managed resource.
- key String
Look up Existing ServiceAccountToken Resource
Get an existing ServiceAccountToken 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?: ServiceAccountTokenState, opts?: CustomResourceOptions): ServiceAccountToken
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
expiration: Optional[str] = None,
has_expired: Optional[bool] = None,
key: Optional[str] = None,
name: Optional[str] = None,
seconds_to_live: Optional[int] = None,
service_account_id: Optional[str] = None) -> ServiceAccountToken
func GetServiceAccountToken(ctx *Context, name string, id IDInput, state *ServiceAccountTokenState, opts ...ResourceOption) (*ServiceAccountToken, error)
public static ServiceAccountToken Get(string name, Input<string> id, ServiceAccountTokenState? state, CustomResourceOptions? opts = null)
public static ServiceAccountToken get(String name, Output<String> id, ServiceAccountTokenState 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.
- Expiration string
- Has
Expired bool - Key string
- Name string
- Seconds
To intLive - Service
Account stringId
- Expiration string
- Has
Expired bool - Key string
- Name string
- Seconds
To intLive - Service
Account stringId
- expiration String
- has
Expired Boolean - key String
- name String
- seconds
To IntegerLive - service
Account StringId
- expiration string
- has
Expired boolean - key string
- name string
- seconds
To numberLive - service
Account stringId
- expiration str
- has_
expired bool - key str
- name str
- seconds_
to_ intlive - service_
account_ strid
- expiration String
- has
Expired Boolean - key String
- name String
- seconds
To NumberLive - service
Account StringId
Package Details
- Repository
- grafana lbrlabs/pulumi-grafana
- License
- Apache-2.0
- Notes
This Pulumi package is based on the
grafana
Terraform Provider.