Documentation ¶
Index ¶
- func NewAttributes(as map[string]*configschema.Attribute) map[string]*Attribute
- func NewBlockTypes(bs map[string]*configschema.NestedBlock) map[string]*NestedBlock
- type Attribute
- type Block
- type Client
- func (c *Client) DataSources() []terraform.DataSource
- func (c *Client) GetDataSourceSchema(dataSource string) (*Block, error)
- func (c *Client) GetProviderSchema() (*Block, error)
- func (c *Client) GetResourceTypeSchema(resourceType string) (*Block, error)
- func (c *Client) Kill()
- func (c *Client) Resources() []terraform.ResourceType
- type NestedBlock
- type Type
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewAttributes ¶
func NewAttributes(as map[string]*configschema.Attribute) map[string]*Attribute
NewAttributes creates a new map of Attributes.
func NewBlockTypes ¶
func NewBlockTypes(bs map[string]*configschema.NestedBlock) map[string]*NestedBlock
NewBlockTypes creates a new map of NestedBlocks.
Types ¶
type Attribute ¶
type Attribute struct { // Type is a type of the attribute's value. // Note that Type is not cty.Type // We cannot import github.com/hashicorp/terraform/vendor/github.com/zclconf/go-cty/cty // On the other hand, tfschema does not need a dynamic type. // So, we use a simple representation of type defined in this package. Type Type `json:"type"` // Required is a flag whether this attribute is required. Required bool `json:"required"` // Optional is a flag whether this attribute is optional. // This field conflicts with Required. Optional bool `json:"optional"` // Computed is a flag whether this attribute is computed. // If true, the value may come from provider rather than configuration. // If combined with Optional, then the config may optionally provide an // overridden value. Computed bool `json:"computed"` // Sensitive is a flag whether this attribute may contain sensitive information. Sensitive bool `json:"sensitive"` }
Attribute is wrapper for configschema.Attribute.
func NewAttribute ¶
func NewAttribute(a *configschema.Attribute) *Attribute
NewAttribute creates a new Attribute instance.
type Block ¶
type Block struct { // Attributes is a map of any attributes. Attributes map[string]*Attribute `json:"attributes"` // BlockTypes is a map of any nested block types. BlockTypes map[string]*NestedBlock `json:"block_types"` }
Block is wrapper for configschema.Block. This ia a layer for customization not enough for Terraform's core. Most of the structure is the smae as the core, but some are different.
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a tfschema Client.
func (*Client) DataSources ¶
func (c *Client) DataSources() []terraform.DataSource
DataSources returns a list of data sources.
func (*Client) GetDataSourceSchema ¶
GetDataSourceSchema returns a type definiton of data source.
func (*Client) GetProviderSchema ¶
GetProviderSchema returns a type definiton of provider schema.
func (*Client) GetResourceTypeSchema ¶
GetResourceTypeSchema returns a type definiton of resource type.
func (*Client) Resources ¶
func (c *Client) Resources() []terraform.ResourceType
Resources returns a list of resource types.
type NestedBlock ¶
type NestedBlock struct { // Block is a nested child block. Block // Nesting is a nesting mode. Nesting configschema.NestingMode `json:"nesting"` // MinItems is a lower limit on number of nested child blocks. MinItems int `json:"min_items"` // MaxItems is a upper limit on number of nested child blocks. MaxItems int `json:"max_items"` }
NestedBlock is wrapper for configschema.NestedBlock
func NewNestedBlock ¶
func NewNestedBlock(b *configschema.NestedBlock) *NestedBlock
NewNestedBlock creates a new NestedBlock instance.
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is a type of the attribute's value.
func (*Type) MarshalJSON ¶
MarshalJSON returns a encoded string in JSON.