Skip to content

Commit 7f4847b

Browse files
authored
helper/schema: Clarify Schema type Deprecated documentation for Terraform 1.2.7 and later (#1028)
Reference: hashicorp/terraform#31576
1 parent 28f7b22 commit 7f4847b

File tree

2 files changed

+28
-27
lines changed

2 files changed

+28
-27
lines changed

helper/schema/schema.go

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -311,32 +311,33 @@ type Schema struct {
311311
// "parent_block_name.0.child_attribute_name".
312312
RequiredWith []string
313313

314-
// Deprecated defines warning diagnostic details to display to
315-
// practitioners configuring this attribute or block. The warning
314+
// Deprecated defines warning diagnostic details to display when
315+
// practitioner configurations use this attribute or block. The warning
316316
// diagnostic summary is automatically set to "Argument is deprecated"
317317
// along with configuration source file and line information.
318318
//
319-
// This warning diagnostic is only displayed during Terraform's validation
320-
// phase when this field is a non-empty string, when the attribute is
321-
// Required or Optional, and if the practitioner configuration attempts to
322-
// set the attribute value to a known value. It cannot detect practitioner
323-
// configuration values that are unknown ("known after apply").
319+
// Set this field to a practitioner actionable message such as:
324320
//
325-
// This field has no effect when the attribute is Computed-only (read-only;
326-
// not Required or Optional) and a practitioner attempts to reference
327-
// this attribute value in their configuration. There is a Terraform
328-
// feature request to support this type of functionality:
321+
// - "Configure other_attribute instead. This attribute will be removed
322+
// in the next major version of the provider."
323+
// - "Remove this attribute's configuration as it no longer is used and
324+
// the attribute will be removed in the next major version of the
325+
// provider."
329326
//
330-
// https://github.com/hashicorp/terraform/issues/7569
327+
// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
328+
// time a practitioner attempts to configure a known value for this
329+
// attribute and certain scenarios where this attribute is referenced.
331330
//
332-
// Set this field to a practitioner actionable message such as:
331+
// In Terraform 1.2.6 and earlier, this warning diagnostic is only
332+
// displayed when the attribute is Required or Optional, and if the
333+
// practitioner configuration attempts to set the attribute value to a
334+
// known value. It cannot detect practitioner configuration values that
335+
// are unknown ("known after apply").
333336
//
334-
// - "Configure other_attribute instead. This attribute will be removed
335-
// in the next major version of the provider."
336-
// - "Remove this attribute's configuration as it no longer is used and
337-
// the attribute will be removed in the next major version of the
338-
// provider."
337+
// Additional information about deprecation enhancements for read-only
338+
// attributes can be found in:
339339
//
340+
// - https://github.com/hashicorp/terraform/issues/7569
340341
Deprecated string
341342

342343
// ValidateFunc allows individual fields to define arbitrary validation

website/docs/plugin/sdkv2/schemas/schema-methods.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -139,15 +139,15 @@ ConflictsWith []string
139139
// future. This string is the message shown to the user with instructions on
140140
// how to address the deprecation.
141141
//
142-
// This warning diagnostic is only displayed during Terraform's validation
143-
// phase when the attribute is Required or Optional and if the practitioner
144-
// configuration attempts to set the attribute value to a known value. It
145-
// cannot detect practitioner configuration values that are unknown ("known
146-
// after apply").
147-
//
148-
// This field has no effect when the attribute is Computed-only (read-only;
149-
// not Required or Optional) and a practitioner attempts to reference
150-
// this attribute value in their configuration.
142+
// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
143+
// time a practitioner attempts to configure a known value for this
144+
// attribute and certain scenarios where this attribute is referenced.
145+
//
146+
// In Terraform 1.2.6 and earlier, this warning diagnostic is only
147+
// displayed when the attribute is Required or Optional, and if the
148+
// practitioner configuration attempts to set the attribute value to a
149+
// known value. It cannot detect practitioner configuration values that
150+
// are unknown ("known after apply").
151151
Deprecated string
152152
153153
// When Removed is set, this attribute has been removed from the schema

0 commit comments

Comments
 (0)