Documentation
¶
Index ¶
- Constants
- type Bool
- type Float64
- type Int64
- type List
- type ListType
- func (l ListType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
- func (l ListType) ElementType() attr.Type
- func (l ListType) Equal(o attr.Type) bool
- func (l ListType) String() string
- func (l ListType) TerraformType(ctx context.Context) tftypes.Type
- func (l ListType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (l ListType) WithElementType(typ attr.Type) attr.TypeWithElementType
- type Map
- type MapType
- func (m MapType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
- func (m MapType) ElementType() attr.Type
- func (m MapType) Equal(o attr.Type) bool
- func (m MapType) String() string
- func (m MapType) TerraformType(ctx context.Context) tftypes.Type
- func (m MapType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (m MapType) WithElementType(typ attr.Type) attr.TypeWithElementType
- type Number
- type Object
- type ObjectAsOptions
- type ObjectType
- func (o ObjectType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
- func (o ObjectType) AttributeTypes() map[string]attr.Type
- func (o ObjectType) Equal(candidate attr.Type) bool
- func (o ObjectType) String() string
- func (o ObjectType) TerraformType(ctx context.Context) tftypes.Type
- func (o ObjectType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (o ObjectType) WithAttributeTypes(typs map[string]attr.Type) attr.TypeWithAttributeTypes
- type Set
- type SetType
- func (t SetType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
- func (t SetType) ElementType() attr.Type
- func (t SetType) Equal(o attr.Type) bool
- func (t SetType) String() string
- func (t SetType) TerraformType(ctx context.Context) tftypes.Type
- func (s SetType) Validate(ctx context.Context, in tftypes.Value, path *tftypes.AttributePath) diag.Diagnostics
- func (t SetType) ValueFromTerraform(ctx context.Context, in tftypes.Value) (attr.Value, error)
- func (t SetType) WithElementType(typ attr.Type) attr.TypeWithElementType
- type String
Constants ¶
const ( // StringType represents a UTF-8 string type. StringType primitive = iota // NumberType represents a number type, either an integer or a float. NumberType // BoolType represents a boolean type. BoolType // Int64Type represents a 64-bit integer. Int64Type // Float64Type represents a 64-bit floating point. Float64Type )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
type Bool struct { // Unknown will be true if the value is not yet known. Unknown bool // Null will be true if the value was not set, or was explicitly set to // null. Null bool // Value contains the set value, as long as Unknown and Null are both // false. Value bool }
Bool represents a boolean value.
func (Bool) ToTerraformValue ¶
ToTerraformValue returns the data contained in the *Bool as a tftypes.Value.
type Float64 ¶ added in v0.4.0
type Float64 struct { // Unknown will be true if the value is not yet known. Unknown bool // Null will be true if the value was not set, or was explicitly set to // null. Null bool // Value contains the set value, as long as Unknown and Null are both // false. Value float64 }
Float64 represents a 64-bit floating point value, exposed as an float64.
func (Float64) Equal ¶ added in v0.4.0
Equal returns true if `other` is an Float64 and has the same value as `i`.
func (Float64) ToTerraformValue ¶ added in v0.4.0
ToTerraformValue returns the data contained in the Float64 as a tftypes.Value.
type Int64 ¶ added in v0.4.0
type Int64 struct { // Unknown will be true if the value is not yet known. Unknown bool // Null will be true if the value was not set, or was explicitly set to // null. Null bool // Value contains the set value, as long as Unknown and Null are both // false. Value int64 }
Int64 represents a 64-bit integer value, exposed as an int64.
func (Int64) Equal ¶ added in v0.4.0
Equal returns true if `other` is an Int64 and has the same value as `i`.
func (Int64) ToTerraformValue ¶ added in v0.4.0
ToTerraformValue returns the data contained in the Int64 as a tftypes.Value.
type List ¶
type List struct { // Unknown will be set to true if the entire list is an unknown value. // If only some of the elements in the list are unknown, their known or // unknown status will be represented however that AttributeValue // surfaces that information. The List's Unknown property only tracks // if the number of elements in a List is known, not whether the // elements that are in the list are known. Unknown bool // Null will be set to true if the list is null, either because it was // omitted from the configuration, state, or plan, or because it was // explicitly set to null. Null bool // Elems are the elements in the list. Elems []attr.Value // ElemType is the tftypes.Type of the elements in the list. All // elements in the list must be of this type. ElemType attr.Type }
List represents a list of AttributeValues, all of the same type, indicated by ElemType.
func (List) ElementsAs ¶
func (l List) ElementsAs(ctx context.Context, target interface{}, allowUnhandled bool) diag.Diagnostics
ElementsAs populates `target` with the elements of the List, throwing an error if the elements cannot be stored in `target`.
func (List) Equal ¶
Equal must return true if the AttributeValue is considered semantically equal to the AttributeValue passed as an argument.
func (List) ToTerraformValue ¶
ToTerraformValue returns the data contained in the AttributeValue as a tftypes.Value.
type ListType ¶
ListType is an AttributeType representing a list of values. All values must be of the same type, which the provider must specify as the ElemType property.
func (ListType) ApplyTerraform5AttributePathStep ¶
func (l ListType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
ApplyTerraform5AttributePathStep applies the given AttributePathStep to the list.
func (ListType) ElementType ¶
ElementType returns the attr.Type elements will be created from.
func (ListType) String ¶ added in v0.4.0
String returns a human-friendly description of the ListType.
func (ListType) TerraformType ¶
TerraformType returns the tftypes.Type that should be used to represent this type. This constrains what user input will be accepted and what kind of data can be set in state. The framework will use this to translate the AttributeType to something Terraform can understand.
func (ListType) ValueFromTerraform ¶
ValueFromTerraform returns an AttributeValue given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.
func (ListType) WithElementType ¶
func (l ListType) WithElementType(typ attr.Type) attr.TypeWithElementType
WithElementType returns a ListType that is identical to `l`, but with the element type set to `typ`.
type Map ¶
type Map struct { // Unknown will be set to true if the entire map is an unknown value. // If only some of the elements in the map are unknown, their known or // unknown status will be represented however that AttributeValue // surfaces that information. The Map's Unknown property only tracks if // the number of elements in a Map is known, not whether the elements // that are in the map are known. Unknown bool // Null will be set to true if the map is null, either because it was // omitted from the configuration, state, or plan, or because it was // explicitly set to null. Null bool // Elems are the elements in the map. Elems map[string]attr.Value // ElemType is the AttributeType of the elements in the map. All // elements in the map must be of this type. ElemType attr.Type }
Map represents a map of AttributeValues, all of the same type, indicated by ElemType. Keys for the map will always be strings.
func (Map) ElementsAs ¶
func (m Map) ElementsAs(ctx context.Context, target interface{}, allowUnhandled bool) diag.Diagnostics
ElementsAs populates `target` with the elements of the Map, throwing an error if the elements cannot be stored in `target`.
func (Map) Equal ¶
Equal must return true if the AttributeValue is considered semantically equal to the AttributeValue passed as an argument.
func (Map) ToTerraformValue ¶
ToTerraformValue returns the data contained in the AttributeValue as a tftypes.Value.
type MapType ¶
MapType is an AttributeType representing a map of values. All values must be of the same type, which the provider must specify as the ElemType property. Keys will always be strings.
func (MapType) ApplyTerraform5AttributePathStep ¶
func (m MapType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
ApplyTerraform5AttributePathStep applies the given AttributePathStep to the map.
func (MapType) ElementType ¶
ElementType returns the type's element type.
func (MapType) TerraformType ¶
TerraformType returns the tftypes.Type that should be used to represent this type. This constrains what user input will be accepted and what kind of data can be set in state. The framework will use this to translate the AttributeType to something Terraform can understand.
func (MapType) ValueFromTerraform ¶
ValueFromTerraform returns an AttributeValue given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.
func (MapType) WithElementType ¶
func (m MapType) WithElementType(typ attr.Type) attr.TypeWithElementType
WithElementType returns a new copy of the type with its element type set.
type Number ¶
type Number struct { // Unknown will be true if the value is not yet known. Unknown bool // Null will be true if the value was not set, or was explicitly set to // null. Null bool // Value contains the set value, as long as Unknown and Null are both // false. Value *big.Float }
Number represents a number value, exposed as a *big.Float. Numbers can be floats or integers.
func (Number) ToTerraformValue ¶
ToTerraformValue returns the data contained in the *Number as a tftypes.Value.
type Object ¶
type Object struct { // Unknown will be set to true if the entire object is an unknown value. // If only some of the elements in the object are unknown, their known or // unknown status will be represented however that AttributeValue // surfaces that information. The Object's Unknown property only tracks // if the number of elements in a Object is known, not whether the // elements that are in the object are known. Unknown bool // Null will be set to true if the object is null, either because it was // omitted from the configuration, state, or plan, or because it was // explicitly set to null. Null bool Attrs map[string]attr.Value AttrTypes map[string]attr.Type }
Object represents an object
func (Object) As ¶
func (o Object) As(ctx context.Context, target interface{}, opts ObjectAsOptions) diag.Diagnostics
As populates `target` with the data in the Object, throwing an error if the data cannot be stored in `target`.
func (Object) Equal ¶
Equal must return true if the AttributeValue is considered semantically equal to the AttributeValue passed as an argument.
func (Object) ToTerraformValue ¶
ToTerraformValue returns the data contained in the AttributeValue as a tftypes.Value.
type ObjectAsOptions ¶
type ObjectAsOptions struct { // UnhandledNullAsEmpty controls what happens when As needs to put a // null value in a type that has no way to preserve that distinction. // When set to true, the type's empty value will be used. When set to // false, an error will be returned. UnhandledNullAsEmpty bool // UnhandledUnknownAsEmpty controls what happens when As needs to put // an unknown value in a type that has no way to preserve that // distinction. When set to true, the type's empty value will be used. // When set to false, an error will be returned. UnhandledUnknownAsEmpty bool }
ObjectAsOptions is a collection of toggles to control the behavior of Object.As.
type ObjectType ¶
ObjectType is an AttributeType representing an object.
func (ObjectType) ApplyTerraform5AttributePathStep ¶
func (o ObjectType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
ApplyTerraform5AttributePathStep applies the given AttributePathStep to the object.
func (ObjectType) AttributeTypes ¶
func (o ObjectType) AttributeTypes() map[string]attr.Type
AttributeTypes returns the type's attribute types.
func (ObjectType) Equal ¶
func (o ObjectType) Equal(candidate attr.Type) bool
Equal returns true if `candidate` is also an ObjectType and has the same AttributeTypes.
func (ObjectType) String ¶ added in v0.4.0
func (o ObjectType) String() string
String returns a human-friendly description of the ObjectType.
func (ObjectType) TerraformType ¶
func (o ObjectType) TerraformType(ctx context.Context) tftypes.Type
TerraformType returns the tftypes.Type that should be used to represent this type. This constrains what user input will be accepted and what kind of data can be set in state. The framework will use this to translate the AttributeType to something Terraform can understand.
func (ObjectType) ValueFromTerraform ¶
ValueFromTerraform returns an AttributeValue given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.
func (ObjectType) WithAttributeTypes ¶
func (o ObjectType) WithAttributeTypes(typs map[string]attr.Type) attr.TypeWithAttributeTypes
WithAttributeTypes returns a new copy of the type with its attribute types set.
type Set ¶ added in v0.4.0
type Set struct { // Unknown will be set to true if the entire set is an unknown value. // If only some of the elements in the set are unknown, their known or // unknown status will be represented however that AttributeValue // surfaces that information. The Set's Unknown property only tracks // if the number of elements in a Set is known, not whether the // elements that are in the set are known. Unknown bool // Null will be set to true if the set is null, either because it was // omitted from the configuration, state, or plan, or because it was // explicitly set to null. Null bool // Elems are the elements in the set. Elems []attr.Value // ElemType is the tftypes.Type of the elements in the set. All // elements in the set must be of this type. ElemType attr.Type }
Set represents a set of AttributeValues, all of the same type, indicated by ElemType.
func (Set) ElementsAs ¶ added in v0.4.0
func (s Set) ElementsAs(ctx context.Context, target interface{}, allowUnhandled bool) diag.Diagnostics
ElementsAs populates `target` with the elements of the Set, throwing an error if the elements cannot be stored in `target`.
func (Set) Equal ¶ added in v0.4.0
Equal must return true if the AttributeValue is considered semantically equal to the AttributeValue passed as an argument.
func (Set) ToTerraformValue ¶ added in v0.4.0
ToTerraformValue returns the data contained in the AttributeValue as a tftypes.Value.
type SetType ¶ added in v0.4.0
SetType is an AttributeType representing a set of values. All values must be of the same type, which the provider must specify as the ElemType property.
func (SetType) ApplyTerraform5AttributePathStep ¶ added in v0.4.0
func (t SetType) ApplyTerraform5AttributePathStep(step tftypes.AttributePathStep) (interface{}, error)
ApplyTerraform5AttributePathStep applies the given AttributePathStep to the set.
func (SetType) ElementType ¶ added in v0.4.0
ElementType returns the attr.Type elements will be created from.
func (SetType) Equal ¶ added in v0.4.0
Equal returns true if `o` is also a SetType and has the same ElemType.
func (SetType) TerraformType ¶ added in v0.4.0
TerraformType returns the tftypes.Type that should be used to represent this type. This constrains what user input will be accepted and what kind of data can be set in state. The framework will use this to translate the AttributeType to something Terraform can understand.
func (SetType) Validate ¶ added in v0.4.0
func (s SetType) Validate(ctx context.Context, in tftypes.Value, path *tftypes.AttributePath) diag.Diagnostics
Validate implements type validation. This type requires all elements to be unique.
func (SetType) ValueFromTerraform ¶ added in v0.4.0
ValueFromTerraform returns an AttributeValue given a tftypes.Value. This is meant to convert the tftypes.Value into a more convenient Go type for the provider to consume the data with.
func (SetType) WithElementType ¶ added in v0.4.0
func (t SetType) WithElementType(typ attr.Type) attr.TypeWithElementType
WithElementType returns a SetType that is identical to `l`, but with the element type set to `typ`.
type String ¶
type String struct { // Unknown will be true if the value is not yet known. Unknown bool // Null will be true if the value was not set, or was explicitly set to // null. Null bool // Value contains the set value, as long as Unknown and Null are both // false. Value string }
String represents a UTF-8 string value.
func (String) ToTerraformValue ¶
ToTerraformValue returns the data contained in the *String as a tftypes.Value.