prefect 2.90.0 published on Friday, Oct 31, 2025 by prefecthq
prefect.getServiceAccount
Start a Neo task
Explain and create a prefect.getServiceAccount resource
Get information about an existing Service Account, by name or ID.
Use this data source to obtain service account-level attributes, such as ID.
For more information, see manage service accounts.
This feature is available in the following product plan(s): Team, Pro, Enterprise.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as prefect from "@pulumi/prefect";
const bot = prefect.getServiceAccount({
name: "my-bot-name",
});
import pulumi
import pulumi_prefect as prefect
bot = prefect.get_service_account(name="my-bot-name")
package main
import (
"github.com/pulumi/pulumi-terraform-provider/sdks/go/prefect/v2/prefect"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := prefect.LookupServiceAccount(ctx, &prefect.LookupServiceAccountArgs{
Name: pulumi.StringRef("my-bot-name"),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Prefect = Pulumi.Prefect;
return await Deployment.RunAsync(() =>
{
var bot = Prefect.GetServiceAccount.Invoke(new()
{
Name = "my-bot-name",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.prefect.PrefectFunctions;
import com.pulumi.prefect.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) {
final var bot = PrefectFunctions.getServiceAccount(GetServiceAccountArgs.builder()
.name("my-bot-name")
.build());
}
}
variables:
bot:
fn::invoke:
function: prefect:getServiceAccount
arguments:
name: my-bot-name
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>def get_service_account(account_id: Optional[str] = None,
id: Optional[str] = None,
name: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetServiceAccountResult
def get_service_account_output(account_id: Optional[pulumi.Input[str]] = None,
id: Optional[pulumi.Input[str]] = None,
name: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetServiceAccountResult]func LookupServiceAccount(ctx *Context, args *LookupServiceAccountArgs, opts ...InvokeOption) (*LookupServiceAccountResult, error)
func LookupServiceAccountOutput(ctx *Context, args *LookupServiceAccountOutputArgs, opts ...InvokeOption) LookupServiceAccountResultOutput> 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)
}public static CompletableFuture<GetServiceAccountResult> getServiceAccount(GetServiceAccountArgs args, InvokeOptions options)
public static Output<GetServiceAccountResult> getServiceAccount(GetServiceAccountArgs args, InvokeOptions options)
fn::invoke:
function: prefect:index/getServiceAccount:getServiceAccount
arguments:
# arguments dictionaryThe following arguments are supported:
- account_
id str - Account ID (UUID), defaults to the account set in the provider
- id str
- Service Account ID (UUID)
- name str
- Name of the service account
getServiceAccount Result
The following output properties are available:
- Account
Role stringName - Account Role name of the service account
- Actor
Id string - Actor ID (UUID), used for granting access to resources like Blocks and Deployments
- Api
Key string - API Key associated with the service account
- Api
Key stringCreated - Date and time that the API Key was created in RFC 3339 format
- Api
Key stringExpiration - Date and time that the API Key expires in RFC 3339 format
- Api
Key stringId - API Key ID associated with the service account. NOTE: this is always null for reads. If you need the API Key ID, use the
prefect.ServiceAccountresource instead. - Api
Key stringName - API Key Name associated with the service account
- Created string
- Timestamp of when the resource was created (RFC3339)
- Id string
- Service Account ID (UUID)
- Name string
- Name of the service account
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- Account
Id string - Account ID (UUID), defaults to the account set in the provider
- Account
Role stringName - Account Role name of the service account
- Actor
Id string - Actor ID (UUID), used for granting access to resources like Blocks and Deployments
- Api
Key string - API Key associated with the service account
- Api
Key stringCreated - Date and time that the API Key was created in RFC 3339 format
- Api
Key stringExpiration - Date and time that the API Key expires in RFC 3339 format
- Api
Key stringId - API Key ID associated with the service account. NOTE: this is always null for reads. If you need the API Key ID, use the
prefect.ServiceAccountresource instead. - Api
Key stringName - API Key Name associated with the service account
- Created string
- Timestamp of when the resource was created (RFC3339)
- Id string
- Service Account ID (UUID)
- Name string
- Name of the service account
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- Account
Id string - Account ID (UUID), defaults to the account set in the provider
- account
Role StringName - Account Role name of the service account
- actor
Id String - Actor ID (UUID), used for granting access to resources like Blocks and Deployments
- api
Key String - API Key associated with the service account
- api
Key StringCreated - Date and time that the API Key was created in RFC 3339 format
- api
Key StringExpiration - Date and time that the API Key expires in RFC 3339 format
- api
Key StringId - API Key ID associated with the service account. NOTE: this is always null for reads. If you need the API Key ID, use the
prefect.ServiceAccountresource instead. - api
Key StringName - API Key Name associated with the service account
- created String
- Timestamp of when the resource was created (RFC3339)
- id String
- Service Account ID (UUID)
- name String
- Name of the service account
- updated String
- Timestamp of when the resource was updated (RFC3339)
- account
Id String - Account ID (UUID), defaults to the account set in the provider
- account
Role stringName - Account Role name of the service account
- actor
Id string - Actor ID (UUID), used for granting access to resources like Blocks and Deployments
- api
Key string - API Key associated with the service account
- api
Key stringCreated - Date and time that the API Key was created in RFC 3339 format
- api
Key stringExpiration - Date and time that the API Key expires in RFC 3339 format
- api
Key stringId - API Key ID associated with the service account. NOTE: this is always null for reads. If you need the API Key ID, use the
prefect.ServiceAccountresource instead. - api
Key stringName - API Key Name associated with the service account
- created string
- Timestamp of when the resource was created (RFC3339)
- id string
- Service Account ID (UUID)
- name string
- Name of the service account
- updated string
- Timestamp of when the resource was updated (RFC3339)
- account
Id string - Account ID (UUID), defaults to the account set in the provider
- account_
role_ strname - Account Role name of the service account
- actor_
id str - Actor ID (UUID), used for granting access to resources like Blocks and Deployments
- api_
key str - API Key associated with the service account
- api_
key_ strcreated - Date and time that the API Key was created in RFC 3339 format
- api_
key_ strexpiration - Date and time that the API Key expires in RFC 3339 format
- api_
key_ strid - API Key ID associated with the service account. NOTE: this is always null for reads. If you need the API Key ID, use the
prefect.ServiceAccountresource instead. - api_
key_ strname - API Key Name associated with the service account
- created str
- Timestamp of when the resource was created (RFC3339)
- id str
- Service Account ID (UUID)
- name str
- Name of the service account
- updated str
- Timestamp of when the resource was updated (RFC3339)
- account_
id str - Account ID (UUID), defaults to the account set in the provider
- account
Role StringName - Account Role name of the service account
- actor
Id String - Actor ID (UUID), used for granting access to resources like Blocks and Deployments
- api
Key String - API Key associated with the service account
- api
Key StringCreated - Date and time that the API Key was created in RFC 3339 format
- api
Key StringExpiration - Date and time that the API Key expires in RFC 3339 format
- api
Key StringId - API Key ID associated with the service account. NOTE: this is always null for reads. If you need the API Key ID, use the
prefect.ServiceAccountresource instead. - api
Key StringName - API Key Name associated with the service account
- created String
- Timestamp of when the resource was created (RFC3339)
- id String
- Service Account ID (UUID)
- name String
- Name of the service account
- updated String
- Timestamp of when the resource was updated (RFC3339)
- account
Id String - Account ID (UUID), defaults to the account set in the provider
Package Details
- Repository
- prefect prefecthq/terraform-provider-prefect
- License
- Notes
- This Pulumi package is based on the
prefectTerraform Provider.
