prefect.Block
Import
The pulumi import command can be used, for example:
prefect_block resources can be imported by the block_id
$ pulumi import prefect:index/block:Block my_block 00000000-0000-0000-0000-000000000000
or from a different workspace via block_id,workspace_id
$ pulumi import prefect:index/block:Block my_block 00000000-0000-0000-0000-000000000000,11111111-1111-1111-1111-111111111111
Create Block Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Block(name: string, args: BlockArgs, opts?: CustomResourceOptions);@overload
def Block(resource_name: str,
          args: BlockArgs,
          opts: Optional[ResourceOptions] = None)
@overload
def Block(resource_name: str,
          opts: Optional[ResourceOptions] = None,
          type_slug: Optional[str] = None,
          account_id: Optional[str] = None,
          data: Optional[str] = None,
          data_wo: Optional[str] = None,
          data_wo_version: Optional[float] = None,
          name: Optional[str] = None,
          workspace_id: Optional[str] = None)func NewBlock(ctx *Context, name string, args BlockArgs, opts ...ResourceOption) (*Block, error)public Block(string name, BlockArgs args, CustomResourceOptions? opts = null)type: prefect:Block
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args BlockArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args BlockArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args BlockArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BlockArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BlockArgs
- 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 blockResource = new Prefect.Block("blockResource", new()
{
    TypeSlug = "string",
    AccountId = "string",
    Data = "string",
    DataWo = "string",
    DataWoVersion = 0,
    Name = "string",
    WorkspaceId = "string",
});
example, err := prefect.NewBlock(ctx, "blockResource", &prefect.BlockArgs{
	TypeSlug:      pulumi.String("string"),
	AccountId:     pulumi.String("string"),
	Data:          pulumi.String("string"),
	DataWo:        pulumi.String("string"),
	DataWoVersion: pulumi.Float64(0),
	Name:          pulumi.String("string"),
	WorkspaceId:   pulumi.String("string"),
})
var blockResource = new Block("blockResource", BlockArgs.builder()
    .typeSlug("string")
    .accountId("string")
    .data("string")
    .dataWo("string")
    .dataWoVersion(0.0)
    .name("string")
    .workspaceId("string")
    .build());
block_resource = prefect.Block("blockResource",
    type_slug="string",
    account_id="string",
    data="string",
    data_wo="string",
    data_wo_version=0,
    name="string",
    workspace_id="string")
const blockResource = new prefect.Block("blockResource", {
    typeSlug: "string",
    accountId: "string",
    data: "string",
    dataWo: "string",
    dataWoVersion: 0,
    name: "string",
    workspaceId: "string",
});
type: prefect:Block
properties:
    accountId: string
    data: string
    dataWo: string
    dataWoVersion: 0
    name: string
    typeSlug: string
    workspaceId: string
Block 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 Block resource accepts the following input properties:
- TypeSlug string
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- AccountId string
- Account ID (UUID) where the Block is located
- Data string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo doubleVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- Name string
- Unique name of the Block
- WorkspaceId string
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- TypeSlug string
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- AccountId string
- Account ID (UUID) where the Block is located
- Data string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo float64Version 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- Name string
- Unique name of the Block
- WorkspaceId string
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- typeSlug String
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- accountId String
- Account ID (UUID) where the Block is located
- data String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo DoubleVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name String
- Unique name of the Block
- workspaceId String
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- typeSlug string
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- accountId string
- Account ID (UUID) where the Block is located
- data string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo numberVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name string
- Unique name of the Block
- workspaceId string
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- type_slug str
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- account_id str
- Account ID (UUID) where the Block is located
- data str
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- data_wo str
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- data_wo_ floatversion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name str
- Unique name of the Block
- workspace_id str
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- typeSlug String
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- accountId String
- Account ID (UUID) where the Block is located
- data String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo NumberVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name String
- Unique name of the Block
- workspaceId String
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
Outputs
All input properties are implicitly available as output properties. Additionally, the Block resource produces the following output properties:
Look up Existing Block Resource
Get an existing Block 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?: BlockState, opts?: CustomResourceOptions): Block@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        created: Optional[str] = None,
        data: Optional[str] = None,
        data_wo: Optional[str] = None,
        data_wo_version: Optional[float] = None,
        name: Optional[str] = None,
        type_slug: Optional[str] = None,
        updated: Optional[str] = None,
        workspace_id: Optional[str] = None) -> Blockfunc GetBlock(ctx *Context, name string, id IDInput, state *BlockState, opts ...ResourceOption) (*Block, error)public static Block Get(string name, Input<string> id, BlockState? state, CustomResourceOptions? opts = null)public static Block get(String name, Output<String> id, BlockState state, CustomResourceOptions options)resources:  _:    type: prefect:Block    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- AccountId string
- Account ID (UUID) where the Block is located
- Created string
- Timestamp of when the resource was created (RFC3339)
- Data string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo doubleVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- Name string
- Unique name of the Block
- TypeSlug string
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- WorkspaceId string
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- AccountId string
- Account ID (UUID) where the Block is located
- Created string
- Timestamp of when the resource was created (RFC3339)
- Data string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- DataWo float64Version 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- Name string
- Unique name of the Block
- TypeSlug string
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- WorkspaceId string
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- accountId String
- Account ID (UUID) where the Block is located
- created String
- Timestamp of when the resource was created (RFC3339)
- data String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo DoubleVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name String
- Unique name of the Block
- typeSlug String
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- updated String
- Timestamp of when the resource was updated (RFC3339)
- workspaceId String
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- accountId string
- Account ID (UUID) where the Block is located
- created string
- Timestamp of when the resource was created (RFC3339)
- data string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo string
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo numberVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name string
- Unique name of the Block
- typeSlug string
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- updated string
- Timestamp of when the resource was updated (RFC3339)
- workspaceId string
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- account_id str
- Account ID (UUID) where the Block is located
- created str
- Timestamp of when the resource was created (RFC3339)
- data str
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- data_wo str
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- data_wo_ floatversion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name str
- Unique name of the Block
- type_slug str
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- updated str
- Timestamp of when the resource was updated (RFC3339)
- workspace_id str
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
- accountId String
- Account ID (UUID) where the Block is located
- created String
- Timestamp of when the resource was created (RFC3339)
- data String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo String
- The user-inputted Block payload, as a JSON string. Use jsonencodeon the provided value to satisfy the underlying JSON type. The value's schema will depend on the selectedtypeslug. Useprefect block type inspect <slug>to view the data schema for a given Block type.
- dataWo NumberVersion 
- The version of the data_woattribute. This is used to track changes to thedata_woattribute and trigger updates when the value changes.
- name String
- Unique name of the Block
- typeSlug String
- Block Type slug, which determines the schema of the dataJSON attribute. Useprefect block type lsto view all available Block type slugs.
- updated String
- Timestamp of when the resource was updated (RFC3339)
- workspaceId String
- Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the prefect.Blockresource or the provider'sworkspace_idmust be set.
Package Details
- Repository
- prefect prefecthq/terraform-provider-prefect
- License
- Notes
- This Pulumi package is based on the prefectTerraform Provider.
