prefect.BlockType
Explore with Pulumi AI
The resource block_type
allows creating and managing Prefect Block Types.
This feature is available in the following product plan(s): .
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as prefect from "@pulumi/prefect";
const test = new prefect.BlockType("test", {
codeExample: "Some code example",
description: "My custom block type",
documentationUrl: "https://example.com/documentation",
logoUrl: "https://example.com/logo.png",
slug: "my-block-type",
});
import pulumi
import pulumi_prefect as prefect
test = prefect.BlockType("test",
code_example="Some code example",
description="My custom block type",
documentation_url="https://example.com/documentation",
logo_url="https://example.com/logo.png",
slug="my-block-type")
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 {
_, err := prefect.NewBlockType(ctx, "test", &prefect.BlockTypeArgs{
CodeExample: pulumi.String("Some code example"),
Description: pulumi.String("My custom block type"),
DocumentationUrl: pulumi.String("https://example.com/documentation"),
LogoUrl: pulumi.String("https://example.com/logo.png"),
Slug: pulumi.String("my-block-type"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Prefect = Pulumi.Prefect;
return await Deployment.RunAsync(() =>
{
var test = new Prefect.BlockType("test", new()
{
CodeExample = "Some code example",
Description = "My custom block type",
DocumentationUrl = "https://example.com/documentation",
LogoUrl = "https://example.com/logo.png",
Slug = "my-block-type",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.prefect.BlockType;
import com.pulumi.prefect.BlockTypeArgs;
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) {
var test = new BlockType("test", BlockTypeArgs.builder()
.codeExample("Some code example")
.description("My custom block type")
.documentationUrl("https://example.com/documentation")
.logoUrl("https://example.com/logo.png")
.slug("my-block-type")
.build());
}
}
resources:
test:
type: prefect:BlockType
properties:
codeExample: Some code example
description: My custom block type
documentationUrl: https://example.com/documentation
logoUrl: https://example.com/logo.png
slug: my-block-type
Create BlockType Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BlockType(name: string, args: BlockTypeArgs, opts?: CustomResourceOptions);
@overload
def BlockType(resource_name: str,
args: BlockTypeArgs,
opts: Optional[ResourceOptions] = None)
@overload
def BlockType(resource_name: str,
opts: Optional[ResourceOptions] = None,
slug: Optional[str] = None,
account_id: Optional[str] = None,
code_example: Optional[str] = None,
description: Optional[str] = None,
documentation_url: Optional[str] = None,
logo_url: Optional[str] = None,
name: Optional[str] = None,
workspace_id: Optional[str] = None)
func NewBlockType(ctx *Context, name string, args BlockTypeArgs, opts ...ResourceOption) (*BlockType, error)
public BlockType(string name, BlockTypeArgs args, CustomResourceOptions? opts = null)
public BlockType(String name, BlockTypeArgs args)
public BlockType(String name, BlockTypeArgs args, CustomResourceOptions options)
type: prefect:BlockType
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 BlockTypeArgs
- 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 BlockTypeArgs
- 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 BlockTypeArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BlockTypeArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BlockTypeArgs
- 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 blockTypeResource = new Prefect.BlockType("blockTypeResource", new()
{
Slug = "string",
AccountId = "string",
CodeExample = "string",
Description = "string",
DocumentationUrl = "string",
LogoUrl = "string",
Name = "string",
WorkspaceId = "string",
});
example, err := prefect.NewBlockType(ctx, "blockTypeResource", &prefect.BlockTypeArgs{
Slug: pulumi.String("string"),
AccountId: pulumi.String("string"),
CodeExample: pulumi.String("string"),
Description: pulumi.String("string"),
DocumentationUrl: pulumi.String("string"),
LogoUrl: pulumi.String("string"),
Name: pulumi.String("string"),
WorkspaceId: pulumi.String("string"),
})
var blockTypeResource = new BlockType("blockTypeResource", BlockTypeArgs.builder()
.slug("string")
.accountId("string")
.codeExample("string")
.description("string")
.documentationUrl("string")
.logoUrl("string")
.name("string")
.workspaceId("string")
.build());
block_type_resource = prefect.BlockType("blockTypeResource",
slug="string",
account_id="string",
code_example="string",
description="string",
documentation_url="string",
logo_url="string",
name="string",
workspace_id="string")
const blockTypeResource = new prefect.BlockType("blockTypeResource", {
slug: "string",
accountId: "string",
codeExample: "string",
description: "string",
documentationUrl: "string",
logoUrl: "string",
name: "string",
workspaceId: "string",
});
type: prefect:BlockType
properties:
accountId: string
codeExample: string
description: string
documentationUrl: string
logoUrl: string
name: string
slug: string
workspaceId: string
BlockType 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 BlockType resource accepts the following input properties:
- Slug string
- The slug of the block type.
- Account
Id string - Account ID (UUID) where the Block is located
- Code
Example string - A code snippet demonstrating use of the corresponding block.
- Description string
- A short blurb about the corresponding block's intended use.
- Documentation
Url string - Web URL for the block type's documentation.
- Logo
Url string - Web URL for the block type's logo.
- Name string
- The name of the block type.
- Workspace
Id string - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- Slug string
- The slug of the block type.
- Account
Id string - Account ID (UUID) where the Block is located
- Code
Example string - A code snippet demonstrating use of the corresponding block.
- Description string
- A short blurb about the corresponding block's intended use.
- Documentation
Url string - Web URL for the block type's documentation.
- Logo
Url string - Web URL for the block type's logo.
- Name string
- The name of the block type.
- Workspace
Id string - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- slug String
- The slug of the block type.
- account
Id String - Account ID (UUID) where the Block is located
- code
Example String - A code snippet demonstrating use of the corresponding block.
- description String
- A short blurb about the corresponding block's intended use.
- documentation
Url String - Web URL for the block type's documentation.
- logo
Url String - Web URL for the block type's logo.
- name String
- The name of the block type.
- workspace
Id String - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- slug string
- The slug of the block type.
- account
Id string - Account ID (UUID) where the Block is located
- code
Example string - A code snippet demonstrating use of the corresponding block.
- description string
- A short blurb about the corresponding block's intended use.
- documentation
Url string - Web URL for the block type's documentation.
- logo
Url string - Web URL for the block type's logo.
- name string
- The name of the block type.
- workspace
Id string - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- slug str
- The slug of the block type.
- account_
id str - Account ID (UUID) where the Block is located
- code_
example str - A code snippet demonstrating use of the corresponding block.
- description str
- A short blurb about the corresponding block's intended use.
- documentation_
url str - Web URL for the block type's documentation.
- logo_
url str - Web URL for the block type's logo.
- name str
- The name of the block type.
- workspace_
id str - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- slug String
- The slug of the block type.
- account
Id String - Account ID (UUID) where the Block is located
- code
Example String - A code snippet demonstrating use of the corresponding block.
- description String
- A short blurb about the corresponding block's intended use.
- documentation
Url String - Web URL for the block type's documentation.
- logo
Url String - Web URL for the block type's logo.
- name String
- The name of the block type.
- workspace
Id String - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
Outputs
All input properties are implicitly available as output properties. Additionally, the BlockType resource produces the following output properties:
- Created string
- Timestamp of when the resource was created (RFC3339)
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Protected bool - Whether the block type is protected. Protected block types cannot be modified via API.
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- Created string
- Timestamp of when the resource was created (RFC3339)
- Id string
- The provider-assigned unique ID for this managed resource.
- Is
Protected bool - Whether the block type is protected. Protected block types cannot be modified via API.
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- created String
- Timestamp of when the resource was created (RFC3339)
- id String
- The provider-assigned unique ID for this managed resource.
- is
Protected Boolean - Whether the block type is protected. Protected block types cannot be modified via API.
- updated String
- Timestamp of when the resource was updated (RFC3339)
- created string
- Timestamp of when the resource was created (RFC3339)
- id string
- The provider-assigned unique ID for this managed resource.
- is
Protected boolean - Whether the block type is protected. Protected block types cannot be modified via API.
- updated string
- Timestamp of when the resource was updated (RFC3339)
- created str
- Timestamp of when the resource was created (RFC3339)
- id str
- The provider-assigned unique ID for this managed resource.
- is_
protected bool - Whether the block type is protected. Protected block types cannot be modified via API.
- updated str
- Timestamp of when the resource was updated (RFC3339)
- created String
- Timestamp of when the resource was created (RFC3339)
- id String
- The provider-assigned unique ID for this managed resource.
- is
Protected Boolean - Whether the block type is protected. Protected block types cannot be modified via API.
- updated String
- Timestamp of when the resource was updated (RFC3339)
Look up Existing BlockType Resource
Get an existing BlockType 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?: BlockTypeState, opts?: CustomResourceOptions): BlockType
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
account_id: Optional[str] = None,
code_example: Optional[str] = None,
created: Optional[str] = None,
description: Optional[str] = None,
documentation_url: Optional[str] = None,
is_protected: Optional[bool] = None,
logo_url: Optional[str] = None,
name: Optional[str] = None,
slug: Optional[str] = None,
updated: Optional[str] = None,
workspace_id: Optional[str] = None) -> BlockType
func GetBlockType(ctx *Context, name string, id IDInput, state *BlockTypeState, opts ...ResourceOption) (*BlockType, error)
public static BlockType Get(string name, Input<string> id, BlockTypeState? state, CustomResourceOptions? opts = null)
public static BlockType get(String name, Output<String> id, BlockTypeState state, CustomResourceOptions options)
resources: _: type: prefect:BlockType 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.
- Account
Id string - Account ID (UUID) where the Block is located
- Code
Example string - A code snippet demonstrating use of the corresponding block.
- Created string
- Timestamp of when the resource was created (RFC3339)
- Description string
- A short blurb about the corresponding block's intended use.
- Documentation
Url string - Web URL for the block type's documentation.
- Is
Protected bool - Whether the block type is protected. Protected block types cannot be modified via API.
- Logo
Url string - Web URL for the block type's logo.
- Name string
- The name of the block type.
- Slug string
- The slug of the block type.
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- Workspace
Id string - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- Account
Id string - Account ID (UUID) where the Block is located
- Code
Example string - A code snippet demonstrating use of the corresponding block.
- Created string
- Timestamp of when the resource was created (RFC3339)
- Description string
- A short blurb about the corresponding block's intended use.
- Documentation
Url string - Web URL for the block type's documentation.
- Is
Protected bool - Whether the block type is protected. Protected block types cannot be modified via API.
- Logo
Url string - Web URL for the block type's logo.
- Name string
- The name of the block type.
- Slug string
- The slug of the block type.
- Updated string
- Timestamp of when the resource was updated (RFC3339)
- Workspace
Id string - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- account
Id String - Account ID (UUID) where the Block is located
- code
Example String - A code snippet demonstrating use of the corresponding block.
- created String
- Timestamp of when the resource was created (RFC3339)
- description String
- A short blurb about the corresponding block's intended use.
- documentation
Url String - Web URL for the block type's documentation.
- is
Protected Boolean - Whether the block type is protected. Protected block types cannot be modified via API.
- logo
Url String - Web URL for the block type's logo.
- name String
- The name of the block type.
- slug String
- The slug of the block type.
- updated String
- Timestamp of when the resource was updated (RFC3339)
- workspace
Id String - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- account
Id string - Account ID (UUID) where the Block is located
- code
Example string - A code snippet demonstrating use of the corresponding block.
- created string
- Timestamp of when the resource was created (RFC3339)
- description string
- A short blurb about the corresponding block's intended use.
- documentation
Url string - Web URL for the block type's documentation.
- is
Protected boolean - Whether the block type is protected. Protected block types cannot be modified via API.
- logo
Url string - Web URL for the block type's logo.
- name string
- The name of the block type.
- slug string
- The slug of the block type.
- updated string
- Timestamp of when the resource was updated (RFC3339)
- workspace
Id string - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
- account_
id str - Account ID (UUID) where the Block is located
- code_
example str - A code snippet demonstrating use of the corresponding block.
- created str
- Timestamp of when the resource was created (RFC3339)
- description str
- A short blurb about the corresponding block's intended use.
- documentation_
url str - Web URL for the block type's documentation.
- is_
protected bool - Whether the block type is protected. Protected block types cannot be modified via API.
- logo_
url str - Web URL for the block type's logo.
- name str
- The name of the block type.
- slug str
- The slug of the block type.
- 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.Block
resource or the provider'sworkspace_id
must be set.
- account
Id String - Account ID (UUID) where the Block is located
- code
Example String - A code snippet demonstrating use of the corresponding block.
- created String
- Timestamp of when the resource was created (RFC3339)
- description String
- A short blurb about the corresponding block's intended use.
- documentation
Url String - Web URL for the block type's documentation.
- is
Protected Boolean - Whether the block type is protected. Protected block types cannot be modified via API.
- logo
Url String - Web URL for the block type's logo.
- name String
- The name of the block type.
- slug String
- The slug of the block type.
- updated String
- Timestamp of when the resource was updated (RFC3339)
- workspace
Id String - Workspace ID (UUID) where the Block is located. In Prefect Cloud, either the
prefect.Block
resource or the provider'sworkspace_id
must be set.
Import
prefect_block_type resources can be imported by the block_type_id
$ pulumi import prefect:index/blockType:BlockType my_block_type 00000000-0000-0000-0000-000000000000
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.