1. Packages
  2. Packages
  3. Chronosphere
  4. API Docs
  5. ServiceAccount
Viewing docs for Chronosphere v0.9.16
published on Friday, Jun 5, 2026 by Chronosphere
Viewing docs for Chronosphere v0.9.16
published on Friday, Jun 5, 2026 by Chronosphere

    A non-human identity used to authenticate API requests against Chronosphere. An API token is generated at creation and returned only once; store it securely, as a lost token requires recreating the service account.

    Example Usage

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Pulumi = Chronosphere.Pulumi;
    
    return await Deployment.RunAsync(() => 
    {
        var unrestricted = new Pulumi.ServiceAccount("unrestricted", new()
        {
            Name = "ci-deployer",
            Unrestricted = true,
        });
    
        var restrictedReadOnly = new Pulumi.ServiceAccount("restrictedReadOnly", new()
        {
            Name = "metrics-reader",
            Restriction = new Pulumi.Inputs.ServiceAccountRestrictionArgs
            {
                Labels = 
                {
                    { "team", "platform" },
                },
                Permission = "READ_ONLY",
            },
        });
    
    });
    
    package main
    
    import (
    	"github.com/chronosphereio/pulumi-chronosphere/sdk/go/chronosphere"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := chronosphere.NewServiceAccount(ctx, "unrestricted", &chronosphere.ServiceAccountArgs{
    			Name:         pulumi.String("ci-deployer"),
    			Unrestricted: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = chronosphere.NewServiceAccount(ctx, "restrictedReadOnly", &chronosphere.ServiceAccountArgs{
    			Name: pulumi.String("metrics-reader"),
    			Restriction: &chronosphere.ServiceAccountRestrictionArgs{
    				Labels: pulumi.StringMap{
    					"team": pulumi.String("platform"),
    				},
    				Permission: pulumi.String("READ_ONLY"),
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    

    Example coming soon!

    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.chronosphere.ServiceAccount;
    import com.pulumi.chronosphere.ServiceAccountArgs;
    import com.pulumi.chronosphere.inputs.ServiceAccountRestrictionArgs;
    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 unrestricted = new ServiceAccount("unrestricted", ServiceAccountArgs.builder()        
                .name("ci-deployer")
                .unrestricted(true)
                .build());
    
            var restrictedReadOnly = new ServiceAccount("restrictedReadOnly", ServiceAccountArgs.builder()        
                .name("metrics-reader")
                .restriction(ServiceAccountRestrictionArgs.builder()
                    .labels(Map.of("team", "platform"))
                    .permission("READ_ONLY")
                    .build())
                .build());
    
        }
    }
    
    import * as pulumi from "@pulumi/pulumi";
    import * as chronosphere from "@pulumi-chronosphere/pulumi-chronosphere";
    
    const unrestricted = new chronosphere.ServiceAccount("unrestricted", {
        name: "ci-deployer",
        unrestricted: true,
    });
    const restrictedReadOnly = new chronosphere.ServiceAccount("restrictedReadOnly", {
        name: "metrics-reader",
        restriction: {
            labels: {
                team: "platform",
            },
            permission: "READ_ONLY",
        },
    });
    
    import pulumi
    import pulumi_chronosphere as chronosphere
    
    unrestricted = chronosphere.ServiceAccount("unrestricted",
        name="ci-deployer",
        unrestricted=True)
    restricted_read_only = chronosphere.ServiceAccount("restrictedReadOnly",
        name="metrics-reader",
        restriction=chronosphere.ServiceAccountRestrictionArgs(
            labels={
                "team": "platform",
            },
            permission="READ_ONLY",
        ))
    
    resources:
      unrestricted:
        type: chronosphere:ServiceAccount
        properties:
          name: ci-deployer
          unrestricted: true
      restrictedReadOnly:
        type: chronosphere:ServiceAccount
        properties:
          name: metrics-reader
          restriction:
            labels:
              team: platform
            permission: READ_ONLY
    

    Create ServiceAccount Resource

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

    Constructor syntax

    new ServiceAccount(name: string, args: ServiceAccountArgs, opts?: CustomResourceOptions);
    @overload
    def ServiceAccount(resource_name: str,
                       args: ServiceAccountArgs,
                       opts: Optional[ResourceOptions] = None)
    
    @overload
    def ServiceAccount(resource_name: str,
                       opts: Optional[ResourceOptions] = None,
                       name: Optional[str] = None,
                       restriction: Optional[ServiceAccountRestrictionArgs] = None,
                       slug: Optional[str] = None,
                       unrestricted: Optional[bool] = None)
    func NewServiceAccount(ctx *Context, name string, args ServiceAccountArgs, opts ...ResourceOption) (*ServiceAccount, error)
    public ServiceAccount(string name, ServiceAccountArgs args, CustomResourceOptions? opts = null)
    public ServiceAccount(String name, ServiceAccountArgs args)
    public ServiceAccount(String name, ServiceAccountArgs args, CustomResourceOptions options)
    
    type: chronosphere:ServiceAccount
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "chronosphere_serviceaccount" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args ServiceAccountArgs
    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 ServiceAccountArgs
    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 ServiceAccountArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ServiceAccountArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args ServiceAccountArgs
    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 serviceAccountResource = new Pulumi.ServiceAccount("serviceAccountResource", new()
    {
        Name = "string",
        Restriction = new Pulumi.Inputs.ServiceAccountRestrictionArgs
        {
            Permission = "string",
            Labels = 
            {
                { "string", "string" },
            },
        },
        Slug = "string",
        Unrestricted = false,
    });
    
    example, err := chronosphere.NewServiceAccount(ctx, "serviceAccountResource", &chronosphere.ServiceAccountArgs{
    	Name: pulumi.String("string"),
    	Restriction: &chronosphere.ServiceAccountRestrictionArgs{
    		Permission: pulumi.String("string"),
    		Labels: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    	},
    	Slug:         pulumi.String("string"),
    	Unrestricted: pulumi.Bool(false),
    })
    
    resource "chronosphere_serviceaccount" "serviceAccountResource" {
      name = "string"
      restriction = {
        permission = "string"
        labels = {
          "string" = "string"
        }
      }
      slug         = "string"
      unrestricted = false
    }
    
    var serviceAccountResource = new ServiceAccount("serviceAccountResource", ServiceAccountArgs.builder()
        .name("string")
        .restriction(ServiceAccountRestrictionArgs.builder()
            .permission("string")
            .labels(Map.of("string", "string"))
            .build())
        .slug("string")
        .unrestricted(false)
        .build());
    
    service_account_resource = chronosphere.ServiceAccount("serviceAccountResource",
        name="string",
        restriction={
            "permission": "string",
            "labels": {
                "string": "string",
            },
        },
        slug="string",
        unrestricted=False)
    
    const serviceAccountResource = new chronosphere.ServiceAccount("serviceAccountResource", {
        name: "string",
        restriction: {
            permission: "string",
            labels: {
                string: "string",
            },
        },
        slug: "string",
        unrestricted: false,
    });
    
    type: chronosphere:ServiceAccount
    properties:
        name: string
        restriction:
            labels:
                string: string
            permission: string
        slug: string
        unrestricted: false
    

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

    Name string
    Display name of the service account. Immutable after creation.
    Restriction Chronosphere.Pulumi.Inputs.ServiceAccountRestriction
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    Slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    Unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    Name string
    Display name of the service account. Immutable after creation.
    Restriction ServiceAccountRestrictionArgs
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    Slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    Unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    name string
    Display name of the service account. Immutable after creation.
    restriction object
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    name String
    Display name of the service account. Immutable after creation.
    restriction ServiceAccountRestriction
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug String
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    unrestricted Boolean
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    name string
    Display name of the service account. Immutable after creation.
    restriction ServiceAccountRestriction
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    unrestricted boolean
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    name str
    Display name of the service account. Immutable after creation.
    restriction ServiceAccountRestrictionArgs
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug str
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    name String
    Display name of the service account. Immutable after creation.
    restriction Property Map
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug String
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    unrestricted Boolean
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.

    Outputs

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

    Email string
    Read-only: synthetic email address assigned to the service account by the server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    Email string
    Read-only: synthetic email address assigned to the service account by the server.
    Id string
    The provider-assigned unique ID for this managed resource.
    Token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    email string
    Read-only: synthetic email address assigned to the service account by the server.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    email String
    Read-only: synthetic email address assigned to the service account by the server.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    email string
    Read-only: synthetic email address assigned to the service account by the server.
    id string
    The provider-assigned unique ID for this managed resource.
    token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    email str
    Read-only: synthetic email address assigned to the service account by the server.
    id str
    The provider-assigned unique ID for this managed resource.
    token str
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    email String
    Read-only: synthetic email address assigned to the service account by the server.
    id String
    The provider-assigned unique ID for this managed resource.
    token String
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.

    Look up Existing ServiceAccount Resource

    Get an existing ServiceAccount 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?: ServiceAccountState, opts?: CustomResourceOptions): ServiceAccount
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            email: Optional[str] = None,
            name: Optional[str] = None,
            restriction: Optional[ServiceAccountRestrictionArgs] = None,
            slug: Optional[str] = None,
            token: Optional[str] = None,
            unrestricted: Optional[bool] = None) -> ServiceAccount
    func GetServiceAccount(ctx *Context, name string, id IDInput, state *ServiceAccountState, opts ...ResourceOption) (*ServiceAccount, error)
    public static ServiceAccount Get(string name, Input<string> id, ServiceAccountState? state, CustomResourceOptions? opts = null)
    public static ServiceAccount get(String name, Output<String> id, ServiceAccountState state, CustomResourceOptions options)
    resources:  _:    type: chronosphere:ServiceAccount    get:      id: ${id}
    import {
      to = chronosphere_serviceaccount.example
      id = "${id}"
    }
    
    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:
    Email string
    Read-only: synthetic email address assigned to the service account by the server.
    Name string
    Display name of the service account. Immutable after creation.
    Restriction Chronosphere.Pulumi.Inputs.ServiceAccountRestriction
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    Slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    Token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    Unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    Email string
    Read-only: synthetic email address assigned to the service account by the server.
    Name string
    Display name of the service account. Immutable after creation.
    Restriction ServiceAccountRestrictionArgs
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    Slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    Token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    Unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    email string
    Read-only: synthetic email address assigned to the service account by the server.
    name string
    Display name of the service account. Immutable after creation.
    restriction object
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    email String
    Read-only: synthetic email address assigned to the service account by the server.
    name String
    Display name of the service account. Immutable after creation.
    restriction ServiceAccountRestriction
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug String
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    token String
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    unrestricted Boolean
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    email string
    Read-only: synthetic email address assigned to the service account by the server.
    name string
    Display name of the service account. Immutable after creation.
    restriction ServiceAccountRestriction
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug string
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    token string
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    unrestricted boolean
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    email str
    Read-only: synthetic email address assigned to the service account by the server.
    name str
    Display name of the service account. Immutable after creation.
    restriction ServiceAccountRestrictionArgs
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug str
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    token str
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    unrestricted bool
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.
    email String
    Read-only: synthetic email address assigned to the service account by the server.
    name String
    Display name of the service account. Immutable after creation.
    restriction Property Map
    Restricts the service account to a specific permission and optional metric label scope. Exactly one of unrestricted or restriction must be set.
    slug String
    Stable identifier for the service account. Generated from name if omitted. Immutable after creation.
    token String
    Read-only: API token generated for the service account. Returned only at creation time; store it securely. If lost, the service account must be recreated.
    unrestricted Boolean
    If true, grants the service account access to all Chronosphere APIs within the access controls defined by team membership. Exactly one of unrestricted or restriction must be set.

    Supporting Types

    ServiceAccountRestriction, ServiceAccountRestrictionArgs

    Permission string
    Permission level granted by this restriction (e.g. metric read/write).
    Labels Dictionary<string, string>
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.
    Permission string
    Permission level granted by this restriction (e.g. metric read/write).
    Labels map[string]string
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.
    permission string
    Permission level granted by this restriction (e.g. metric read/write).
    labels map(string)
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.
    permission String
    Permission level granted by this restriction (e.g. metric read/write).
    labels Map<String,String>
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.
    permission string
    Permission level granted by this restriction (e.g. metric read/write).
    labels {[key: string]: string}
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.
    permission str
    Permission level granted by this restriction (e.g. metric read/write).
    labels Mapping[str, str]
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.
    permission String
    Permission level granted by this restriction (e.g. metric read/write).
    labels Map<String>
    Optional label matchers further scoping the restriction to metrics whose labels match these key/value pairs.

    Package Details

    Repository
    chronosphere chronosphereio/pulumi-chronosphere
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the chronosphere Terraform Provider.
    Viewing docs for Chronosphere v0.9.16
    published on Friday, Jun 5, 2026 by Chronosphere

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial