schema

package
v1.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: MPL-2.0 Imports: 14 Imported by: 284

Documentation

Overview

Package schema contains all available schema functionality for resources. Resource schemas define the structure and value types for configuration, plan, and state data. Schemas are implemented via the resource.Resource type Schema method.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attribute

type Attribute interface {
	fwschema.Attribute
}

Attribute define a value field inside the Schema. Implementations in this package include:

  • BoolAttribute
  • Float64Attribute
  • Int64Attribute
  • ListAttribute
  • MapAttribute
  • NumberAttribute
  • ObjectAttribute
  • SetAttribute
  • StringAttribute

Additionally, the NestedAttribute interface extends Attribute with nested attributes. Only supported in protocol version 6. Implementations in this package include:

  • ListNestedAttribute
  • MapNestedAttribute
  • SetNestedAttribute
  • SingleNestedAttribute

In practitioner configurations, an equals sign (=) is required to set the value. Configuration Reference

type Block

type Block interface {
	fwschema.Block
}

Block defines a structural field inside a Schema. Implementations in this package include:

  • ListNestedBlock
  • SetNestedBlock
  • SingleNestedBlock

In practitioner configurations, an equals sign (=) cannot be used to set the value. Blocks are instead repeated as necessary, or require the use of Dynamic Block Expressions.

Prefer NestedAttribute over Block. Blocks should typically be used for configuration compatibility with previously existing schemas from an older Terraform Plugin SDK. Efforts should be made to convert from Block to NestedAttribute as a breaking change for practitioners.

type BoolAttribute

type BoolAttribute struct {
	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.BoolType. When retrieving data, the basetypes.BoolValuable
	// associated with this custom type must be used in place of types.Bool.
	CustomType basetypes.BoolTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Bool

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Bool

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Bool
}

BoolAttribute represents a schema attribute that is a boolean. When retrieving the value for this attribute, use types.Bool as the value type unless the CustomType field is set.

Terraform configurations configure this attribute using expressions that return a boolean or directly via the true/false keywords.

example_attribute = true

Terraform configurations reference this attribute using the attribute name.

.example_attribute

func (BoolAttribute) ApplyTerraform5AttributePathStep

