|
|
|
|
@ -8,7 +8,6 @@ import (
|
|
|
|
|
"github.com/zclconf/go-cty/cty"
|
|
|
|
|
|
|
|
|
|
"github.com/hashicorp/terraform/internal/addrs"
|
|
|
|
|
"github.com/hashicorp/terraform/internal/configs"
|
|
|
|
|
"github.com/hashicorp/terraform/internal/lang"
|
|
|
|
|
"github.com/hashicorp/terraform/internal/terraform"
|
|
|
|
|
)
|
|
|
|
|
@ -26,7 +25,6 @@ var _ hcl.Body = (*ProviderConfig)(nil)
|
|
|
|
|
type ProviderConfig struct {
|
|
|
|
|
Original hcl.Body
|
|
|
|
|
|
|
|
|
|
ConfigVariables map[string]*configs.Variable
|
|
|
|
|
AvailableVariables terraform.InputValues
|
|
|
|
|
AvailableRunOutputs map[addrs.Run]cty.Value
|
|
|
|
|
}
|
|
|
|
|
@ -52,7 +50,7 @@ func (p *ProviderConfig) PartialContent(schema *hcl.BodySchema) (*hcl.BodyConten
|
|
|
|
|
Attributes: attrs,
|
|
|
|
|
Blocks: p.transformBlocks(content.Blocks),
|
|
|
|
|
MissingItemRange: content.MissingItemRange,
|
|
|
|
|
}, &ProviderConfig{rest, p.ConfigVariables, p.AvailableVariables, p.AvailableRunOutputs}, diags
|
|
|
|
|
}, &ProviderConfig{rest, p.AvailableVariables, p.AvailableRunOutputs}, diags
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func (p *ProviderConfig) JustAttributes() (hcl.Attributes, hcl.Diagnostics) {
|
|
|
|
|
@ -127,7 +125,7 @@ func (p *ProviderConfig) transformBlocks(originals hcl.Blocks) hcl.Blocks {
|
|
|
|
|
blocks[name] = &hcl.Block{
|
|
|
|
|
Type: block.Type,
|
|
|
|
|
Labels: block.Labels,
|
|
|
|
|
Body: &ProviderConfig{block.Body, p.ConfigVariables, p.AvailableVariables, p.AvailableRunOutputs},
|
|
|
|
|
Body: &ProviderConfig{block.Body, p.AvailableVariables, p.AvailableRunOutputs},
|
|
|
|
|
DefRange: block.DefRange,
|
|
|
|
|
TypeRange: block.TypeRange,
|
|
|
|
|
LabelRanges: block.LabelRanges,
|
|
|
|
|
|