1. Packages
  2. Prefect Provider
  3. API Docs
  4. getAccountRole
prefect 2.90.1 published on Friday, Nov 14, 2025 by prefecthq
prefect logo
prefect 2.90.1 published on Friday, Nov 14, 2025 by prefecthq

    Get information about an existing Workspace Role.
    Use this data source read down the pre-defined Roles, to manage User and Service Account access.
    For more information, see manage account roles.

    This feature is available in the following product plan(s): Hobby, Starter, Team, Pro, Enterprise.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as prefect from "@pulumi/prefect";
    
    // Read down the default Admin Account Role
    const admin = prefect.getAccountRole({
        name: "Admin",
    });
    // Read down the default Member Account Role
    const member = prefect.getAccountRole({
        name: "Member",
    });
    // Read down the default Owner Account Role
    const owner = prefect.getAccountRole({
        name: "Owner",
    });
    
    import pulumi
    import pulumi_prefect as prefect
    
    # Read down the default Admin Account Role
    admin = prefect.get_account_role(name="Admin")
    # Read down the default Member Account Role
    member = prefect.get_account_role(name="Member")
    # Read down the default Owner Account Role
    owner = prefect.get_account_role(name="Owner")
    
    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 {
    		// Read down the default Admin Account Role
    		_, err := prefect.GetAccountRole(ctx, &prefect.GetAccountRoleArgs{
    			Name: "Admin",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Read down the default Member Account Role
    		_, err = prefect.GetAccountRole(ctx, &prefect.GetAccountRoleArgs{
    			Name: "Member",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		// Read down the default Owner Account Role
    		_, err = prefect.GetAccountRole(ctx, &prefect.GetAccountRoleArgs{
    			Name: "Owner",
    		}, 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(() => 
    {
        // Read down the default Admin Account Role
        var admin = Prefect.GetAccountRole.Invoke(new()
        {
            Name = "Admin",
        });
    
        // Read down the default Member Account Role
        var member = Prefect.GetAccountRole.Invoke(new()
        {
            Name = "Member",
        });
    
        // Read down the default Owner Account Role
        var owner = Prefect.GetAccountRole.Invoke(new()
        {
            Name = "Owner",
        });
    
    });
    
    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.GetAccountRoleArgs;
    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) {
            // Read down the default Admin Account Role
            final var admin = PrefectFunctions.getAccountRole(GetAccountRoleArgs.builder()
                .name("Admin")
                .build());
    
            // Read down the default Member Account Role
            final var member = PrefectFunctions.getAccountRole(GetAccountRoleArgs.builder()
                .name("Member")
                .build());
    
            // Read down the default Owner Account Role
            final var owner = PrefectFunctions.getAccountRole(GetAccountRoleArgs.builder()
                .name("Owner")
                .build());
    
        }
    }
    
    variables:
      # Read down the default Admin Account Role
      admin:
        fn::invoke:
          function: prefect:getAccountRole
          arguments:
            name: Admin
      # Read down the default Member Account Role
      member:
        fn::invoke:
          function: prefect:getAccountRole
          arguments:
            name: Member
      # Read down the default Owner Account Role
      owner:
        fn::invoke:
          function: prefect:getAccountRole
          arguments:
            name: Owner
    

    Using getAccountRole

    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 getAccountRole(args: GetAccountRoleArgs, opts?: InvokeOptions): Promise<GetAccountRoleResult>
    function getAccountRoleOutput(args: GetAccountRoleOutputArgs, opts?: InvokeOptions): Output<GetAccountRoleResult>
    def get_account_role(account_id: Optional[str] = None,
                         name: Optional[str] = None,
                         opts: Optional[InvokeOptions] = None) -> GetAccountRoleResult
    def get_account_role_output(account_id: Optional[pulumi.Input[str]] = None,
                         name: Optional[pulumi.Input[str]] = None,
                         opts: Optional[InvokeOptions] = None) -> Output[GetAccountRoleResult]
    func GetAccountRole(ctx *Context, args *GetAccountRoleArgs, opts ...InvokeOption) (*GetAccountRoleResult, error)
    func GetAccountRoleOutput(ctx *Context, args *GetAccountRoleOutputArgs, opts ...InvokeOption) GetAccountRoleResultOutput

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

    public static class GetAccountRole 
    {
        public static Task<GetAccountRoleResult> InvokeAsync(GetAccountRoleArgs args, InvokeOptions? opts = null)
        public static Output<GetAccountRoleResult> Invoke(GetAccountRoleInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetAccountRoleResult> getAccountRole(GetAccountRoleArgs args, InvokeOptions options)
    public static Output<GetAccountRoleResult> getAccountRole(GetAccountRoleArgs args, InvokeOptions options)
    
    fn::invoke:
      function: prefect:index/getAccountRole:getAccountRole
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Name string
    Name of the Account Role
    AccountId string
    Account ID (UUID) where the resource resides
    Name string
    Name of the Account Role
    AccountId string
    Account ID (UUID) where the resource resides
    name String
    Name of the Account Role
    accountId String
    Account ID (UUID) where the resource resides
    name string
    Name of the Account Role
    accountId string
    Account ID (UUID) where the resource resides
    name str
    Name of the Account Role
    account_id str
    Account ID (UUID) where the resource resides
    name String
    Name of the Account Role
    accountId String
    Account ID (UUID) where the resource resides

    getAccountRole Result

    The following output properties are available:

    Created string
    Timestamp of when the resource was created (RFC3339)
    Id string
    Account Role ID (UUID)
    IsSystemRole bool
    Boolean specifying if the Account Role is a system role
    Name string
    Name of the Account Role
    Permissions List<string>
    List of permissions linked to the Account Role
    Updated string
    Timestamp of when the resource was updated (RFC3339)
    AccountId string
    Account ID (UUID) where the resource resides
    Created string
    Timestamp of when the resource was created (RFC3339)
    Id string
    Account Role ID (UUID)
    IsSystemRole bool
    Boolean specifying if the Account Role is a system role
    Name string
    Name of the Account Role
    Permissions []string
    List of permissions linked to the Account Role
    Updated string
    Timestamp of when the resource was updated (RFC3339)
    AccountId string
    Account ID (UUID) where the resource resides
    created String
    Timestamp of when the resource was created (RFC3339)
    id String
    Account Role ID (UUID)
    isSystemRole Boolean
    Boolean specifying if the Account Role is a system role
    name String
    Name of the Account Role
    permissions List<String>
    List of permissions linked to the Account Role
    updated String
    Timestamp of when the resource was updated (RFC3339)
    accountId String
    Account ID (UUID) where the resource resides
    created string
    Timestamp of when the resource was created (RFC3339)
    id string
    Account Role ID (UUID)
    isSystemRole boolean
    Boolean specifying if the Account Role is a system role
    name string
    Name of the Account Role
    permissions string[]
    List of permissions linked to the Account Role
    updated string
    Timestamp of when the resource was updated (RFC3339)
    accountId string
    Account ID (UUID) where the resource resides
    created str
    Timestamp of when the resource was created (RFC3339)
    id str
    Account Role ID (UUID)
    is_system_role bool
    Boolean specifying if the Account Role is a system role
    name str
    Name of the Account Role
    permissions Sequence[str]
    List of permissions linked to the Account Role
    updated str
    Timestamp of when the resource was updated (RFC3339)
    account_id str
    Account ID (UUID) where the resource resides
    created String
    Timestamp of when the resource was created (RFC3339)
    id String
    Account Role ID (UUID)
    isSystemRole Boolean
    Boolean specifying if the Account Role is a system role
    name String
    Name of the Account Role
    permissions List<String>
    List of permissions linked to the Account Role
    updated String
    Timestamp of when the resource was updated (RFC3339)
    accountId String
    Account ID (UUID) where the resource resides

    Package Details

    Repository
    prefect prefecthq/terraform-provider-prefect
    License
    Notes
    This Pulumi package is based on the prefect Terraform Provider.
    prefect logo
    prefect 2.90.1 published on Friday, Nov 14, 2025 by prefecthq
      Meet Neo: Your AI Platform Teammate