func (a BoolAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep always returns an error as it is not possible to step further into a BoolAttribute.

func (BoolAttribute) BoolDefaultValue added in v1.2.0

func (a BoolAttribute) BoolDefaultValue() defaults.Bool

BoolDefaultValue returns the Default field value.

func (BoolAttribute) BoolPlanModifiers

func (a BoolAttribute) BoolPlanModifiers() []planmodifier.Bool

BoolPlanModifiers returns the PlanModifiers field value.

func (BoolAttribute) BoolValidators

func (a BoolAttribute) BoolValidators() []validator.Bool

BoolValidators returns the Validators field value.

func (BoolAttribute) Equal

func (a BoolAttribute) Equal(o fwschema.Attribute) bool

Equal returns true if the given Attribute is a BoolAttribute and all fields are equal.

func (BoolAttribute) GetDeprecationMessage

func (a BoolAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (BoolAttribute) GetDescription

func (a BoolAttribute) GetDescription() string

GetDescription returns the Description field value.

func (BoolAttribute) GetMarkdownDescription

func (a BoolAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (BoolAttribute) GetType

func (a BoolAttribute) GetType() attr.Type

GetType returns types.StringType or the CustomType field value if defined.

func (BoolAttribute) IsComputed

func (a BoolAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (BoolAttribute) IsOptional

func (a BoolAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (BoolAttribute) IsRequired

func (a BoolAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (BoolAttribute) IsSensitive

func (a BoolAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (BoolAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type DynamicAttribute added in v1.7.0

type DynamicAttribute struct {
	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.DynamicType. When retrieving data, the basetypes.DynamicValuable
	// associated with this custom type must be used in place of types.Dynamic.
	CustomType basetypes.DynamicTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Dynamic

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Dynamic

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Dynamic
}

DynamicAttribute represents a schema attribute that is a dynamic, rather than a single static type. Static types are always preferable over dynamic types in Terraform as practitioners will receive less helpful configuration assistance from validation error diagnostics and editor integrations. When retrieving the value for this attribute, use types.Dynamic as the value type unless the CustomType field is set.

The concrete value type for a dynamic is determined at runtime in this order:

  1. By Terraform, if defined in the configuration (if Required or Optional).
  2. By the provider (if Computed).

Once the concrete value type has been determined, it must remain consistent between plan and apply or Terraform will return an error.

func (DynamicAttribute) ApplyTerraform5AttributePathStep added in v1.7.0

func (a DynamicAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep always returns an error as it is not possible to step further into a DynamicAttribute.

func (DynamicAttribute) DynamicDefaultValue added in v1.7.0

func (a DynamicAttribute) DynamicDefaultValue() defaults.Dynamic

DynamicDefaultValue returns the Default field value.

func (DynamicAttribute) DynamicPlanModifiers added in v1.7.0

func (a DynamicAttribute) DynamicPlanModifiers() []planmodifier.Dynamic

DynamicPlanModifiers returns the PlanModifiers field value.

func (DynamicAttribute) DynamicValidators added in v1.7.0

func (a DynamicAttribute) DynamicValidators() []validator.Dynamic

DynamicValidators returns the Validators field value.

func (DynamicAttribute) Equal added in v1.7.0

Equal returns true if the given Attribute is a DynamicAttribute and all fields are equal.

func (DynamicAttribute) GetDeprecationMessage added in v1.7.0

func (a DynamicAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (DynamicAttribute) GetDescription added in v1.7.0

func (a DynamicAttribute) GetDescription() string

GetDescription returns the Description field value.

func (DynamicAttribute) GetMarkdownDescription added in v1.7.0

func (a DynamicAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (DynamicAttribute) GetType added in v1.7.0

func (a DynamicAttribute) GetType() attr.Type

GetType returns types.DynamicType or the CustomType field value if defined.

func (DynamicAttribute) IsComputed added in v1.7.0

func (a DynamicAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (DynamicAttribute) IsOptional added in v1.7.0

func (a DynamicAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (DynamicAttribute) IsRequired added in v1.7.0

func (a DynamicAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (DynamicAttribute) IsSensitive added in v1.7.0

func (a DynamicAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (DynamicAttribute) ValidateImplementation added in v1.7.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type Float64Attribute

type Float64Attribute struct {
	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.Float64Type. When retrieving data, the basetypes.Float64Valuable
	// associated with this custom type must be used in place of types.Float64.
	CustomType basetypes.Float64Typable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Float64

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Float64

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Float64
}

Float64Attribute represents a schema attribute that is a 64-bit floating point number. When retrieving the value for this attribute, use types.Float64 as the value type unless the CustomType field is set.

Use Int64Attribute for 64-bit integer attributes or NumberAttribute for 512-bit generic number attributes.

Terraform configurations configure this attribute using expressions that return a number or directly via a floating point value.

example_attribute = 123.45

Terraform configurations reference this attribute using the attribute name.

.example_attribute

func (Float64Attribute) ApplyTerraform5AttributePathStep

func (a Float64Attribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep always returns an error as it is not possible to step further into a Float64Attribute.

func (Float64Attribute) Equal

Equal returns true if the given Attribute is a Float64Attribute and all fields are equal.

func (Float64Attribute) Float64DefaultValue added in v1.2.0

func (a Float64Attribute) Float64DefaultValue() defaults.Float64

Float64DefaultValue returns the Default field value.

func (Float64Attribute) Float64PlanModifiers

func (a Float64Attribute) Float64PlanModifiers() []planmodifier.Float64

Float64PlanModifiers returns the PlanModifiers field value.

func (Float64Attribute) Float64Validators

func (a Float64Attribute) Float64Validators() []validator.Float64

Float64Validators returns the Validators field value.

func (Float64Attribute) GetDeprecationMessage

func (a Float64Attribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (Float64Attribute) GetDescription

func (a Float64Attribute) GetDescription() string

GetDescription returns the Description field value.

func (Float64Attribute) GetMarkdownDescription

func (a Float64Attribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (Float64Attribute) GetType

func (a Float64Attribute) GetType() attr.Type

GetType returns types.Float64Type or the CustomType field value if defined.

func (Float64Attribute) IsComputed

func (a Float64Attribute) IsComputed() bool

IsComputed returns the Computed field value.

func (Float64Attribute) IsOptional

func (a Float64Attribute) IsOptional() bool

IsOptional returns the Optional field value.

func (Float64Attribute) IsRequired

func (a Float64Attribute) IsRequired() bool

IsRequired returns the Required field value.

func (Float64Attribute) IsSensitive

func (a Float64Attribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (Float64Attribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type Int64Attribute

type Int64Attribute struct {
	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.Int64Type. When retrieving data, the basetypes.Int64Valuable
	// associated with this custom type must be used in place of types.Int64.
	CustomType basetypes.Int64Typable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Int64

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Int64

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Int64
}

Int64Attribute represents a schema attribute that is a 64-bit integer. When retrieving the value for this attribute, use types.Int64 as the value type unless the CustomType field is set.

Use Float64Attribute for 64-bit floating point number attributes or NumberAttribute for 512-bit generic number attributes.

Terraform configurations configure this attribute using expressions that return a number or directly via an integer value.

example_attribute = 123

Terraform configurations reference this attribute using the attribute name.

.example_attribute

func (Int64Attribute) ApplyTerraform5AttributePathStep

func (a Int64Attribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep always returns an error as it is not possible to step further into a Int64Attribute.

func (Int64Attribute) Equal

Equal returns true if the given Attribute is a Int64Attribute and all fields are equal.

func (Int64Attribute) GetDeprecationMessage

func (a Int64Attribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (Int64Attribute) GetDescription

func (a Int64Attribute) GetDescription() string

GetDescription returns the Description field value.

func (Int64Attribute) GetMarkdownDescription

func (a Int64Attribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (Int64Attribute) GetType

func (a Int64Attribute) GetType() attr.Type

GetType returns types.Int64Type or the CustomType field value if defined.

func (Int64Attribute) Int64DefaultValue added in v1.2.0

func (a Int64Attribute) Int64DefaultValue() defaults.Int64

Int64DefaultValue returns the Default field value.

func (Int64Attribute) Int64PlanModifiers

func (a Int64Attribute) Int64PlanModifiers() []planmodifier.Int64

Int64PlanModifiers returns the PlanModifiers field value.

func (Int64Attribute) Int64Validators

func (a Int64Attribute) Int64Validators() []validator.Int64

Int64Validators returns the Validators field value.

func (Int64Attribute) IsComputed

func (a Int64Attribute) IsComputed() bool

IsComputed returns the Computed field value.

func (Int64Attribute) IsOptional

func (a Int64Attribute) IsOptional() bool

IsOptional returns the Optional field value.

func (Int64Attribute) IsRequired

func (a Int64Attribute) IsRequired() bool

IsRequired returns the Required field value.

func (Int64Attribute) IsSensitive

func (a Int64Attribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (Int64Attribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type ListAttribute

type ListAttribute struct {
	// ElementType is the type for all elements of the list. This field must be
	// set.
	//
	// Element types that contain a dynamic type (i.e. types.Dynamic) are not supported.
	// If underlying dynamic values are required, replace this attribute definition with
	// DynamicAttribute instead.
	ElementType attr.Type

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.ListType. When retrieving data, the basetypes.ListValuable
	// associated with this custom type must be used in place of types.List.
	CustomType basetypes.ListTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.List

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.List

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.List
}

ListAttribute represents a schema attribute that is a list with a single element type. When retrieving the value for this attribute, use types.List as the value type unless the CustomType field is set. The ElementType field must be set.

Use ListNestedAttribute if the underlying elements should be objects and require definition beyond type information.

Terraform configurations configure this attribute using expressions that return a list or directly via square brace syntax.

# list of strings
example_attribute = ["first", "second"]

Terraform configurations reference this attribute using expressions that accept a list or an element directly via square brace 0-based index syntax:

# first known element
.example_attribute[0]

func (ListAttribute) ApplyTerraform5AttributePathStep

func (a ListAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the result of stepping into a list index or an error.

func (ListAttribute) Equal

func (a ListAttribute) Equal(o fwschema.Attribute) bool

Equal returns true if the given Attribute is a ListAttribute and all fields are equal.

func (ListAttribute) GetDeprecationMessage

func (a ListAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (ListAttribute) GetDescription

func (a ListAttribute) GetDescription() string

GetDescription returns the Description field value.

func (ListAttribute) GetMarkdownDescription

func (a ListAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (ListAttribute) GetType

func (a ListAttribute) GetType() attr.Type

GetType returns types.ListType or the CustomType field value if defined.

func (ListAttribute) IsComputed

func (a ListAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (ListAttribute) IsOptional

func (a ListAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (ListAttribute) IsRequired

func (a ListAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (ListAttribute) IsSensitive

func (a ListAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (ListAttribute) ListDefaultValue added in v1.2.0

func (a ListAttribute) ListDefaultValue() defaults.List

ListDefaultValue returns the Default field value.

func (ListAttribute) ListPlanModifiers

func (a ListAttribute) ListPlanModifiers() []planmodifier.List

ListPlanModifiers returns the PlanModifiers field value.

func (ListAttribute) ListValidators

func (a ListAttribute) ListValidators() []validator.List

ListValidators returns the Validators field value.

func (ListAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type ListNestedAttribute

type ListNestedAttribute struct {
	// NestedObject is the underlying object that contains nested attributes.
	// This field must be set.
	//
	// Nested attributes that contain a dynamic type (i.e. DynamicAttribute) are not supported.
	// If underlying dynamic values are required, replace this attribute definition with
	// DynamicAttribute instead.
	NestedObject NestedAttributeObject

	// CustomType enables the use of a custom attribute type in place of the
	// default types.ListType of types.ObjectType. When retrieving data, the
	// basetypes.ListValuable associated with this custom type must be used in
	// place of types.List.
	CustomType basetypes.ListTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.List

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.List

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.List
}

ListNestedAttribute represents an attribute that is a list of objects where the object attributes can be fully defined, including further nested attributes. When retrieving the value for this attribute, use types.List as the value type unless the CustomType field is set. The NestedObject field must be set. Nested attributes are only compatible with protocol version 6.

Use ListAttribute if the underlying elements are of a single type and do not require definition beyond type information.

Terraform configurations configure this attribute using expressions that return a list of objects or directly via square and curly brace syntax.

# list of objects
example_attribute = [
	{
		nested_attribute = #...
	},
]

Terraform configurations reference this attribute using expressions that accept a list of objects or an element directly via square brace 0-based index syntax:

# first known object
.example_attribute[0]
# first known object nested_attribute value
.example_attribute[0].nested_attribute

func (ListNestedAttribute) ApplyTerraform5AttributePathStep

func (a ListNestedAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the Attributes field value if step is ElementKeyInt, otherwise returns an error.

func (ListNestedAttribute) Equal

Equal returns true if the given Attribute is a ListNestedAttribute and all fields are equal.

func (ListNestedAttribute) GetDeprecationMessage

func (a ListNestedAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (ListNestedAttribute) GetDescription

func (a ListNestedAttribute) GetDescription() string

GetDescription returns the Description field value.

func (ListNestedAttribute) GetMarkdownDescription

func (a ListNestedAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (ListNestedAttribute) GetNestedObject

GetNestedObject returns the NestedObject field value.

func (ListNestedAttribute) GetNestingMode

func (a ListNestedAttribute) GetNestingMode() fwschema.NestingMode

GetNestingMode always returns NestingModeList.

func (ListNestedAttribute) GetType

func (a ListNestedAttribute) GetType() attr.Type

GetType returns ListType of ObjectType or CustomType.

func (ListNestedAttribute) IsComputed

func (a ListNestedAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (ListNestedAttribute) IsOptional

func (a ListNestedAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (ListNestedAttribute) IsRequired

func (a ListNestedAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (ListNestedAttribute) IsSensitive

func (a ListNestedAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (ListNestedAttribute) ListDefaultValue added in v1.2.0

func (a ListNestedAttribute) ListDefaultValue() defaults.List

ListDefaultValue returns the Default field value.

func (ListNestedAttribute) ListPlanModifiers

func (a ListNestedAttribute) ListPlanModifiers() []planmodifier.List

ListPlanModifiers returns the PlanModifiers field value.

func (ListNestedAttribute) ListValidators

func (a ListNestedAttribute) ListValidators() []validator.List

ListValidators returns the Validators field value.

func (ListNestedAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type ListNestedBlock

type ListNestedBlock struct {
	// NestedObject is the underlying object that contains nested attributes or
	// blocks. This field must be set.
	//
	// Nested attributes that contain a dynamic type (i.e. DynamicAttribute) are not supported.
	// If underlying dynamic values are required, replace this block definition with
	// a DynamicAttribute.
	NestedObject NestedBlockObject

	// CustomType enables the use of a custom attribute type in place of the
	// default types.ListType of types.ObjectType. When retrieving data, the
	// basetypes.ListValuable associated with this custom type must be used in
	// place of types.List.
	CustomType basetypes.ListTypable

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.List

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.List
}

ListNestedBlock represents a block that is a list of objects where the object attributes can be fully defined, including further attributes or blocks. When retrieving the value for this block, use types.List as the value type unless the CustomType field is set. The NestedObject field must be set.

Prefer ListNestedAttribute over ListNestedBlock if the provider is using protocol version 6. Nested attributes allow practitioners to configure values directly with expressions.

Terraform configurations configure this block repeatedly using curly brace syntax without an equals (=) sign or Dynamic Block Expressions.

# list of blocks with two elements
example_block {
	nested_attribute = #...
}
example_block {
	nested_attribute = #...
}

Terraform configurations reference this block using expressions that accept a list of objects or an element directly via square brace 0-based index syntax:

# first known object
.example_block[0]
# first known object nested_attribute value
.example_block[0].nested_attribute

func (ListNestedBlock) ApplyTerraform5AttributePathStep

func (b ListNestedBlock) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the NestedObject field value if step is ElementKeyInt, otherwise returns an error.

func (ListNestedBlock) Equal

func (b ListNestedBlock) Equal(o fwschema.Block) bool

Equal returns true if the given Block is ListNestedBlock and all fields are equal.

func (ListNestedBlock) GetDeprecationMessage

func (b ListNestedBlock) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (ListNestedBlock) GetDescription

func (b ListNestedBlock) GetDescription() string

GetDescription returns the Description field value.

func (ListNestedBlock) GetMarkdownDescription

func (b ListNestedBlock) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (ListNestedBlock) GetNestedObject

func (b ListNestedBlock) GetNestedObject() fwschema.NestedBlockObject

GetNestedObject returns the NestedObject field value.

func (ListNestedBlock) GetNestingMode

func (b ListNestedBlock) GetNestingMode() fwschema.BlockNestingMode

GetNestingMode always returns BlockNestingModeList.

func (ListNestedBlock) ListPlanModifiers

func (b ListNestedBlock) ListPlanModifiers() []planmodifier.List

ListPlanModifiers returns the PlanModifiers field value.

func (ListNestedBlock) ListValidators

func (b ListNestedBlock) ListValidators() []validator.List

ListValidators returns the Validators field value.

func (ListNestedBlock) Type

func (b ListNestedBlock) Type() attr.Type

Type returns ListType of ObjectType or CustomType.

func (ListNestedBlock) ValidateImplementation added in v1.7.0

ValidateImplementation contains logic for validating the provider-defined implementation of the block to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type MapAttribute

type MapAttribute struct {
	// ElementType is the type for all elements of the map. This field must be
	// set.
	//
	// Element types that contain a dynamic type (i.e. types.Dynamic) are not supported.
	// If underlying dynamic values are required, replace this attribute definition with
	// DynamicAttribute instead.
	ElementType attr.Type

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.MapType. When retrieving data, the basetypes.MapValuable
	// associated with this custom type must be used in place of types.Map.
	CustomType basetypes.MapTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Map

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Map

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Map
}

MapAttribute represents a schema attribute that is a list with a single element type. When retrieving the value for this attribute, use types.Map as the value type unless the CustomType field is set. The ElementType field must be set.

Use MapNestedAttribute if the underlying elements should be objects and require definition beyond type information.

Terraform configurations configure this attribute using expressions that return a list or directly via curly brace syntax.

# map of strings
example_attribute = {
	key1 = "first",
	key2 = "second",
}

Terraform configurations reference this attribute using expressions that accept a map or an element directly via square brace string syntax:

# key1 known element
.example_attribute["key1"]

func (MapAttribute) ApplyTerraform5AttributePathStep

func (a MapAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the result of stepping into a map index or an error.

func (MapAttribute) Equal

func (a MapAttribute) Equal(o fwschema.Attribute) bool

Equal returns true if the given Attribute is a MapAttribute and all fields are equal.

func (MapAttribute) GetDeprecationMessage

func (a MapAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (MapAttribute) GetDescription

func (a MapAttribute) GetDescription() string

GetDescription returns the Description field value.

func (MapAttribute) GetMarkdownDescription

func (a MapAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (MapAttribute) GetType

func (a MapAttribute) GetType() attr.Type

GetType returns types.MapType or the CustomType field value if defined.

func (MapAttribute) IsComputed

func (a MapAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (MapAttribute) IsOptional

func (a MapAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (MapAttribute) IsRequired

func (a MapAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (MapAttribute) IsSensitive

func (a MapAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (MapAttribute) MapDefaultValue added in v1.2.0

func (a MapAttribute) MapDefaultValue() defaults.Map

MapDefaultValue returns the Default field value.

func (MapAttribute) MapPlanModifiers

func (a MapAttribute) MapPlanModifiers() []planmodifier.Map

MapPlanModifiers returns the PlanModifiers field value.

func (MapAttribute) MapValidators

func (a MapAttribute) MapValidators() []validator.Map

MapValidators returns the Validators field value.

func (MapAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type MapNestedAttribute

type MapNestedAttribute struct {
	// NestedObject is the underlying object that contains nested attributes.
	// This field must be set.
	//
	// Nested attributes that contain a dynamic type (i.e. DynamicAttribute) are not supported.
	// If underlying dynamic values are required, replace this attribute definition with
	// DynamicAttribute instead.
	NestedObject NestedAttributeObject

	// CustomType enables the use of a custom attribute type in place of the
	// default types.MapType of types.ObjectType. When retrieving data, the
	// basetypes.MapValuable associated with this custom type must be used in
	// place of types.Map.
	CustomType basetypes.MapTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Map

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Map

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Map
}

MapNestedAttribute represents an attribute that is a set of objects where the object attributes can be fully defined, including further nested attributes. When retrieving the value for this attribute, use types.Map as the value type unless the CustomType field is set. The NestedObject field must be set. Nested attributes are only compatible with protocol version 6.

Use MapAttribute if the underlying elements are of a single type and do not require definition beyond type information.

Terraform configurations configure this attribute using expressions that return a set of objects or directly via curly brace syntax.

# map of objects
example_attribute = {
	key = {
		nested_attribute = #...
	},
]

Terraform configurations reference this attribute using expressions that accept a map of objects or an element directly via square brace string syntax:

# known object at key
.example_attribute["key"]
# known object nested_attribute value at key
.example_attribute["key"].nested_attribute

func (MapNestedAttribute) ApplyTerraform5AttributePathStep

func (a MapNestedAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the Attributes field value if step is ElementKeyString, otherwise returns an error.

func (MapNestedAttribute) Equal

Equal returns true if the given Attribute is a MapNestedAttribute and all fields are equal.

func (MapNestedAttribute) GetDeprecationMessage

func (a MapNestedAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (MapNestedAttribute) GetDescription

func (a MapNestedAttribute) GetDescription() string

GetDescription returns the Description field value.

func (MapNestedAttribute) GetMarkdownDescription

func (a MapNestedAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (MapNestedAttribute) GetNestedObject

GetNestedObject returns the NestedObject field value.

func (MapNestedAttribute) GetNestingMode

func (a MapNestedAttribute) GetNestingMode() fwschema.NestingMode

GetNestingMode always returns NestingModeList.

func (MapNestedAttribute) GetType

func (a MapNestedAttribute) GetType() attr.Type

GetType returns MapType of ObjectType or CustomType.

func (MapNestedAttribute) IsComputed

func (a MapNestedAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (MapNestedAttribute) IsOptional

func (a MapNestedAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (MapNestedAttribute) IsRequired

func (a MapNestedAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (MapNestedAttribute) IsSensitive

func (a MapNestedAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (MapNestedAttribute) MapDefaultValue added in v1.2.0

func (a MapNestedAttribute) MapDefaultValue() defaults.Map

MapDefaultValue returns the Default field value.

func (MapNestedAttribute) MapPlanModifiers

func (a MapNestedAttribute) MapPlanModifiers() []planmodifier.Map

MapPlanModifiers returns the PlanModifiers field value.

func (MapNestedAttribute) MapValidators

func (a MapNestedAttribute) MapValidators() []validator.Map

MapValidators returns the Validators field value.

func (MapNestedAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type NestedAttribute

type NestedAttribute interface {
	Attribute
	fwschema.NestedAttribute
}

Nested attributes are only compatible with protocol version 6.

type NestedAttributeObject

type NestedAttributeObject struct {
	// Attributes is the mapping of underlying attribute names to attribute
	// definitions. This field must be set.
	Attributes map[string]Attribute

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.ObjectType. When retrieving data, the basetypes.ObjectValuable
	// associated with this custom type must be used in place of types.Object.
	CustomType basetypes.ObjectTypable

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Object

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Object
}

NestedAttributeObject is the object containing the underlying attributes for a ListNestedAttribute, MapNestedAttribute, SetNestedAttribute, or SingleNestedAttribute (automatically generated). When retrieving the value for this attribute, use types.Object as the value type unless the CustomType field is set. The Attributes field must be set. Nested attributes are only compatible with protocol version 6.

This object enables customizing and simplifying details within its parent NestedAttribute, therefore it cannot have Terraform schema fields such as Required, Description, etc.

func (NestedAttributeObject) ApplyTerraform5AttributePathStep

func (o NestedAttributeObject) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error)

ApplyTerraform5AttributePathStep performs an AttributeName step on the underlying attributes or returns an error.

func (NestedAttributeObject) Equal

Equal returns true if the given NestedAttributeObject is equivalent.

func (NestedAttributeObject) GetAttributes

GetAttributes returns the Attributes field value.

func (NestedAttributeObject) ObjectPlanModifiers

func (o NestedAttributeObject) ObjectPlanModifiers() []planmodifier.Object

ObjectPlanModifiers returns the PlanModifiers field value.

func (NestedAttributeObject) ObjectValidators

func (o NestedAttributeObject) ObjectValidators() []validator.Object

ObjectValidators returns the Validators field value.

func (NestedAttributeObject) Type

Type returns the framework type of the NestedAttributeObject.

type NestedBlockObject

type NestedBlockObject struct {
	// Attributes is the mapping of underlying attribute names to attribute
	// definitions.
	//
	// Names must only contain lowercase letters, numbers, and underscores.
	// Names must not collide with any Blocks names.
	Attributes map[string]Attribute

	// Blocks is the mapping of underlying block names to block definitions.
	//
	// Names must only contain lowercase letters, numbers, and underscores.
	// Names must not collide with any Attributes names.
	Blocks map[string]Block

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.ObjectType. When retrieving data, the basetypes.ObjectValuable
	// associated with this custom type must be used in place of types.Object.
	CustomType basetypes.ObjectTypable

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Object

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Object
}

NestedBlockObject is the object containing the underlying attributes and blocks for a ListNestedBlock or SetNestedBlock. When retrieving the value for this attribute, use types.Object as the value type unless the CustomType field is set.

This object enables customizing and simplifying details within its parent Block, therefore it cannot have Terraform schema fields such as Description, etc.

func (NestedBlockObject) ApplyTerraform5AttributePathStep

func (o NestedBlockObject) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error)

ApplyTerraform5AttributePathStep performs an AttributeName step on the underlying attributes or returns an error.

func (NestedBlockObject) Equal

Equal returns true if the given NestedBlockObject is equivalent.

func (NestedBlockObject) GetAttributes

GetAttributes returns the Attributes field value.

func (NestedBlockObject) GetBlocks

func (o NestedBlockObject) GetBlocks() map[string]fwschema.Block

GetAttributes returns the Blocks field value.

func (NestedBlockObject) ObjectPlanModifiers

func (o NestedBlockObject) ObjectPlanModifiers() []planmodifier.Object

ObjectPlanModifiers returns the PlanModifiers field value.

func (NestedBlockObject) ObjectValidators

func (o NestedBlockObject) ObjectValidators() []validator.Object

ObjectValidators returns the Validators field value.

func (NestedBlockObject) Type

Type returns the framework type of the NestedBlockObject.

type NumberAttribute

type NumberAttribute struct {
	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.NumberType. When retrieving data, the basetypes.NumberValuable
	// associated with this custom type must be used in place of types.Number.
	CustomType basetypes.NumberTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Number

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Number

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Number
}

NumberAttribute represents a schema attribute that is a generic number with up to 512 bits of floating point or integer precision. When retrieving the value for this attribute, use types.Number as the value type unless the CustomType field is set.

Use Float64Attribute for 64-bit floating point number attributes or Int64Attribute for 64-bit integer number attributes.

Terraform configurations configure this attribute using expressions that return a number or directly via a floating point or integer value.

example_attribute = 123

Terraform configurations reference this attribute using the attribute name.

.example_attribute

func (NumberAttribute) ApplyTerraform5AttributePathStep

func (a NumberAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep always returns an error as it is not possible to step further into a NumberAttribute.

func (NumberAttribute) Equal

Equal returns true if the given Attribute is a NumberAttribute and all fields are equal.

func (NumberAttribute) GetDeprecationMessage

func (a NumberAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (NumberAttribute) GetDescription

func (a NumberAttribute) GetDescription() string

GetDescription returns the Description field value.

func (NumberAttribute) GetMarkdownDescription

func (a NumberAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (NumberAttribute) GetType

func (a NumberAttribute) GetType() attr.Type

GetType returns types.NumberType or the CustomType field value if defined.

func (NumberAttribute) IsComputed

func (a NumberAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (NumberAttribute) IsOptional

func (a NumberAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (NumberAttribute) IsRequired

func (a NumberAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (NumberAttribute) IsSensitive

func (a NumberAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (NumberAttribute) NumberDefaultValue added in v1.2.0

func (a NumberAttribute) NumberDefaultValue() defaults.Number

NumberDefaultValue returns the Default field value.

func (NumberAttribute) NumberPlanModifiers

func (a NumberAttribute) NumberPlanModifiers() []planmodifier.Number

NumberPlanModifiers returns the PlanModifiers field value.

func (NumberAttribute) NumberValidators

func (a NumberAttribute) NumberValidators() []validator.Number

NumberValidators returns the Validators field value.

func (NumberAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type ObjectAttribute

type ObjectAttribute struct {
	// AttributeTypes is the mapping of underlying attribute names to attribute
	// types. This field must be set.
	//
	// Attribute types that contain a collection with a nested dynamic type (i.e. types.List[types.Dynamic]) are not supported.
	// If underlying dynamic collection values are required, replace this attribute definition with
	// DynamicAttribute instead.
	AttributeTypes map[string]attr.Type

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.ObjectType. When retrieving data, the basetypes.ObjectValuable
	// associated with this custom type must be used in place of types.Object.
	CustomType basetypes.ObjectTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Object

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Object

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Object
}

ObjectAttribute represents a schema attribute that is an object with only type information for underlying attributes. When retrieving the value for this attribute, use types.Object as the value type unless the CustomType field is set. The AttributeTypes field must be set.

Prefer SingleNestedAttribute over ObjectAttribute if the provider is using protocol version 6 and full attribute functionality is needed.

Terraform configurations configure this attribute using expressions that return an object or directly via curly brace syntax.

# object with one attribute
example_attribute = {
	underlying_attribute = #...
}

Terraform configurations reference this attribute using expressions that accept an object or an attribute directly via period syntax:

# underlying attribute
.example_attribute.underlying_attribute

func (ObjectAttribute) ApplyTerraform5AttributePathStep

func (a ObjectAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the result of stepping into an attribute name or an error.

func (ObjectAttribute) Equal

Equal returns true if the given Attribute is a ObjectAttribute and all fields are equal.

func (ObjectAttribute) GetDeprecationMessage

func (a ObjectAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (ObjectAttribute) GetDescription

func (a ObjectAttribute) GetDescription() string

GetDescription returns the Description field value.

func (ObjectAttribute) GetMarkdownDescription

func (a ObjectAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (ObjectAttribute) GetType

func (a ObjectAttribute) GetType() attr.Type

GetType returns types.ObjectType or the CustomType field value if defined.

func (ObjectAttribute) IsComputed

func (a ObjectAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (ObjectAttribute) IsOptional

func (a ObjectAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (ObjectAttribute) IsRequired

func (a ObjectAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (ObjectAttribute) IsSensitive

func (a ObjectAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (ObjectAttribute) ObjectDefaultValue added in v1.2.0

func (a ObjectAttribute) ObjectDefaultValue() defaults.Object

ObjectDefaultValue returns the Default field value.

func (ObjectAttribute) ObjectPlanModifiers

func (a ObjectAttribute) ObjectPlanModifiers() []planmodifier.Object

ObjectPlanModifiers returns the PlanModifiers field value.

func (ObjectAttribute) ObjectValidators

func (a ObjectAttribute) ObjectValidators() []validator.Object

ObjectValidators returns the Validators field value.

func (ObjectAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type Schema

type Schema struct {
	// Attributes is the mapping of underlying attribute names to attribute
	// definitions.
	//
	// Names must only contain lowercase letters, numbers, and underscores.
	// Names must not collide with any Blocks names.
	Attributes map[string]Attribute

	// Blocks is the mapping of underlying block names to block definitions.
	//
	// Names must only contain lowercase letters, numbers, and underscores.
	// Names must not collide with any Attributes names.
	Blocks map[string]Block

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this resource is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this resource is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this resource. The warning diagnostic
	// summary is automatically set to "Resource Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Use examplecloud_other resource instead. This resource
	//    will be removed in the next major version of the provider."
	//  - "Remove this resource as it no longer is valid and
	//    will be removed in the next major version of the provider."
	//
	DeprecationMessage string

	// Version indicates the current version of the resource schema. Resource
	// schema versioning enables state upgrades in conjunction with the
	// [resource.ResourceWithStateUpgrades] interface. Versioning is only
	// required if there is a breaking change involving existing state data,
	// such as changing an attribute or block type in a manner that is
	// incompatible with the Terraform type.
	//
	// Versions are conventionally only incremented by one each release.
	Version int64
}

Schema defines the structure and value types of resource data. This type is used as the resource.SchemaResponse type Schema field, which is implemented by the resource.DataSource type Schema method.

func (Schema) ApplyTerraform5AttributePathStep

func (s Schema) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (any, error)

ApplyTerraform5AttributePathStep applies the given AttributePathStep to the schema.

func (Schema) AttributeAtPath

func (s Schema) AttributeAtPath(ctx context.Context, p path.Path) (fwschema.Attribute, diag.Diagnostics)

AttributeAtPath returns the Attribute at the passed path. If the path points to an element or attribute of a complex type, rather than to an Attribute, it will return an ErrPathInsideAtomicAttribute error.

func (Schema) AttributeAtTerraformPath

func (s Schema) AttributeAtTerraformPath(ctx context.Context, p *tftypes.AttributePath) (fwschema.Attribute, error)

AttributeAtPath returns the Attribute at the passed path. If the path points to an element or attribute of a complex type, rather than to an Attribute, it will return an ErrPathInsideAtomicAttribute error.

func (Schema) GetAttributes

func (s Schema) GetAttributes() map[string]fwschema.Attribute

GetAttributes returns the Attributes field value.

func (Schema) GetBlocks

func (s Schema) GetBlocks() map[string]fwschema.Block

GetBlocks returns the Blocks field value.

func (Schema) GetDeprecationMessage

func (s Schema) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (Schema) GetDescription

func (s Schema) GetDescription() string

GetDescription returns the Description field value.

func (Schema) GetMarkdownDescription

func (s Schema) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (Schema) GetVersion

func (s Schema) GetVersion() int64

GetVersion returns the Version field value.

func (Schema) Type

func (s Schema) Type() attr.Type

Type returns the framework type of the schema.

func (Schema) TypeAtPath

func (s Schema) TypeAtPath(ctx context.Context, p path.Path) (attr.Type, diag.Diagnostics)

TypeAtPath returns the framework type at the given schema path.

func (Schema) TypeAtTerraformPath

func (s Schema) TypeAtTerraformPath(ctx context.Context, p *tftypes.AttributePath) (attr.Type, error)

TypeAtTerraformPath returns the framework type at the given tftypes path.

func (Schema) Validate deprecated added in v1.0.0

func (s Schema) Validate() diag.Diagnostics

Validate verifies that the schema is not using a reserved field name for a top-level attribute.

Deprecated: Use the ValidateImplementation method instead.

func (Schema) ValidateImplementation added in v1.3.0

func (s Schema) ValidateImplementation(ctx context.Context) diag.Diagnostics

ValidateImplementation contains logic for validating the provider-defined implementation of the schema and underlying attributes and blocks to prevent unexpected errors or panics. This logic runs during the ValidateResourceConfig RPC, or via provider-defined unit testing, and should never include false positives.

type SetAttribute

type SetAttribute struct {
	// ElementType is the type for all elements of the set. This field must be
	// set.
	//
	// Element types that contain a dynamic type (i.e. types.Dynamic) are not supported.
	// If underlying dynamic values are required, replace this attribute definition with
	// DynamicAttribute instead.
	ElementType attr.Type

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.SetType. When retrieving data, the basetypes.SetValuable
	// associated with this custom type must be used in place of types.Set.
	CustomType basetypes.SetTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Set

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Set

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Set
}

SetAttribute represents a schema attribute that is a set with a single element type. When retrieving the value for this attribute, use types.Set as the value type unless the CustomType field is set. The ElementType field must be set.

Use SetNestedAttribute if the underlying elements should be objects and require definition beyond type information.

Terraform configurations configure this attribute using expressions that return a set or directly via square brace syntax.

# set of strings
example_attribute = ["first", "second"]

Terraform configurations reference this attribute using expressions that accept a set. Sets cannot be indexed in Terraform, therefore an expression is required to access an explicit element.

func (SetAttribute) ApplyTerraform5AttributePathStep

func (a SetAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the result of stepping into a set index or an error.

func (SetAttribute) Equal

func (a SetAttribute) Equal(o fwschema.Attribute) bool

Equal returns true if the given Attribute is a SetAttribute and all fields are equal.

func (SetAttribute) GetDeprecationMessage

func (a SetAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (SetAttribute) GetDescription

func (a SetAttribute) GetDescription() string

GetDescription returns the Description field value.

func (SetAttribute) GetMarkdownDescription

func (a SetAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (SetAttribute) GetType

func (a SetAttribute) GetType() attr.Type

GetType returns types.SetType or the CustomType field value if defined.

func (SetAttribute) IsComputed

func (a SetAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (SetAttribute) IsOptional

func (a SetAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (SetAttribute) IsRequired

func (a SetAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (SetAttribute) IsSensitive

func (a SetAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (SetAttribute) SetDefaultValue added in v1.2.0

func (a SetAttribute) SetDefaultValue() defaults.Set

SetDefaultValue returns the Default field value.

func (SetAttribute) SetPlanModifiers

func (a SetAttribute) SetPlanModifiers() []planmodifier.Set

SetPlanModifiers returns the PlanModifiers field value.

func (SetAttribute) SetValidators

func (a SetAttribute) SetValidators() []validator.Set

SetValidators returns the Validators field value.

func (SetAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type SetNestedAttribute

type SetNestedAttribute struct {
	// NestedObject is the underlying object that contains nested attributes.
	// This field must be set.
	//
	// Nested attributes that contain a dynamic type (i.e. DynamicAttribute) are not supported.
	// If underlying dynamic values are required, replace this attribute definition with
	// DynamicAttribute instead.
	NestedObject NestedAttributeObject

	// CustomType enables the use of a custom attribute type in place of the
	// default types.SetType of types.ObjectType. When retrieving data, the
	// basetypes.SetValuable associated with this custom type must be used in
	// place of types.Set.
	CustomType basetypes.SetTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Set

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Set

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Set
}

SetNestedAttribute represents an attribute that is a set of objects where the object attributes can be fully defined, including further nested attributes. When retrieving the value for this attribute, use types.Set as the value type unless the CustomType field is set. The NestedObject field must be set. Nested attributes are only compatible with protocol version 6.

Use SetAttribute if the underlying elements are of a single type and do not require definition beyond type information.

Terraform configurations configure this attribute using expressions that return a set of objects or directly via square and curly brace syntax.

# set of objects
example_attribute = [
	{
		nested_attribute = #...
	},
]

Terraform configurations reference this attribute using expressions that accept a set of objects. Sets cannot be indexed in Terraform, therefore an expression is required to access an explicit element.

func (SetNestedAttribute) ApplyTerraform5AttributePathStep

func (a SetNestedAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the Attributes field value if step is ElementKeyValue, otherwise returns an error.

func (SetNestedAttribute) Equal

Equal returns true if the given Attribute is a SetNestedAttribute and all fields are equal.

func (SetNestedAttribute) GetDeprecationMessage

func (a SetNestedAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (SetNestedAttribute) GetDescription

func (a SetNestedAttribute) GetDescription() string

GetDescription returns the Description field value.

func (SetNestedAttribute) GetMarkdownDescription

func (a SetNestedAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (SetNestedAttribute) GetNestedObject

GetNestedObject returns the NestedObject field value.

func (SetNestedAttribute) GetNestingMode

func (a SetNestedAttribute) GetNestingMode() fwschema.NestingMode

GetNestingMode always returns NestingModeList.

func (SetNestedAttribute) GetType

func (a SetNestedAttribute) GetType() attr.Type

GetType returns SetType of ObjectType or CustomType.

func (SetNestedAttribute) IsComputed

func (a SetNestedAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (SetNestedAttribute) IsOptional

func (a SetNestedAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (SetNestedAttribute) IsRequired

func (a SetNestedAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (SetNestedAttribute) IsSensitive

func (a SetNestedAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (SetNestedAttribute) SetDefaultValue added in v1.2.0

func (a SetNestedAttribute) SetDefaultValue() defaults.Set

SetDefaultValue returns the Default field value.

func (SetNestedAttribute) SetPlanModifiers

func (a SetNestedAttribute) SetPlanModifiers() []planmodifier.Set

SetPlanModifiers returns the PlanModifiers field value.

func (SetNestedAttribute) SetValidators

func (a SetNestedAttribute) SetValidators() []validator.Set

SetValidators returns the Validators field value.

func (SetNestedAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type SetNestedBlock

type SetNestedBlock struct {
	// NestedObject is the underlying object that contains nested attributes or
	// blocks. This field must be set.
	//
	// Nested attributes that contain a dynamic type (i.e. DynamicAttribute) are not supported.
	// If underlying dynamic values are required, replace this block definition with
	// a DynamicAttribute.
	NestedObject NestedBlockObject

	// CustomType enables the use of a custom attribute type in place of the
	// default types.SetType of types.ObjectType. When retrieving data, the
	// basetypes.SetValuable associated with this custom type must be used in
	// place of types.Set.
	CustomType basetypes.SetTypable

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Set

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Set
}

SetNestedBlock represents a block that is a set of objects where the object attributes can be fully defined, including further attributes or blocks. When retrieving the value for this block, use types.Set as the value type unless the CustomType field is set. The NestedObject field must be set.

Prefer SetNestedAttribute over SetNestedBlock if the provider is using protocol version 6. Nested attributes allow practitioners to configure values directly with expressions.

Terraform configurations configure this block repeatedly using curly brace syntax without an equals (=) sign or Dynamic Block Expressions.

# set of blocks with two elements
example_block {
	nested_attribute = #...
}
example_block {
	nested_attribute = #...
}

Terraform configurations reference this block using expressions that accept a set of objects or an element directly via square brace 0-based index syntax:

# first known object
.example_block[0]
# first known object nested_attribute value
.example_block[0].nested_attribute

func (SetNestedBlock) ApplyTerraform5AttributePathStep

func (b SetNestedBlock) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the NestedObject field value if step is ElementKeyValue, otherwise returns an error.

func (SetNestedBlock) Equal

func (b SetNestedBlock) Equal(o fwschema.Block) bool

Equal returns true if the given Block is SetNestedBlock and all fields are equal.

func (SetNestedBlock) GetDeprecationMessage

func (b SetNestedBlock) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (SetNestedBlock) GetDescription

func (b SetNestedBlock) GetDescription() string

GetDescription returns the Description field value.

func (SetNestedBlock) GetMarkdownDescription

func (b SetNestedBlock) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (SetNestedBlock) GetNestedObject

func (b SetNestedBlock) GetNestedObject() fwschema.NestedBlockObject

GetNestedObject returns the NestedObject field value.

func (SetNestedBlock) GetNestingMode

func (b SetNestedBlock) GetNestingMode() fwschema.BlockNestingMode

GetNestingMode always returns BlockNestingModeSet.

func (SetNestedBlock) SetPlanModifiers

func (b SetNestedBlock) SetPlanModifiers() []planmodifier.Set

SetPlanModifiers returns the PlanModifiers field value.

func (SetNestedBlock) SetValidators

func (b SetNestedBlock) SetValidators() []validator.Set

SetValidators returns the Validators field value.

func (SetNestedBlock) Type

func (b SetNestedBlock) Type() attr.Type

Type returns SetType of ObjectType or CustomType.

func (SetNestedBlock) ValidateImplementation added in v1.7.0

ValidateImplementation contains logic for validating the provider-defined implementation of the block to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type SingleNestedAttribute

type SingleNestedAttribute struct {
	// Attributes is the mapping of underlying attribute names to attribute
	// definitions. This field must be set.
	Attributes map[string]Attribute

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.ObjectType. When retrieving data, the basetypes.ObjectValuable
	// associated with this custom type must be used in place of types.Object.
	CustomType basetypes.ObjectTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Object

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Object

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.Object
}

SingleNestedAttribute represents an attribute that is a single object where the object attributes can be fully defined, including further nested attributes. When retrieving the value for this attribute, use types.Object as the value type unless the CustomType field is set. The Attributes field must be set. Nested attributes are only compatible with protocol version 6.

Use ObjectAttribute if the underlying attributes do not require definition beyond type information.

Terraform configurations configure this attribute using expressions that return an object or directly via curly brace syntax.

# single object
example_attribute = {
	nested_attribute = #...
}

Terraform configurations reference this attribute using expressions that accept an object or an attribute name directly via period syntax:

# object nested_attribute value
.example_attribute.nested_attribute

func (SingleNestedAttribute) ApplyTerraform5AttributePathStep

func (a SingleNestedAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the Attributes field value if step is AttributeName, otherwise returns an error.

func (SingleNestedAttribute) Equal

Equal returns true if the given Attribute is a SingleNestedAttribute and all fields are equal.

func (SingleNestedAttribute) GetAttributes

GetAttributes returns the Attributes field value.

func (SingleNestedAttribute) GetDeprecationMessage

func (a SingleNestedAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (SingleNestedAttribute) GetDescription

func (a SingleNestedAttribute) GetDescription() string

GetDescription returns the Description field value.

func (SingleNestedAttribute) GetMarkdownDescription

func (a SingleNestedAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (SingleNestedAttribute) GetNestedObject

GetNestedObject returns a generated NestedAttributeObject from the Attributes, CustomType, and Validators field values.

func (SingleNestedAttribute) GetNestingMode

func (a SingleNestedAttribute) GetNestingMode() fwschema.NestingMode

GetNestingMode always returns NestingModeList.

func (SingleNestedAttribute) GetType

func (a SingleNestedAttribute) GetType() attr.Type

GetType returns ListType of ObjectType or CustomType.

func (SingleNestedAttribute) IsComputed

func (a SingleNestedAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (SingleNestedAttribute) IsOptional

func (a SingleNestedAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (SingleNestedAttribute) IsRequired

func (a SingleNestedAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (SingleNestedAttribute) IsSensitive

func (a SingleNestedAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (SingleNestedAttribute) ObjectDefaultValue added in v1.2.0

func (a SingleNestedAttribute) ObjectDefaultValue() defaults.Object

ObjectDefaultValue returns the Default field value.

func (SingleNestedAttribute) ObjectPlanModifiers

func (a SingleNestedAttribute) ObjectPlanModifiers() []planmodifier.Object

ObjectPlanModifiers returns the PlanModifiers field value.

func (SingleNestedAttribute) ObjectValidators

func (a SingleNestedAttribute) ObjectValidators() []validator.Object

ObjectValidators returns the Validators field value.

func (SingleNestedAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

type SingleNestedBlock

type SingleNestedBlock struct {
	// Attributes is the mapping of underlying attribute names to attribute
	// definitions.
	//
	// Names must only contain lowercase letters, numbers, and underscores.
	// Names must not collide with any Blocks names.
	Attributes map[string]Attribute

	// Blocks is the mapping of underlying block names to block definitions.
	//
	// Names must only contain lowercase letters, numbers, and underscores.
	// Names must not collide with any Attributes names.
	Blocks map[string]Block

	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.ObjectType. When retrieving data, the basetypes.ObjectValuable
	// associated with this custom type must be used in place of types.Object.
	CustomType basetypes.ObjectTypable

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.Object

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.Object
}

SingleNestedBlock represents a block that is a single object where the object attributes can be fully defined, including further attributes or blocks. When retrieving the value for this block, use types.Object as the value type unless the CustomType field is set.

Prefer SingleNestedAttribute over SingleNestedBlock if the provider is using protocol version 6. Nested attributes allow practitioners to configure values directly with expressions.

Terraform configurations configure this block only once using curly brace syntax without an equals (=) sign or Dynamic Block Expressions.

# single block
example_block {
	nested_attribute = #...
}

Terraform configurations reference this block using expressions that accept an object or an attribute name directly via period syntax:

# object nested_attribute value
.example_block.nested_attribute

func (SingleNestedBlock) ApplyTerraform5AttributePathStep

func (b SingleNestedBlock) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep returns the Attributes field value if step is AttributeName, otherwise returns an error.

func (SingleNestedBlock) Equal

func (b SingleNestedBlock) Equal(o fwschema.Block) bool

Equal returns true if the given Attribute is b SingleNestedBlock and all fields are equal.

func (SingleNestedBlock) GetDeprecationMessage

func (b SingleNestedBlock) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (SingleNestedBlock) GetDescription

func (b SingleNestedBlock) GetDescription() string

GetDescription returns the Description field value.

func (SingleNestedBlock) GetMarkdownDescription

func (b SingleNestedBlock) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (SingleNestedBlock) GetNestedObject

func (b SingleNestedBlock) GetNestedObject() fwschema.NestedBlockObject

GetNestedObject returns a generated NestedBlockObject from the Attributes, CustomType, and Validators field values.

func (SingleNestedBlock) GetNestingMode

func (b SingleNestedBlock) GetNestingMode() fwschema.BlockNestingMode

GetNestingMode always returns BlockNestingModeSingle.

func (SingleNestedBlock) ObjectPlanModifiers

func (b SingleNestedBlock) ObjectPlanModifiers() []planmodifier.Object

ObjectPlanModifiers returns the PlanModifiers field value.

func (SingleNestedBlock) ObjectValidators

func (b SingleNestedBlock) ObjectValidators() []validator.Object

ObjectValidators returns the Validators field value.

func (SingleNestedBlock) Type

func (b SingleNestedBlock) Type() attr.Type

Type returns ObjectType or CustomType.

type StringAttribute

type StringAttribute struct {
	// CustomType enables the use of a custom attribute type in place of the
	// default basetypes.StringType. When retrieving data, the basetypes.StringValuable
	// associated with this custom type must be used in place of types.String.
	CustomType basetypes.StringTypable

	// Required indicates whether the practitioner must enter a value for
	// this attribute or not. Required and Optional cannot both be true,
	// and Required and Computed cannot both be true.
	Required bool

	// Optional indicates whether the practitioner can choose to enter a value
	// for this attribute or not. Optional and Required cannot both be true.
	Optional bool

	// Computed indicates whether the provider may return its own value for
	// this Attribute or not. Required and Computed cannot both be true. If
	// Required and Optional are both false, Computed must be true, and the
	// attribute will be considered "read only" for the practitioner, with
	// only the provider able to set its value.
	Computed bool

	// Sensitive indicates whether the value of this attribute should be
	// considered sensitive data. Setting it to true will obscure the value
	// in CLI output. Sensitive does not impact how values are stored, and
	// practitioners are encouraged to store their state as if the entire
	// file is sensitive.
	Sensitive bool

	// Description is used in various tooling, like the language server, to
	// give practitioners more information about what this attribute is,
	// what it's for, and how it should be used. It should be written as
	// plain text, with no special formatting.
	Description string

	// MarkdownDescription is used in various tooling, like the
	// documentation generator, to give practitioners more information
	// about what this attribute is, what it's for, and how it should be
	// used. It should be formatted using Markdown.
	MarkdownDescription string

	// DeprecationMessage defines warning diagnostic details to display when
	// practitioner configurations use this Attribute. The warning diagnostic
	// summary is automatically set to "Attribute Deprecated" along with
	// configuration source file and line information.
	//
	// Set this field to a practitioner actionable message such as:
	//
	//  - "Configure other_attribute instead. This attribute will be removed
	//    in the next major version of the provider."
	//  - "Remove this attribute's configuration as it no longer is used and
	//    the attribute will be removed in the next major version of the
	//    provider."
	//
	// In Terraform 1.2.7 and later, this warning diagnostic is displayed any
	// time a practitioner attempts to configure a value for this attribute and
	// certain scenarios where this attribute is referenced.
	//
	// In Terraform 1.2.6 and earlier, this warning diagnostic is only
	// displayed when the Attribute is Required or Optional, and if the
	// practitioner configuration sets the value to a known or unknown value
	// (which may eventually be null). It has no effect when the Attribute is
	// Computed-only (read-only; not Required or Optional).
	//
	// Across any Terraform version, there are no warnings raised for
	// practitioner configuration values set directly to null, as there is no
	// way for the framework to differentiate between an unset and null
	// configuration due to how Terraform sends configuration information
	// across the protocol.
	//
	// Additional information about deprecation enhancements for read-only
	// attributes can be found in:
	//
	//  - https://github.com/hashicorp/terraform/issues/7569
	//
	DeprecationMessage string

	// Validators define value validation functionality for the attribute. All
	// elements of the slice of AttributeValidator are run, regardless of any
	// previous error diagnostics.
	//
	// Many common use case validators can be found in the
	// github.com/hashicorp/terraform-plugin-framework-validators Go module.
	//
	// If the Type field points to a custom type that implements the
	// xattr.TypeWithValidate interface, the validators defined in this field
	// are run in addition to the validation defined by the type.
	Validators []validator.String

	// PlanModifiers defines a sequence of modifiers for this attribute at
	// plan time. Schema-based plan modifications occur before any
	// resource-level plan modifications.
	//
	// Schema-based plan modifications can adjust Terraform's plan by:
	//
	//  - Requiring resource recreation. Typically used for configuration
	//    updates which cannot be done in-place.
	//  - Setting the planned value. Typically used for enhancing the plan
	//    to replace unknown values. Computed must be true or Terraform will
	//    return an error. If the plan value is known due to a known
	//    configuration value, the plan value cannot be changed or Terraform
	//    will return an error.
	//
	// Any errors will prevent further execution of this sequence or modifiers.
	PlanModifiers []planmodifier.String

	// Default defines a proposed new state (plan) value for the attribute
	// if the configuration value is null. Default prevents the framework
	// from automatically marking the value as unknown during planning when
	// other proposed new state changes are detected. If the attribute is
	// computed and the value could be altered by other changes then a default
	// should be avoided and a plan modifier should be used instead.
	Default defaults.String
}

StringAttribute represents a schema attribute that is a string. When retrieving the value for this attribute, use types.String as the value type unless the CustomType field is set.

Terraform configurations configure this attribute using expressions that return a string or directly via double quote syntax.

example_attribute = "value"

Terraform configurations reference this attribute using the attribute name.

.example_attribute

func (StringAttribute) ApplyTerraform5AttributePathStep

func (a StringAttribute) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)

ApplyTerraform5AttributePathStep always returns an error as it is not possible to step further into a StringAttribute.

func (StringAttribute) Equal

Equal returns true if the given Attribute is a StringAttribute and all fields are equal.

func (StringAttribute) GetDeprecationMessage

func (a StringAttribute) GetDeprecationMessage() string

GetDeprecationMessage returns the DeprecationMessage field value.

func (StringAttribute) GetDescription

func (a StringAttribute) GetDescription() string

GetDescription returns the Description field value.

func (StringAttribute) GetMarkdownDescription

func (a StringAttribute) GetMarkdownDescription() string

GetMarkdownDescription returns the MarkdownDescription field value.

func (StringAttribute) GetType

func (a StringAttribute) GetType() attr.Type

GetType returns types.StringType or the CustomType field value if defined.

func (StringAttribute) IsComputed

func (a StringAttribute) IsComputed() bool

IsComputed returns the Computed field value.

func (StringAttribute) IsOptional

func (a StringAttribute) IsOptional() bool

IsOptional returns the Optional field value.

func (StringAttribute) IsRequired

func (a StringAttribute) IsRequired() bool

IsRequired returns the Required field value.

func (StringAttribute) IsSensitive

func (a StringAttribute) IsSensitive() bool

IsSensitive returns the Sensitive field value.

func (StringAttribute) StringDefaultValue added in v1.2.0

func (a StringAttribute) StringDefaultValue() defaults.String

StringDefaultValue returns the Default field value.

func (StringAttribute) StringPlanModifiers

func (a StringAttribute) StringPlanModifiers() []planmodifier.String

StringPlanModifiers returns the PlanModifiers field value.

func (StringAttribute) StringValidators

func (a StringAttribute) StringValidators() []validator.String

StringValidators returns the Validators field value.

func (StringAttribute) ValidateImplementation added in v1.3.0

ValidateImplementation contains logic for validating the provider-defined implementation of the attribute to prevent unexpected errors or panics. This logic runs during the GetProviderSchema RPC and should never include false positives.

Directories

Path Synopsis
Package booldefault provides default values for types.Bool attributes.
Package booldefault provides default values for types.Bool attributes.
Package boolplanmodifier provides plan modifiers for types.Bool attributes.
Package boolplanmodifier provides plan modifiers for types.Bool attributes.
Package defaults contains schema default value interfaces and request/response implementations.
Package defaults contains schema default value interfaces and request/response implementations.
Package dynamicdefault provides default values for types.Dynamic attributes.
Package dynamicdefault provides default values for types.Dynamic attributes.
Package dynamicplanmodifier provides plan modifiers for types.Dynamic attributes.
Package dynamicplanmodifier provides plan modifiers for types.Dynamic attributes.
Package float64default provides default values for types.Float64 attributes.
Package float64default provides default values for types.Float64 attributes.
Package float64planmodifier provides plan modifiers for types.Float64 attributes.
Package float64planmodifier provides plan modifiers for types.Float64 attributes.
Package int64default provides default values for types.Int64 attributes.
Package int64default provides default values for types.Int64 attributes.
Package int64planmodifier provides plan modifiers for types.Int64 attributes.
Package int64planmodifier provides plan modifiers for types.Int64 attributes.
Package listdefault provides default values for types.List attributes.
Package listdefault provides default values for types.List attributes.
Package listplanmodifier provides plan modifiers for types.List attributes.
Package listplanmodifier provides plan modifiers for types.List attributes.
Package mapdefault provides default values for types.Map attributes.
Package mapdefault provides default values for types.Map attributes.
Package mapplanmodifier provides plan modifiers for types.Map attributes.
Package mapplanmodifier provides plan modifiers for types.Map attributes.
Package numberdefault provides default values for types.Number attributes.
Package numberdefault provides default values for types.Number attributes.
Package numberplanmodifier provides plan modifiers for types.Number attributes.
Package numberplanmodifier provides plan modifiers for types.Number attributes.
Package objectdefault provides default values for types.Object attributes.
Package objectdefault provides default values for types.Object attributes.
Package objectplanmodifier provides plan modifiers for types.Object attributes.
Package objectplanmodifier provides plan modifiers for types.Object attributes.
Package planmodifier contains schema plan modifier interfaces and request/response implementations.
Package planmodifier contains schema plan modifier interfaces and request/response implementations.
Package setdefault provides default values for types.Set attributes.
Package setdefault provides default values for types.Set attributes.
Package setplanmodifier provides plan modifiers for types.Set attributes.
Package setplanmodifier provides plan modifiers for types.Set attributes.
Package stringdefault provides default values for types.String attributes.
Package stringdefault provides default values for types.String attributes.
Package stringplanmodifier provides plan modifiers for types.String attributes.
Package stringplanmodifier provides plan modifiers for types.String attributes.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL