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

prefect.getBlock

Explore with Pulumi AI

prefect 2.24.1 published on Tuesday, Apr 15, 2025 by prefecthq

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>
Copy
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]
Copy
func LookupBlock(ctx *Context, args *LookupBlockArgs, opts ...InvokeOption) (*LookupBlockResult, error)
func LookupBlockOutput(ctx *Context, args *LookupBlockOutputArgs, opts ...InvokeOption) LookupBlockResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetBlockResult> getBlock(GetBlockArgs args, InvokeOptions options)
public static Output<GetBlockResult> getBlock(GetBlockArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: prefect:index/getBlock:getBlock
  arguments:
    # arguments dictionary
Copy

The 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 type slug. Use prefect 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 type slug. Use prefect 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 type slug. Use prefect 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 type slug. Use prefect 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 type slug. Use prefect 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 type slug. Use prefect 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 prefect Terraform Provider.
prefect 2.24.1 published on Tuesday, Apr 15, 2025 by prefecthq