Documentation ¶
Overview ¶
package tfschema provides helpers for working with Terraform's helper/schema.Schema.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NetworkInterfaceLink ¶
type NetworkInterfaceLink struct { SystemID string InterfaceID int SubnetID int Mode string IPAddress net.IP Force bool DefaultGateway net.IP }
NetworkInterfaceLink represents a maas_interface_link
func NewNetworkInterfaceLink ¶
func NewNetworkInterfaceLink(d *schema.ResourceData) *NetworkInterfaceLink
NewNetworkInterfaceLink creates an NetworkInterfaceLink from the Terraform state.
func (*NetworkInterfaceLink) GetID ¶
func (i *NetworkInterfaceLink) GetID() (string, error)
GetID returns "<SystemID>:<InterfaceID>:<SubnetID>" to be used as the Terraform resource ID.
func (*NetworkInterfaceLink) Params ¶
func (i *NetworkInterfaceLink) Params() *params.NetworkInterfaceLink
Params returns a type that can be used to create and delete a MaaS Interface.
func (*NetworkInterfaceLink) UpdateResource ¶
func (i *NetworkInterfaceLink) UpdateResource(d *schema.ResourceData) (err error)
UpdateResource updates the Terraform state to reflect the state of the struct.
type NetworkInterfacePhysical ¶
type NetworkInterfacePhysical struct { InterfaceID int SystemID string Name string MACAddress string Tags []string VLAN string MTU int AcceptRA bool Autoconf bool }
NetworkInterfacePhysical represents a maas_interface_physical
func NewNetworkInterfacePhysical ¶
func NewNetworkInterfacePhysical(d *schema.ResourceData) *NetworkInterfacePhysical
NewNetworkInterfacePhysical creates an NetworkInterfacePhysical from the Terraform state.
func (*NetworkInterfacePhysical) GetID ¶
func (i *NetworkInterfacePhysical) GetID() (string, error)
GetID returns "<SystemID>:<InterfaceID>" to be used as the Terraform resource ID.
func (*NetworkInterfacePhysical) Params ¶
func (i *NetworkInterfacePhysical) Params() *params.NetworkInterfacePhysical
Params returns a type that can be used to create and update a MaaS Interface.
func (*NetworkInterfacePhysical) UpdateResource ¶
func (i *NetworkInterfacePhysical) UpdateResource(d *schema.ResourceData) (err error)
UpdateResource updates the Terraform state to reflect the state of the struct.
type Resource ¶
Resource wraps a Terraform resource's Schema. It provides functionality for parsing a struct{} into a map[string]*Schema for use in Terraform resources and providers.
func NewResource ¶
NewResource transforms a struct{} into a map for a TF schema.Resource. The first return value of this function is the Schema property of the resource, and the function can handle recursion (ie nested structs). TODO: Make this type handle recursion so it can handle a struct within a struct
type Schema ¶
type Schema struct { schema.Schema BoolTags map[string]*bool StringTags map[string]*string FuncTags map[string]interface{} }
Schema wraps a Terraform Schema with additional functionality for parsing struct fields. Use this type to convert a struct field into a Terraform schema, using struct tags to handle the various schema attributes (eg required, computed).
func NewSchema ¶
func NewSchema(f *reflect.StructField) *Schema
func (*Schema) Parse ¶
func (s *Schema) Parse(f *reflect.StructField) (err error)
Parse introspects the struct field to populate the helper.Schema. It will find the Terraform ValueType of the field, search for any struct tags, and set the default value, if there is one.
func (*Schema) SetDefault ¶
SetDefault sets the schema's Default value.
func (*Schema) SetValueType ¶
SetValueType sets the schema's Terraform ValueType