Documentation
¶
Index ¶
- Constants
- type Bool
- 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) 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) 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) 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 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 )
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 bool. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.
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 Go type that tftypes.NewValue will accept.
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) 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 Go type that tftypes.NewValue will accept.
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 *big.Float. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.
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 Go type that tftypes.NewValue will accept.
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) 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 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 string. If Unknown is true, it returns a tftypes.UnknownValue. If Null is true, it returns nil.