prefect 2.26.1 published on Friday, May 9, 2025 by prefecthq
prefect.getBlock
Explore with Pulumi AI
Get information about an existing Block by either:
- ID, or
- block type name and block name
 If the ID is provided, then the block type name and block name will be ignored.
 Use this data source to obtain Block-specific attributes, such as the data.
 For more information, see securely store typed configuration.
This feature is available in the following product plan(s): Prefect OSS, Prefect Cloud (Free), Prefect Cloud (Pro), Prefect Cloud (Enterprise).
Using getBlock
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 getBlock(args: GetBlockArgs, opts?: InvokeOptions): Promise<GetBlockResult>
function getBlockOutput(args: GetBlockOutputArgs, opts?: InvokeOptions): Output<GetBlockResult>def get_block(account_id: Optional[str] = None,
              id: Optional[str] = None,
              name: Optional[str] = None,
              type_slug: Optional[str] = None,
              workspace_id: Optional[str] = None,
              opts: Optional[InvokeOptions] = None) -> GetBlockResult
def get_block_output(account_id: Optional[pulumi.Input[str]] = None,
              id: Optional[pulumi.Input[str]] = None,
              name: Optional[pulumi.Input[str]] = None,
              type_slug: Optional[pulumi.Input[str]] = None,
              workspace_id: Optional[pulumi.Input[str]] = None,
              opts: Optional[InvokeOptions] = None) -> Output[GetBlockResult]func LookupBlock(ctx *Context, args *LookupBlockArgs, opts ...InvokeOption) (*LookupBlockResult, error)
func LookupBlockOutput(ctx *Context, args *LookupBlockOutputArgs, opts ...InvokeOption) LookupBlockResultOutput> Note: This function is named LookupBlock in the Go SDK.
public static class GetBlock 
{
    public static Task<GetBlockResult> InvokeAsync(GetBlockArgs args, InvokeOptions? opts = null)
    public static Output<GetBlockResult> Invoke(GetBlockInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetBlockResult> getBlock(GetBlockArgs args, InvokeOptions options)
public static Output<GetBlockResult> getBlock(GetBlockArgs args, InvokeOptions options)
fn::invoke:
  function: prefect:index/getBlock:getBlock
  arguments:
    # arguments dictionaryThe following arguments are supported:
- AccountId string
- Account ID (UUID), defaults to the account set in the provider
- Id string
- Block ID (UUID)
- Name string
- Name of the block
- TypeSlug string
- Block type slug
- WorkspaceId string
- Workspace ID (UUID), defaults to the workspace set in the provider
- AccountId string
- Account ID (UUID), defaults to the account set in the provider
- Id string
- Block ID (UUID)
- Name string
- Name of the block
- TypeSlug string
- Block type slug
- WorkspaceId string
- Workspace ID (UUID), defaults to the workspace set in the provider
- accountId String
- Account ID (UUID), defaults to the account set in the provider
- id String
- Block ID (UUID)
- name String
- Name of the block
- typeSlug String
- Block type slug
- workspaceId String
- Workspace ID (UUID), defaults to the workspace set in the provider
- accountId string
- Account ID (UUID), defaults to the account set in the provider
- id string
- Block ID (UUID)
- name string
- Name of the block
- typeSlug string
- Block type slug
- workspaceId string
- Workspace ID (UUID), defaults to the workspace set in the provider
- account_id str
- Account ID (UUID), defaults to the account set in the provider
- id str
- Block ID (UUID)
- name str
- Name of the block
- type_slug str
- Block type slug
- workspace_id str
- Workspace ID (UUID), defaults to the workspace set in the provider
- accountId String
- Account ID (UUID), defaults to the account set in the provider
- id String
- Block ID (UUID)
- name String
- Name of the block
- typeSlug String
- Block type slug
- workspaceId String
- Workspace ID (UUID), defaults to the workspace set in the provider
getBlock Result
The following output properties are available:
- Created string
- Timestamp of when the resource was created (RFC3339)
- Data string
- The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected typeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- Id string
- Block ID (UUID)
- Name string
- Name of the block
- TypeSlug string
- Block type slug
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- AccountId string
- Account ID (UUID), defaults to the account set in the provider
- WorkspaceId string
- Workspace ID (UUID), defaults to the workspace set in the provider
- Created string
- Timestamp of when the resource was created (RFC3339)
- Data string
- The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected typeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- Id string
- Block ID (UUID)
- Name string
- Name of the block
- TypeSlug string
- Block type slug
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- AccountId string
- Account ID (UUID), defaults to the account set in the provider
- WorkspaceId string
- Workspace ID (UUID), defaults to the workspace set in the provider
- created String
- Timestamp of when the resource was created (RFC3339)
- data String
- The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected typeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- id String
- Block ID (UUID)
- name String
- Name of the block
- typeSlug String
- Block type slug
- updated String
- Timestamp of when the resource was updated (RFC3339)
- accountId String
- Account ID (UUID), defaults to the account set in the provider
- workspaceId String
- Workspace ID (UUID), defaults to the workspace set in the provider
- created string
- Timestamp of when the resource was created (RFC3339)
- data string
- The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected typeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- id string
- Block ID (UUID)
- name string
- Name of the block
- typeSlug string
- Block type slug
- updated string
- Timestamp of when the resource was updated (RFC3339)
- accountId string
- Account ID (UUID), defaults to the account set in the provider
- workspaceId string
- Workspace ID (UUID), defaults to the workspace set in the provider
- created str
- Timestamp of when the resource was created (RFC3339)
- data str
- The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected typeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- id str
- Block ID (UUID)
- name str
- Name of the block
- type_slug str
- Block type slug
- updated str
- Timestamp of when the resource was updated (RFC3339)
- account_id str
- Account ID (UUID), defaults to the account set in the provider
- workspace_id str
- Workspace ID (UUID), defaults to the workspace set in the provider
- created String
- Timestamp of when the resource was created (RFC3339)
- data String
- The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected typeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- id String
- Block ID (UUID)
- name String
- Name of the block
- typeSlug String
- Block type slug
- updated String
- Timestamp of when the resource was updated (RFC3339)
- accountId String
- Account ID (UUID), defaults to the account set in the provider
- workspaceId String
- Workspace ID (UUID), defaults to the workspace set in the provider
Package Details
- Repository
- prefect prefecthq/terraform-provider-prefect
- License
- Notes
- This Pulumi package is based on the prefectTerraform Provider.