Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Attribute ¶
type Attribute struct {
// Name is a name of attribute.
// Note that this key does not exist in the original data structure.
// In order to reduce the possibility of future conflicts,
// naming borrowed from the schema definition of the grpc provider's proto file.
// https://github.com/hashicorp/terraform/pull/18550
Name string `json:"name"`
// 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 tfschema package.
Type tfschema.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 tfschema.Attribute.
func NewAttribute ¶
NewAttribute creates a new Attribute instance.
type Block ¶
type Block struct {
// Attributes is a slice of any attributes.
Attributes []*Attribute `json:"attributes"`
// BlockTypes is a slice of any nested block types.
BlockTypes []*NestedBlock `json:"block_types"`
}
Block is wrapper for tfschema.Block. This is a layer for customization for JSON format. Although the original data structure is a map, it is hard to parse because the names of the key are not predictable. We use a slice here to format easy-to-parse JSON.
type NestedBlock ¶
type NestedBlock struct {
// TypeName is a name of block type.
// Note that this key does not exist in the original data structure.
// In order to reduce the possibility of future conflicts,
// naming borrowed from the schema definition of the grpc provider's proto file.
// https://github.com/hashicorp/terraform/pull/18550
TypeName string `json:"type_name"`
// 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 tfschema.NestedBlock
func NewBlockTypes ¶
func NewBlockTypes(bs map[string]*tfschema.NestedBlock) []*NestedBlock
NewBlockTypes creates a new slice of NestedBlocks.
func NewNestedBlock ¶
func NewNestedBlock(b *tfschema.NestedBlock, typeName string) *NestedBlock
NewNestedBlock creates a new NestedBlock instance.
Click to show internal directories.
Click to hide internal directories.