1. Packages
  2. Packages
  3. stackit
  4. API Docs
  5. getServiceAccounts
Viewing docs for stackit v0.0.5
published on Tuesday, Mar 31, 2026 by stackitcloud
stackit logo
Viewing docs for stackit v0.0.5
published on Tuesday, Mar 31, 2026 by stackitcloud

    Service accounts plural data source schema. Returns a list of all service accounts in a project, optionally filtered.

    Example Usage

    data "stackit_service_accounts" "all_sas" {
      project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    }
    
    data "stackit_service_accounts" "sas_default_suffix" {
      project_id   = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      email_suffix = "@sa.stackit.cloud"
    }
    
    data "stackit_service_accounts" "sas_default_suffix_sort_asc" {
      project_id     = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      email_suffix   = "@sa.stackit.cloud"
      sort_ascending = true
    }
    
    data "stackit_service_accounts" "sas_ske_regex" {
      project_id  = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      email_regex = ".*@ske\\.sa\\.stackit\\.cloud$"
    }
    
    data "stackit_service_accounts" "sas_ske_suffix" {
      project_id   = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
      email_suffix = "@ske.sa.stackit.cloud"
    }
    

    Using getServiceAccounts

    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 getServiceAccounts(args: GetServiceAccountsArgs, opts?: InvokeOptions): Promise<GetServiceAccountsResult>
    function getServiceAccountsOutput(args: GetServiceAccountsOutputArgs, opts?: InvokeOptions): Output<GetServiceAccountsResult>
    def get_service_accounts(email_regex: Optional[str] = None,
                             email_suffix: Optional[str] = None,
                             project_id: Optional[str] = None,
                             sort_ascending: Optional[bool] = None,
                             opts: Optional[InvokeOptions] = None) -> GetServiceAccountsResult
    def get_service_accounts_output(email_regex: Optional[pulumi.Input[str]] = None,
                             email_suffix: Optional[pulumi.Input[str]] = None,
                             project_id: Optional[pulumi.Input[str]] = None,
                             sort_ascending: Optional[pulumi.Input[bool]] = None,
                             opts: Optional[InvokeOptions] = None) -> Output[GetServiceAccountsResult]
    func GetServiceAccounts(ctx *Context, args *GetServiceAccountsArgs, opts ...InvokeOption) (*GetServiceAccountsResult, error)
    func GetServiceAccountsOutput(ctx *Context, args *GetServiceAccountsOutputArgs, opts ...InvokeOption) GetServiceAccountsResultOutput

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

    public static class GetServiceAccounts 
    {
        public static Task<GetServiceAccountsResult> InvokeAsync(GetServiceAccountsArgs args, InvokeOptions? opts = null)
        public static Output<GetServiceAccountsResult> Invoke(GetServiceAccountsInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetServiceAccountsResult> getServiceAccounts(GetServiceAccountsArgs args, InvokeOptions options)
    public static Output<GetServiceAccountsResult> getServiceAccounts(GetServiceAccountsArgs args, InvokeOptions options)
    
    fn::invoke:
      function: stackit:index/getServiceAccounts:getServiceAccounts
      arguments:
        # arguments dictionary

    The following arguments are supported:

    ProjectId string
    STACKIT project ID.
    EmailRegex string
    Optional regular expression to filter service accounts by email.
    EmailSuffix string
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    SortAscending bool
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    ProjectId string
    STACKIT project ID.
    EmailRegex string
    Optional regular expression to filter service accounts by email.
    EmailSuffix string
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    SortAscending bool
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    projectId String
    STACKIT project ID.
    emailRegex String
    Optional regular expression to filter service accounts by email.
    emailSuffix String
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sortAscending Boolean
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    projectId string
    STACKIT project ID.
    emailRegex string
    Optional regular expression to filter service accounts by email.
    emailSuffix string
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sortAscending boolean
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    project_id str
    STACKIT project ID.
    email_regex str
    Optional regular expression to filter service accounts by email.
    email_suffix str
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sort_ascending bool
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    projectId String
    STACKIT project ID.
    emailRegex String
    Optional regular expression to filter service accounts by email.
    emailSuffix String
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sortAscending Boolean
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).

    getServiceAccounts Result

    The following output properties are available:

    Id string
    Terraform's internal resource ID, structured as "projectId".
    Items List<GetServiceAccountsItem>
    The list of service accounts matching the provided filters.
    ProjectId string
    STACKIT project ID.
    EmailRegex string
    Optional regular expression to filter service accounts by email.
    EmailSuffix string
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    SortAscending bool
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    Id string
    Terraform's internal resource ID, structured as "projectId".
    Items []GetServiceAccountsItem
    The list of service accounts matching the provided filters.
    ProjectId string
    STACKIT project ID.
    EmailRegex string
    Optional regular expression to filter service accounts by email.
    EmailSuffix string
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    SortAscending bool
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    id String
    Terraform's internal resource ID, structured as "projectId".
    items List<GetServiceAccountsItem>
    The list of service accounts matching the provided filters.
    projectId String
    STACKIT project ID.
    emailRegex String
    Optional regular expression to filter service accounts by email.
    emailSuffix String
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sortAscending Boolean
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    id string
    Terraform's internal resource ID, structured as "projectId".
    items GetServiceAccountsItem[]
    The list of service accounts matching the provided filters.
    projectId string
    STACKIT project ID.
    emailRegex string
    Optional regular expression to filter service accounts by email.
    emailSuffix string
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sortAscending boolean
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    id str
    Terraform's internal resource ID, structured as "projectId".
    items Sequence[GetServiceAccountsItem]
    The list of service accounts matching the provided filters.
    project_id str
    STACKIT project ID.
    email_regex str
    Optional regular expression to filter service accounts by email.
    email_suffix str
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sort_ascending bool
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).
    id String
    Terraform's internal resource ID, structured as "projectId".
    items List<Property Map>
    The list of service accounts matching the provided filters.
    projectId String
    STACKIT project ID.
    emailRegex String
    Optional regular expression to filter service accounts by email.
    emailSuffix String
    Optional suffix to filter service accounts by email (e.g.,@sa.stackit.cloud, @ske.sa.stackit.cloud).
    sortAscending Boolean
    If set to true, service accounts are sorted in ascending lexicographical order by email. Defaults to false (descending).

    Supporting Types

    GetServiceAccountsItem

    Email string
    Email of the service account.
    Name string
    Name of the service account.
    ServiceAccountId string
    The internal UUID of the service account.
    Email string
    Email of the service account.
    Name string
    Name of the service account.
    ServiceAccountId string
    The internal UUID of the service account.
    email String
    Email of the service account.
    name String
    Name of the service account.
    serviceAccountId String
    The internal UUID of the service account.
    email string
    Email of the service account.
    name string
    Name of the service account.
    serviceAccountId string
    The internal UUID of the service account.
    email str
    Email of the service account.
    name str
    Name of the service account.
    service_account_id str
    The internal UUID of the service account.
    email String
    Email of the service account.
    name String
    Name of the service account.
    serviceAccountId String
    The internal UUID of the service account.

    Package Details

    Repository
    stackit stackitcloud/pulumi-stackit
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the stackit Terraform Provider.
    stackit logo
    Viewing docs for stackit v0.0.5
    published on Tuesday, Mar 31, 2026 by stackitcloud
      Try Pulumi Cloud free. Your team will thank you.