1. Packages
  2. Prefect Provider
  3. API Docs
  4. User
prefect 2.22.3 published on Thursday, Mar 20, 2025 by prefecthq

prefect.User

Explore with Pulumi AI

The resource user represents a Prefect User.

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

A User is an individual user of Prefect Cloud. Use this resource to manage a user’s profile information. You can also use this resource to assign membership to resources like Teams and Workspaces. For more information, see manage users.

There are two important caveats with this resource.

First, users cannot be created because this is not supported by the API due to the way invitations work. Instead, you must first import user resources into the state before they can be managed. Note that because of this limitation, the delete functionality has not been implemented. If you remove your user resource from configuration, the user will not be deleted.

Second, the user resource requires that the API key used in the Prefect provider be generated by the same user you are importing. This is because the User API includes validation to confirm that requests for a user can only be made by the user itself.

If you do not need to manage the attributes of a user, and only need to retrieve the user ID for reference in other resources, consider using the account member datasource instead.

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
Coming soon!
resources:
  marvin:
    type: prefect:User
    properties:
      email: marvin@prefect.io
      firstName: Marvin
      handle: marvin
      id: 00000000-0000-0000-0000-000000000000
      lastName: The Paranoid Android
Copy

Create User Resource

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

Constructor syntax

new User(name: string, args?: UserArgs, opts?: CustomResourceOptions);
@overload
def User(resource_name: str,
         args: Optional[UserArgs] = None,
         opts: Optional[ResourceOptions] = None)

@overload
def User(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         email: Optional[str] = None,
         first_name: Optional[str] = None,
         handle: Optional[str] = None,
         last_name: Optional[str] = None)
func NewUser(ctx *Context, name string, args *UserArgs, opts ...ResourceOption) (*User, error)
public User(string name, UserArgs? args = null, CustomResourceOptions? opts = null)
public User(String name, UserArgs args)
public User(String name, UserArgs args, CustomResourceOptions options)
type: prefect:User
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 UserArgs
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 UserArgs
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 UserArgs
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 UserArgs
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. UserArgs
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 userResource = new Prefect.User("userResource", new()
{
    Email = "string",
    FirstName = "string",
    Handle = "string",
    LastName = "string",
});
Copy
example, err := prefect.NewUser(ctx, "userResource", &prefect.UserArgs{
Email: pulumi.String("string"),
FirstName: pulumi.String("string"),
Handle: pulumi.String("string"),
LastName: pulumi.String("string"),
})
Copy
var userResource = new User("userResource", UserArgs.builder()
    .email("string")
    .firstName("string")
    .handle("string")
    .lastName("string")
    .build());
Copy
user_resource = prefect.User("userResource",
    email="string",
    first_name="string",
    handle="string",
    last_name="string")
Copy
const userResource = new prefect.User("userResource", {
    email: "string",
    firstName: "string",
    handle: "string",
    lastName: "string",
});
Copy
type: prefect:User
properties:
    email: string
    firstName: string
    handle: string
    lastName: string
Copy

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

Email string
Email of the user
FirstName string
First name of the user
Handle string
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
LastName string
Last name of the user
Email string
Email of the user
FirstName string
First name of the user
Handle string
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
LastName string
Last name of the user
email String
Email of the user
firstName String
First name of the user
handle String
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
lastName String
Last name of the user
email string
Email of the user
firstName string
First name of the user
handle string
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
lastName string
Last name of the user
email str
Email of the user
first_name str
First name of the user
handle str
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
last_name str
Last name of the user
email String
Email of the user
firstName String
First name of the user
handle String
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
lastName String
Last name of the user

Outputs

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

ActorId string
Actor ID (UUID), used for granting access to resources like Teams
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 Teams
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 Teams
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 Teams
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 Teams
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 Teams
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 User Resource

Get an existing User 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?: UserState, opts?: CustomResourceOptions): User
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        actor_id: Optional[str] = None,
        created: Optional[str] = None,
        email: Optional[str] = None,
        first_name: Optional[str] = None,
        handle: Optional[str] = None,
        last_name: Optional[str] = None,
        updated: Optional[str] = None) -> User
func GetUser(ctx *Context, name string, id IDInput, state *UserState, opts ...ResourceOption) (*User, error)
public static User Get(string name, Input<string> id, UserState? state, CustomResourceOptions? opts = null)
public static User get(String name, Output<String> id, UserState state, CustomResourceOptions options)
resources:  _:    type: prefect:User    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:
ActorId string
Actor ID (UUID), used for granting access to resources like Teams
Created string
Timestamp of when the resource was created (RFC3339)
Email string
Email of the user
FirstName string
First name of the user
Handle string
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
LastName string
Last name of the user
Updated string
Timestamp of when the resource was updated (RFC3339)
ActorId string
Actor ID (UUID), used for granting access to resources like Teams
Created string
Timestamp of when the resource was created (RFC3339)
Email string
Email of the user
FirstName string
First name of the user
Handle string
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
LastName string
Last name of the user
Updated string
Timestamp of when the resource was updated (RFC3339)
actorId String
Actor ID (UUID), used for granting access to resources like Teams
created String
Timestamp of when the resource was created (RFC3339)
email String
Email of the user
firstName String
First name of the user
handle String
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
lastName String
Last name of the user
updated String
Timestamp of when the resource was updated (RFC3339)
actorId string
Actor ID (UUID), used for granting access to resources like Teams
created string
Timestamp of when the resource was created (RFC3339)
email string
Email of the user
firstName string
First name of the user
handle string
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
lastName string
Last name of the user
updated string
Timestamp of when the resource was updated (RFC3339)
actor_id str
Actor ID (UUID), used for granting access to resources like Teams
created str
Timestamp of when the resource was created (RFC3339)
email str
Email of the user
first_name str
First name of the user
handle str
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
last_name str
Last name of the user
updated str
Timestamp of when the resource was updated (RFC3339)
actorId String
Actor ID (UUID), used for granting access to resources like Teams
created String
Timestamp of when the resource was created (RFC3339)
email String
Email of the user
firstName String
First name of the user
handle String
A unique handle for the user, containing only lowercase letters, numbers, and dashes.
lastName String
Last name of the user
updated String
Timestamp of when the resource was updated (RFC3339)

Import

Prefect Users can be imported by ID, which can be found in the UI

by clicking the dropdown menu in the top left corner and then clicking “My Profile”.

$ pulumi import prefect:index/user:User marvin 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.