mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
enable count and for_each in configuration
This commit is contained in:
parent
8eb3f2cf52
commit
cd045f6f4e
@ -68,26 +68,10 @@ func decodeModuleBlock(block *hcl.Block, override bool) (*ModuleCall, hcl.Diagno
|
|||||||
|
|
||||||
if attr, exists := content.Attributes["count"]; exists {
|
if attr, exists := content.Attributes["count"]; exists {
|
||||||
mc.Count = attr.Expr
|
mc.Count = attr.Expr
|
||||||
|
|
||||||
// We currently parse this, but don't yet do anything with it.
|
|
||||||
diags = append(diags, &hcl.Diagnostic{
|
|
||||||
Severity: hcl.DiagError,
|
|
||||||
Summary: "Reserved argument name in module block",
|
|
||||||
Detail: fmt.Sprintf("The name %q is reserved for use in a future version of Terraform.", attr.Name),
|
|
||||||
Subject: &attr.NameRange,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if attr, exists := content.Attributes["for_each"]; exists {
|
if attr, exists := content.Attributes["for_each"]; exists {
|
||||||
mc.ForEach = attr.Expr
|
mc.ForEach = attr.Expr
|
||||||
|
|
||||||
// We currently parse this, but don't yet do anything with it.
|
|
||||||
diags = append(diags, &hcl.Diagnostic{
|
|
||||||
Severity: hcl.DiagError,
|
|
||||||
Summary: "Reserved argument name in module block",
|
|
||||||
Detail: fmt.Sprintf("The name %q is reserved for use in a future version of Terraform.", attr.Name),
|
|
||||||
Subject: &attr.NameRange,
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if attr, exists := content.Attributes["depends_on"]; exists {
|
if attr, exists := content.Attributes["depends_on"]; exists {
|
||||||
|
@ -20,8 +20,6 @@ func TestLoadModuleCall(t *testing.T) {
|
|||||||
|
|
||||||
file, diags := parser.LoadConfigFile("module-calls.tf")
|
file, diags := parser.LoadConfigFile("module-calls.tf")
|
||||||
assertExactDiagnostics(t, diags, []string{
|
assertExactDiagnostics(t, diags, []string{
|
||||||
`module-calls.tf:19,3-8: Reserved argument name in module block; The name "count" is reserved for use in a future version of Terraform.`,
|
|
||||||
`module-calls.tf:20,3-11: Reserved argument name in module block; The name "for_each" is reserved for use in a future version of Terraform.`,
|
|
||||||
`module-calls.tf:22,3-13: Reserved argument name in module block; The name "depends_on" is reserved for use in a future version of Terraform.`,
|
`module-calls.tf:22,3-13: Reserved argument name in module block; The name "depends_on" is reserved for use in a future version of Terraform.`,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user