2018-01-21 23:29:43 +00:00
|
|
|
package dynblock
|
|
|
|
|
2019-09-09 23:08:19 +00:00
|
|
|
import "github.com/hashicorp/hcl/v2"
|
2018-01-21 23:29:43 +00:00
|
|
|
|
|
|
|
var dynamicBlockHeaderSchema = hcl.BlockHeaderSchema{
|
|
|
|
Type: "dynamic",
|
|
|
|
LabelNames: []string{"type"},
|
|
|
|
}
|
|
|
|
|
|
|
|
var dynamicBlockBodySchemaLabels = &hcl.BodySchema{
|
|
|
|
Attributes: []hcl.AttributeSchema{
|
|
|
|
{
|
|
|
|
Name: "for_each",
|
|
|
|
Required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "iterator",
|
|
|
|
Required: false,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "labels",
|
|
|
|
Required: true,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Blocks: []hcl.BlockHeaderSchema{
|
|
|
|
{
|
|
|
|
Type: "content",
|
|
|
|
LabelNames: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
|
|
|
var dynamicBlockBodySchemaNoLabels = &hcl.BodySchema{
|
|
|
|
Attributes: []hcl.AttributeSchema{
|
|
|
|
{
|
|
|
|
Name: "for_each",
|
|
|
|
Required: true,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
Name: "iterator",
|
|
|
|
Required: false,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Blocks: []hcl.BlockHeaderSchema{
|
|
|
|
{
|
|
|
|
Type: "content",
|
|
|
|
LabelNames: nil,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|