1. Packages
  2. Prefect Provider
  3. API Docs
  4. ServiceAccount
prefect 2.24.1 published on Tuesday, Apr 15, 2025 by prefecthq

prefect.ServiceAccount

Explore with Pulumi AI

The resource service_account represents a Prefect Cloud Service Account. A Service Account allows you to create an API Key that is not associated with a user account.

Service Accounts are used to configure API access for workers or programs. Use this resource to provision and rotate Keys as well as assign Account and Workspace Access through Roles.

API Keys for service_account resources can be rotated by modifying the api_key_expiration attribute. For more information, see manage service accounts.

This feature is available in the following product plan(s): Prefect Cloud (Pro), Prefect Cloud (Enterprise).

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as prefect from "@pulumi/prefect";
import * as time from "@pulumi/time";

// NON-EXPIRING API KEY
const example = new prefect.ServiceAccount("example", {});
const ninetyDays = new time.index.Time_rotating("ninetyDays", {rotationDays: 90});
// Pass the time_rotating resource to the `api_key_expiration` attribute
// in order to automate the rotation of the Service Account key
const exampleRotateTimeKey = new prefect.ServiceAccount("exampleRotateTimeKey", {apiKeyExpiration: ninetyDays.rotationRfc3339});
// Optionally, rotate non-expiring Service Account keys
// using the `api_key_keepers` attribute, which is an
// arbitrary map of values that, if changed, will
// trigger a key rotation (but not a re-creation of the Service Account)
const exampleRotateForeverKey = new prefect.ServiceAccount("exampleRotateForeverKey", {
    apiKeyExpiration: undefined,
    apiKeyKeepers: {
        foo: "value-1",
        bar: "value-2",
    },
});
// Use the optional `old_key_expires_in_seconds`, which applies
// a TTL to the old key when rotation takes place.
// This is useful to ensure that your consumers don't experience
// downtime when the new key is being rolled out.
const exampleOldKeyExpiresLater = new prefect.ServiceAccount("exampleOldKeyExpiresLater", {
    oldKeyExpiresInSeconds: 300,
    apiKeyExpiration: ninetyDays.rotationRfc3339,
    apiKeyKeepers: {
        foo: "value-1",
        bar: "value-2",
    },
});
Copy
import pulumi
import pulumi_prefect as prefect
import pulumi_time as time

# NON-EXPIRING API KEY
example = prefect.ServiceAccount("example")
ninety_days = time.index.Time_rotating("ninetyDays", rotation_days=90)
# Pass the time_rotating resource to the `api_key_expiration` attribute
# in order to automate the rotation of the Service Account key
example_rotate_time_key = prefect.ServiceAccount("exampleRotateTimeKey", api_key_expiration=ninety_days["rotationRfc3339"])
# Optionally, rotate non-expiring Service Account keys
# using the `api_key_keepers` attribute, which is an
# arbitrary map of values that, if changed, will
# trigger a key rotation (but not a re-creation of the Service Account)
example_rotate_forever_key = prefect.ServiceAccount("exampleRotateForeverKey",
    api_key_expiration=None,
    api_key_keepers={
        "foo": "value-1",
        "bar": "value-2",
    })
