Skip to content

Commit

Permalink
Updating documentation for Default on resource schema attributes (#668)
Browse files Browse the repository at this point in the history
  • Loading branch information
bendbennett committed Mar 6, 2023
1 parent d2ae08e commit 23c6921
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 40 deletions.
10 changes: 6 additions & 4 deletions resource/schema/bool_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ type BoolAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Bool

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/float64_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ type Float64Attribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Float64

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/int64_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,12 @@ type Int64Attribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Int64

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/list_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,12 @@ type ListAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.List

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/list_nested_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,10 +161,12 @@ type ListNestedAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.List

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/map_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,10 +153,12 @@ type MapAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Map

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/number_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,12 @@ type NumberAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Number

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/object_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,12 @@ type ObjectAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Object

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/set_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,12 @@ type SetAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.Set

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down
10 changes: 6 additions & 4 deletions resource/schema/string_attribute.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,12 @@ type StringAttribute struct {
// Any errors will prevent further execution of this sequence or modifiers.
PlanModifiers []planmodifier.String

// Default defines a default value for the attribute. The default value
// handling occurs during the `PlanResourceChange` RPC and modifies the
// Terraform-provided proposed new state before the framework performs
// its check between the proposed new state and prior state.
// 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
}

Expand Down

0 comments on commit 23c6921

Please sign in to comment.