From 41e3ce4ec3d7f586ab597d9a770016ab4fcc5ab6 Mon Sep 17 00:00:00 2001 From: Edward Park Date: Wed, 14 Aug 2024 14:14:34 -0700 Subject: [PATCH] chore(docs): add comment about prefect CLI needing to be on 3.0.0rc1 or later --- docs/data-sources/block.md | 6 +++--- docs/resources/block.md | 12 ++++++------ internal/provider/datasources/block.go | 2 +- internal/provider/resources/block.go | 10 ++++++---- 4 files changed, 16 insertions(+), 14 deletions(-) diff --git a/docs/data-sources/block.md b/docs/data-sources/block.md index 6d2f3a63..bfa611b1 100644 --- a/docs/data-sources/block.md +++ b/docs/data-sources/block.md @@ -5,9 +5,9 @@ subcategory: "" description: |- Get information about an existing Block by either: ID, orblock 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. --- @@ -55,5 +55,5 @@ data "prefect_block" "existing_by_id_string" { ### Read-Only - `created` (String) Timestamp of when the resource was created (RFC3339) -- `data` (String, Sensitive) The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected `type` slug. Use `prefect block types inspect ` to view the data schema for a given Block type. +- `data` (String, Sensitive) 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 ` to view the data schema for a given Block type. - `updated` (String) Timestamp of when the resource was updated (RFC3339) diff --git a/docs/resources/block.md b/docs/resources/block.md index 26fad401..ef918f27 100644 --- a/docs/resources/block.md +++ b/docs/resources/block.md @@ -5,16 +5,16 @@ subcategory: "" description: |- The resource block allows creating and managing Prefect Blocks https://docs.prefect.io/latest/concepts/blocks/, which are primitives for configuration / secrets in your flows. block resources represent configurations for schemas for all different Block types. Because of the polymorphic nature of Blocks, you should utilize the prefect CLI https://docs.prefect.io/latest/getting-started/installation/ to inspect all Block types and schemas. - Use prefect block types ls to view all available Block type slugs, which is used in the type_slug attribute. - Use prefect block types inspect to view the data schema for a given Block type. Use this to construct the data attribute value (as JSON string). + Use prefect block type ls to view all available Block type slugs, which is used in the type_slug attribute. + Use prefect block type inspect to view the data schema for a given Block type. Use this to construct the data attribute value (as JSON string). --- # prefect_block (Resource) The resource `block` allows creating and managing [Prefect Blocks](https://docs.prefect.io/latest/concepts/blocks/), which are primitives for configuration / secrets in your flows. `block` resources represent configurations for schemas for all different Block types. Because of the polymorphic nature of Blocks, you should utilize the `prefect` [CLI](https://docs.prefect.io/latest/getting-started/installation/) to inspect all Block types and schemas. -Use `prefect block types ls` to view all available Block type slugs, which is used in the `type_slug` attribute. -Use `prefect block types inspect ` to view the data schema for a given Block type. Use this to construct the `data` attribute value (as JSON string). +Use `prefect block type ls` to view all available Block type slugs, which is used in the `type_slug` attribute. +Use `prefect block type inspect ` to view the data schema for a given Block type. Use this to construct the `data` attribute value (as JSON string). ## Example Usage @@ -75,9 +75,9 @@ resource "prefect_block" "gcp_credentials_key" { ### Required -- `data` (String, Sensitive) The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected `type` slug. Use `prefect block types inspect ` to view the data schema for a given Block type. +- `data` (String, Sensitive) 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 ` to view the data schema for a given Block type. - `name` (String) Unique name of the Block -- `type_slug` (String) Block Type slug, which determines the schema of the `data` JSON attribute. Use `prefect block types ls` to view all available Block type slugs. +- `type_slug` (String) Block Type slug, which determines the schema of the `data` JSON attribute. Use `prefect block type ls` to view all available Block type slugs. ### Optional diff --git a/internal/provider/datasources/block.go b/internal/provider/datasources/block.go index 1a5cb46c..475f326e 100644 --- a/internal/provider/datasources/block.go +++ b/internal/provider/datasources/block.go @@ -97,7 +97,7 @@ Use this data source to obtain Block-specific attributes, such as the data. Computed: true, Sensitive: true, CustomType: jsontypes.NormalizedType{}, - Description: "The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected `type` slug. Use `prefect block types inspect ` to view the data schema for a given Block type.", + Description: "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 ` to view the data schema for a given Block type.", }, "type_slug": schema.StringAttribute{ Computed: true, diff --git a/internal/provider/resources/block.go b/internal/provider/resources/block.go index 04a3bda9..7a4b313a 100644 --- a/internal/provider/resources/block.go +++ b/internal/provider/resources/block.go @@ -74,9 +74,11 @@ func (r *BlockResource) Schema(_ context.Context, _ resource.SchemaRequest, resp "`block` resources represent configurations for schemas for all different Block types. " + "Because of the polymorphic nature of Blocks, you should utilize the `prefect` [CLI](https://docs.prefect.io/latest/getting-started/installation/) to inspect all Block types and schemas." + "\n" + - "Use `prefect block types ls` to view all available Block type slugs, which is used in the `type_slug` attribute." + + "*Note:* you should be on version `3.0.0rc1` or later to use the following commands:" + "\n" + - "Use `prefect block types inspect ` to view the data schema for a given Block type. Use this to construct the `data` attribute value (as JSON string).", + "Use `prefect block type ls` to view all available Block type slugs, which is used in the `type_slug` attribute." + + "\n" + + "Use `prefect block type inspect ` to view the data schema for a given Block type. Use this to construct the `data` attribute value (as JSON string).", Version: 0, Attributes: map[string]schema.Attribute{ "id": schema.StringAttribute{ @@ -105,7 +107,7 @@ func (r *BlockResource) Schema(_ context.Context, _ resource.SchemaRequest, resp }, "type_slug": schema.StringAttribute{ Required: true, - Description: "Block Type slug, which determines the schema of the `data` JSON attribute. Use `prefect block types ls` to view all available Block type slugs.", + Description: "Block Type slug, which determines the schema of the `data` JSON attribute. Use `prefect block type ls` to view all available Block type slugs.", PlanModifiers: []planmodifier.String{ stringplanmodifier.RequiresReplace(), }, @@ -114,7 +116,7 @@ func (r *BlockResource) Schema(_ context.Context, _ resource.SchemaRequest, resp Required: true, Sensitive: true, CustomType: jsontypes.NormalizedType{}, - Description: "The user-inputted Block payload, as a JSON string. The value's schema will depend on the selected `type` slug. Use `prefect block types inspect ` to view the data schema for a given Block type.", + Description: "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 ` to view the data schema for a given Block type.", }, "account_id": schema.StringAttribute{ Optional: true,