# Use the optional `old_key_expires_in_seconds`, which applies
# a TTL to the old key when rotation takes place.
# This is useful to ensure that your consumers don't experience
# downtime when the new key is being rolled out.
example_old_key_expires_later = prefect.ServiceAccount("exampleOldKeyExpiresLater",
    old_key_expires_in_seconds=300,
    api_key_expiration=ninety_days["rotationRfc3339"],
    api_key_keepers={
        "foo": "value-1",
        "bar": "value-2",
    })
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/prefect/v2/prefect"
	"github.com/pulumi/pulumi-time/sdk/go/time"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// NON-EXPIRING API KEY
		_, err := prefect.NewServiceAccount(ctx, "example", nil)
		if err != nil {
			return err
		}
		ninetyDays, err := time.NewTime_rotating(ctx, "ninetyDays", &time.Time_rotatingArgs{
			RotationDays: 90,
		})
		if err != nil {
			return err
		}
		// Pass the time_rotating resource to the `api_key_expiration` attribute
		// in order to automate the rotation of the Service Account key
		_, err = prefect.NewServiceAccount(ctx, "exampleRotateTimeKey", &prefect.ServiceAccountArgs{
			ApiKeyExpiration: ninetyDays.RotationRfc3339,
		})
		if err != nil {
			return err
		}
		// Optionally, rotate non-expiring Service Account keys
		// using the `api_key_keepers` attribute, which is an
		// arbitrary map of values that, if changed, will
		// trigger a key rotation (but not a re-creation of the Service Account)
		_, err = prefect.NewServiceAccount(ctx, "exampleRotateForeverKey", &prefect.ServiceAccountArgs{
			ApiKeyExpiration: nil,
			ApiKeyKeepers: pulumi.StringMap{
				"foo": pulumi.String("value-1"),
				"bar": pulumi.String("value-2"),
			},
		})
		if err != nil {
			return err
		}
		// Use the optional `old_key_expires_in_seconds`, which applies
		// a TTL to the old key when rotation takes place.
		// This is useful to ensure that your consumers don't experience
		// downtime when the new key is being rolled out.
		_, err = prefect.NewServiceAccount(ctx, "exampleOldKeyExpiresLater", &prefect.ServiceAccountArgs{
			OldKeyExpiresInSeconds: pulumi.Float64(300),
			ApiKeyExpiration:       ninetyDays.RotationRfc3339,
			ApiKeyKeepers: pulumi.StringMap{
				"foo": pulumi.String("value-1"),
				"bar": pulumi.String("value-2"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Prefect = Pulumi.Prefect;
using Time = Pulumi.Time;

return await Deployment.RunAsync(() => 
{
    // NON-EXPIRING API KEY
    var example = new Prefect.ServiceAccount("example");

    var ninetyDays = new Time.Index.Time_rotating("ninetyDays", new()
    {
        RotationDays = 90,
    });

    // Pass the time_rotating resource to the `api_key_expiration` attribute
    // in order to automate the rotation of the Service Account key
    var exampleRotateTimeKey = new Prefect.ServiceAccount("exampleRotateTimeKey", new()
    {
        ApiKeyExpiration = ninetyDays.RotationRfc3339,
    });

    // Optionally, rotate non-expiring Service Account keys
    // using the `api_key_keepers` attribute, which is an
    // arbitrary map of values that, if changed, will
    // trigger a key rotation (but not a re-creation of the Service Account)
    var exampleRotateForeverKey = new Prefect.ServiceAccount("exampleRotateForeverKey", new()
    {
        ApiKeyExpiration = null,
        ApiKeyKeepers = 
        {
            { "foo", "value-1" },
            { "bar", "value-2" },
        },
    });

    // Use the optional `old_key_expires_in_seconds`, which applies
    // a TTL to the old key when rotation takes place.
    // This is useful to ensure that your consumers don't experience
    // downtime when the new key is being rolled out.
    var exampleOldKeyExpiresLater = new Prefect.ServiceAccount("exampleOldKeyExpiresLater", new()
    {
        OldKeyExpiresInSeconds = 300,
        ApiKeyExpiration = ninetyDays.RotationRfc3339,
        ApiKeyKeepers = 
        {
            { "foo", "value-1" },
            { "bar", "value-2" },
        },
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.prefect.ServiceAccount;
import com.pulumi.time.time_rotating;
import com.pulumi.time.Time_rotatingArgs;
import com.pulumi.prefect.ServiceAccountArgs;
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) {
        // NON-EXPIRING API KEY
        var example = new ServiceAccount("example");

        var ninetyDays = new Time_rotating("ninetyDays", Time_rotatingArgs.builder()
            .rotationDays(90)
            .build());

        // Pass the time_rotating resource to the `api_key_expiration` attribute
        // in order to automate the rotation of the Service Account key
        var exampleRotateTimeKey = new ServiceAccount("exampleRotateTimeKey", ServiceAccountArgs.builder()
            .apiKeyExpiration(ninetyDays.rotationRfc3339())
            .build());

        // Optionally, rotate non-expiring Service Account keys
        // using the `api_key_keepers` attribute, which is an
        // arbitrary map of values that, if changed, will
        // trigger a key rotation (but not a re-creation of the Service Account)
        var exampleRotateForeverKey = new ServiceAccount("exampleRotateForeverKey", ServiceAccountArgs.builder()
            .apiKeyExpiration(null)
            .apiKeyKeepers(Map.ofEntries(
                Map.entry("foo", "value-1"),
                Map.entry("bar", "value-2")
            ))
            .build());

        // Use the optional `old_key_expires_in_seconds`, which applies
        // a TTL to the old key when rotation takes place.
        // This is useful to ensure that your consumers don't experience
        // downtime when the new key is being rolled out.
        var exampleOldKeyExpiresLater = new ServiceAccount("exampleOldKeyExpiresLater", ServiceAccountArgs.builder()
            .oldKeyExpiresInSeconds(300)
            .apiKeyExpiration(ninetyDays.rotationRfc3339())
            .apiKeyKeepers(Map.ofEntries(
                Map.entry("foo", "value-1"),
                Map.entry("bar", "value-2")
            ))
            .build());

    }
}
Copy
resources:
  # NON-EXPIRING API KEY
  example:
    type: prefect:ServiceAccount
  ninetyDays:
    type: time:time_rotating
    properties:
      rotationDays: 90
  # Pass the time_rotating resource to the `api_key_expiration` attribute
  # in order to automate the rotation of the Service Account key
  exampleRotateTimeKey:
    type: prefect:ServiceAccount
    properties:
      apiKeyExpiration: ${ninetyDays.rotationRfc3339}
  # Optionally, rotate non-expiring Service Account keys
  # using the `api_key_keepers` attribute, which is an
  # arbitrary map of values that, if changed, will
  # trigger a key rotation (but not a re-creation of the Service Account)
  exampleRotateForeverKey:
    type: prefect:ServiceAccount
    properties:
      apiKeyExpiration: null
      # never expires
      apiKeyKeepers:
        foo: value-1
        bar: value-2
  # Use the optional `old_key_expires_in_seconds`, which applies
  # a TTL to the old key when rotation takes place.
  # This is useful to ensure that your consumers don't experience
  # downtime when the new key is being rolled out.
  exampleOldKeyExpiresLater:
    type: prefect:ServiceAccount
    properties:
      oldKeyExpiresInSeconds: 300
      # Remember that `old_key_expires_in_seconds` is only applied
      #   # when a key rotation takes place, such as changing the
      #   # `api_key_expiration` attribute
      apiKeyExpiration: ${ninetyDays.rotationRfc3339}
      # or the `api_key_keepers` attribute
      apiKeyKeepers:
        foo: value-1
        bar: value-2
Copy

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: Optional[ServiceAccountArgs] = None,
                   opts: Optional[ResourceOptions] = None)

@overload
def ServiceAccount(resource_name: str,
                   opts: Optional[ResourceOptions] = None,
                   account_id: Optional[str] = None,
                   account_role_name: Optional[str] = None,
                   api_key_expiration: Optional[str] = None,
                   api_key_keepers: Optional[Mapping[str, str]] = None,
                   name: Optional[str] = None,
                   old_key_expires_in_seconds: Optional[float] = None)
func NewServiceAccount(ctx *Context, name string, args *ServiceAccountArgs, opts ...ResourceOption) (*ServiceAccount, error)
public ServiceAccount(string name, ServiceAccountArgs? args = null, CustomResourceOptions? opts = null)
public ServiceAccount(String name, ServiceAccountArgs args)
public ServiceAccount(String name, ServiceAccountArgs args, CustomResourceOptions options)
type: prefect:ServiceAccount
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 ServiceAccountArgs
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 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 This property is required. 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 This property is required. 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 This property is required. String
The unique name of the resource.
args This property is required. 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 Prefect.ServiceAccount("serviceAccountResource", new()
{
    AccountId = "string",
    AccountRoleName = "string",
    ApiKeyExpiration = "string",
    ApiKeyKeepers = 
    {
        { "string", "string" },
    },
    Name = "string",
    OldKeyExpiresInSeconds = 0,
});
Copy
example, err := prefect.NewServiceAccount(ctx, "serviceAccountResource", &prefect.ServiceAccountArgs{
AccountId: pulumi.String("string"),
AccountRoleName: pulumi.String("string"),
ApiKeyExpiration: pulumi.String("string"),
ApiKeyKeepers: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
OldKeyExpiresInSeconds: pulumi.Float64(0),
})
Copy
var serviceAccountResource = new ServiceAccount("serviceAccountResource", ServiceAccountArgs.builder()
    .accountId("string")
    .accountRoleName("string")
    .apiKeyExpiration("string")
    .apiKeyKeepers(Map.of("string", "string"))
    .name("string")
    .oldKeyExpiresInSeconds(0)
    .build());
Copy
service_account_resource = prefect.ServiceAccount("serviceAccountResource",
    account_id="string",
    account_role_name="string",
    api_key_expiration="string",
    api_key_keepers={
        "string": "string",
    },
    name="string",
    old_key_expires_in_seconds=0)
Copy
const serviceAccountResource = new prefect.ServiceAccount("serviceAccountResource", {
    accountId: "string",
    accountRoleName: "string",
    apiKeyExpiration: "string",
    apiKeyKeepers: {
        string: "string",
    },
    name: "string",
    oldKeyExpiresInSeconds: 0,
});
Copy
type: prefect:ServiceAccount
properties:
    accountId: string
    accountRoleName: string
    apiKeyExpiration: string
    apiKeyKeepers:
        string: string
    name: string
    oldKeyExpiresInSeconds: 0
Copy

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:

AccountId string
Account ID (UUID), defaults to the account set in the provider
AccountRoleName string
Account Role name of the service account (one of: Admin, Member, Owner)
ApiKeyExpiration string
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
ApiKeyKeepers Dictionary<string, string>
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
Name string
Name of the service account
OldKeyExpiresInSeconds double
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
AccountId string
Account ID (UUID), defaults to the account set in the provider
AccountRoleName string
Account Role name of the service account (one of: Admin, Member, Owner)
ApiKeyExpiration string
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
ApiKeyKeepers map[string]string
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
Name string
Name of the service account
OldKeyExpiresInSeconds float64
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
accountId String
Account ID (UUID), defaults to the account set in the provider
accountRoleName String
Account Role name of the service account (one of: Admin, Member, Owner)
apiKeyExpiration String
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
apiKeyKeepers Map<String,String>
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
name String
Name of the service account
oldKeyExpiresInSeconds Double
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
accountId string
Account ID (UUID), defaults to the account set in the provider
accountRoleName string
Account Role name of the service account (one of: Admin, Member, Owner)
apiKeyExpiration string
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
apiKeyKeepers {[key: string]: string}
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
name string
Name of the service account
oldKeyExpiresInSeconds number
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
account_id str
Account ID (UUID), defaults to the account set in the provider
account_role_name str
Account Role name of the service account (one of: Admin, Member, Owner)
api_key_expiration str
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
api_key_keepers Mapping[str, str]
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
name str
Name of the service account
old_key_expires_in_seconds float
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
accountId String
Account ID (UUID), defaults to the account set in the provider
accountRoleName String
Account Role name of the service account (one of: Admin, Member, Owner)
apiKeyExpiration String
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
apiKeyKeepers Map<String>
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
name String
Name of the service account
oldKeyExpiresInSeconds Number
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.

Outputs

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

ActorId string
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
ApiKey string
API Key associated with the service account
ApiKeyCreated string
Timestamp of the API Key creation (RFC3339)
ApiKeyId string
API Key ID associated with the service account
ApiKeyName string
API Key Name associated with the service account
Created string
Timestamp of when the resource was created (RFC3339)
Id string
The provider-assigned unique ID for this managed resource.
Updated string
Timestamp of when the resource was updated (RFC3339)
ActorId string
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
ApiKey string
API Key associated with the service account
ApiKeyCreated string
Timestamp of the API Key creation (RFC3339)
ApiKeyId string
API Key ID associated with the service account
ApiKeyName string
API Key Name associated with the service account
Created string
Timestamp of when the resource was created (RFC3339)
Id string
The provider-assigned unique ID for this managed resource.
Updated string
Timestamp of when the resource was updated (RFC3339)
actorId String
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
apiKey String
API Key associated with the service account
apiKeyCreated String
Timestamp of the API Key creation (RFC3339)
apiKeyId String
API Key ID associated with the service account
apiKeyName String
API Key Name associated with the service account
created String
Timestamp of when the resource was created (RFC3339)
id String
The provider-assigned unique ID for this managed resource.
updated String
Timestamp of when the resource was updated (RFC3339)
actorId string
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
apiKey string
API Key associated with the service account
apiKeyCreated string
Timestamp of the API Key creation (RFC3339)
apiKeyId string
API Key ID associated with the service account
apiKeyName string
API Key Name associated with the service account
created string
Timestamp of when the resource was created (RFC3339)
id string
The provider-assigned unique ID for this managed resource.
updated string
Timestamp of when the resource was updated (RFC3339)
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_created str
Timestamp of the API Key creation (RFC3339)
api_key_id str
API Key ID associated with the service account
api_key_name str
API Key Name associated with the service account
created str
Timestamp of when the resource was created (RFC3339)
id str
The provider-assigned unique ID for this managed resource.
updated str
Timestamp of when the resource was updated (RFC3339)
actorId String
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
apiKey String
API Key associated with the service account
apiKeyCreated String
Timestamp of the API Key creation (RFC3339)
apiKeyId String
API Key ID associated with the service account
apiKeyName String
API Key Name associated with the service account
created String
Timestamp of when the resource was created (RFC3339)
id String
The provider-assigned unique ID for this managed resource.
updated String
Timestamp of when the resource was updated (RFC3339)

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,
        account_id: Optional[str] = None,
        account_role_name: Optional[str] = None,
        actor_id: Optional[str] = None,
        api_key: Optional[str] = None,
        api_key_created: Optional[str] = None,
        api_key_expiration: Optional[str] = None,
        api_key_id: Optional[str] = None,
        api_key_keepers: Optional[Mapping[str, str]] = None,
        api_key_name: Optional[str] = None,
        created: Optional[str] = None,
        name: Optional[str] = None,
        old_key_expires_in_seconds: Optional[float] = None,
        updated: Optional[str] = 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: prefect:ServiceAccount    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.
The following state arguments are supported:
AccountId string
Account ID (UUID), defaults to the account set in the provider
AccountRoleName string
Account Role name of the service account (one of: Admin, Member, Owner)
ActorId string
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
ApiKey string
API Key associated with the service account
ApiKeyCreated string
Timestamp of the API Key creation (RFC3339)
ApiKeyExpiration string
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
ApiKeyId string
API Key ID associated with the service account
ApiKeyKeepers Dictionary<string, string>
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
ApiKeyName string
API Key Name associated with the service account
Created string
Timestamp of when the resource was created (RFC3339)
Name string
Name of the service account
OldKeyExpiresInSeconds double
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
Updated string
Timestamp of when the resource was updated (RFC3339)
AccountId string
Account ID (UUID), defaults to the account set in the provider
AccountRoleName string
Account Role name of the service account (one of: Admin, Member, Owner)
ActorId string
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
ApiKey string
API Key associated with the service account
ApiKeyCreated string
Timestamp of the API Key creation (RFC3339)
ApiKeyExpiration string
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
ApiKeyId string
API Key ID associated with the service account
ApiKeyKeepers map[string]string
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
ApiKeyName string
API Key Name associated with the service account
Created string
Timestamp of when the resource was created (RFC3339)
Name string
Name of the service account
OldKeyExpiresInSeconds float64
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
Updated string
Timestamp of when the resource was updated (RFC3339)
accountId String
Account ID (UUID), defaults to the account set in the provider
accountRoleName String
Account Role name of the service account (one of: Admin, Member, Owner)
actorId String
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
apiKey String
API Key associated with the service account
apiKeyCreated String
Timestamp of the API Key creation (RFC3339)
apiKeyExpiration String
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
apiKeyId String
API Key ID associated with the service account
apiKeyKeepers Map<String,String>
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
apiKeyName String
API Key Name associated with the service account
created String
Timestamp of when the resource was created (RFC3339)
name String
Name of the service account
oldKeyExpiresInSeconds Double
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
updated String
Timestamp of when the resource was updated (RFC3339)
accountId string
Account ID (UUID), defaults to the account set in the provider
accountRoleName string
Account Role name of the service account (one of: Admin, Member, Owner)
actorId string
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
apiKey string
API Key associated with the service account
apiKeyCreated string
Timestamp of the API Key creation (RFC3339)
apiKeyExpiration string
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
apiKeyId string
API Key ID associated with the service account
apiKeyKeepers {[key: string]: string}
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
apiKeyName string
API Key Name associated with the service account
created string
Timestamp of when the resource was created (RFC3339)
name string
Name of the service account
oldKeyExpiresInSeconds number
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
updated string
Timestamp of when the resource was updated (RFC3339)
account_id str
Account ID (UUID), defaults to the account set in the provider
account_role_name str
Account Role name of the service account (one of: Admin, Member, Owner)
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_created str
Timestamp of the API Key creation (RFC3339)
api_key_expiration str
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
api_key_id str
API Key ID associated with the service account
api_key_keepers Mapping[str, str]
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
api_key_name str
API Key Name associated with the service account
created str
Timestamp of when the resource was created (RFC3339)
name str
Name of the service account
old_key_expires_in_seconds float
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
updated str
Timestamp of when the resource was updated (RFC3339)
accountId String
Account ID (UUID), defaults to the account set in the provider
accountRoleName String
Account Role name of the service account (one of: Admin, Member, Owner)
actorId String
Actor ID (UUID), used for granting access to resources like Blocks and Deployments
apiKey String
API Key associated with the service account
apiKeyCreated String
Timestamp of the API Key creation (RFC3339)
apiKeyExpiration String
Timestamp of the API Key expiration (RFC3339). If left as null, the API Key will not expire. Modify this attribute to force a key rotation.
apiKeyId String
API Key ID associated with the service account
apiKeyKeepers Map<String>
A map of values that, if changed, will trigger a key rotation (but not a re-creation of the Service Account)
apiKeyName String
API Key Name associated with the service account
created String
Timestamp of when the resource was created (RFC3339)
name String
Name of the service account
oldKeyExpiresInSeconds Number
Provide this field to set an expiration for the currently active api key. If not provided or provided Null, the current key will be deleted. If provided, it cannot be more than 48 hours (172800 seconds) in the future.
updated String
Timestamp of when the resource was updated (RFC3339)

Import

Prefect Service Accounts can be imported by name in the form name/my-bot-name

$ pulumi import prefect:index/serviceAccount:ServiceAccount example name/my-bot-name
Copy

or via UUID

$ pulumi import prefect:index/serviceAccount:ServiceAccount example 00000000-0000-0000-0000-000000000000
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
prefect prefecthq/terraform-provider-prefect
License
Notes
This Pulumi package is based on the prefect Terraform Provider.