mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Update diagnostic messages
This commit is contained in:
parent
57c26fc11b
commit
6962562a78
@ -144,7 +144,7 @@ func (d *evaluationStateData) GetCountAttr(addr addrs.CountAttr, rng tfdiags.Sou
|
||||
diags = diags.Append(&hcl.Diagnostic{
|
||||
Severity: hcl.DiagError,
|
||||
Summary: `Reference to "count" in non-counted context`,
|
||||
Detail: fmt.Sprintf(`The "count" object can be used only in "resource" and "data" blocks, and only when the "count" argument is set.`),
|
||||
Detail: fmt.Sprintf(`The "count" object can only be used in "module", "resource", and "data" blocks, and only when the "count" argument is set.`),
|
||||
Subject: rng.ToHCL().Ptr(),
|
||||
})
|
||||
return cty.UnknownVal(cty.Number), diags
|
||||
@ -195,7 +195,7 @@ func (d *evaluationStateData) GetForEachAttr(addr addrs.ForEachAttr, rng tfdiags
|
||||
diags = diags.Append(&hcl.Diagnostic{
|
||||
Severity: hcl.DiagError,
|
||||
Summary: `Reference to "each" in context without for_each`,
|
||||
Detail: fmt.Sprintf(`The "each" object can be used only in "resource" blocks, and only when the "for_each" argument is set.`),
|
||||
Detail: fmt.Sprintf(`The "each" object can be used only in "module" or "resource" blocks, and only when the "for_each" argument is set.`),
|
||||
Subject: rng.ToHCL().Ptr(),
|
||||
})
|
||||
return cty.UnknownVal(cty.DynamicPseudoType), diags
|
||||
|
@ -224,7 +224,7 @@ func (n *NodeApplyableModuleVariable) EvalTree() EvalNode {
|
||||
Nodes: []EvalNode{
|
||||
&EvalOpFilter{
|
||||
Ops: []walkOperation{walkRefresh, walkPlan, walkApply,
|
||||
walkDestroy},
|
||||
walkDestroy, walkValidate},
|
||||
Node: &EvalModuleCallArgument{
|
||||
Addr: n.Addr.Variable,
|
||||
Config: n.Config,
|
||||
|
@ -20,7 +20,7 @@ module "count_child" {
|
||||
module "for_each_child" {
|
||||
for_each = aws_instance.foo
|
||||
foo = 2
|
||||
bar = var.myvar
|
||||
bar = each.key
|
||||
source = "./child"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user