Multiple filter blocks created with a for_each loop fail on validation. If a predicate's value field is set via each.key, the value would be unknown at validation time. This should not be counted as invalid configuration.
│ Error: Invalid Attribute Configuration
│
│ with opslevel_filter.first_party_services,
│ on main.tf line 1, in resource "opslevel_filter" "first_party_services":
│ 1: resource "opslevel_filter" "first_party_services" {
│
│ Predicate type 'equals' requires a value
After this fix, terraform plan
Terraform used the selected providers to generate the following execution plan. Resource actions are indicated with the following symbols:
+ create
Terraform will perform the following actions:
# opslevel_filter.first_party_services["development"] will be created
+ resource "opslevel_filter" "first_party_services" {
+ connective = "and"
+ id = (known after apply)
+ name = "First-party application (development)"
+ predicate {
+ case_insensitive = (known after apply)
+ case_sensitive = true
+ key = "tags"
+ key_data = "third-party"
+ type = "does_not_equal"
+ value = "true"
}
+ predicate {
+ case_insensitive = (known after apply)
+ case_sensitive = true
+ key = "tags"
+ key_data = "environment"
+ type = "equals"
+ value = "development"
}
}
# opslevel_filter.first_party_services["production"] will be created
+ resource "opslevel_filter" "first_party_services" {
+ connective = "and"
+ id = (known after apply)
+ name = "First-party application (production)"
+ predicate {
+ case_insensitive = (known after apply)
+ case_sensitive = true
+ key = "tags"
+ key_data = "third-party"
+ type = "does_not_equal"
+ value = "true"
}
+ predicate {
+ case_insensitive = (known after apply)
+ case_sensitive = true
+ key = "tags"
+ key_data = "environment"
+ type = "equals"
+ value = "production"
}
}
# opslevel_filter.first_party_services["sandbox"] will be created
+ resource "opslevel_filter" "first_party_services" {
+ connective = "and"
+ id = (known after apply)
+ name = "First-party application (sandbox)"
+ predicate {
+ case_insensitive = (known after apply)
+ case_sensitive = true
+ key = "tags"
+ key_data = "third-party"
+ type = "does_not_equal"
+ value = "true"
}
+ predicate {
+ case_insensitive = (known after apply)
+ case_sensitive = true
+ key = "tags"
+ key_data = "environment"
+ type = "equals"
+ value = "sandbox"
}
}
Plan: 3 to add, 0 to change, 0 to destroy.
Issues
Multiple filter blocks created with a
for_each
loop fail on validation. If a predicate'svalue
field is set viaeach.key
, the value would be unknown at validation time. This should not be counted as invalid configuration.Changelog
changie
entryTophatting
With this Terraform config:
Before this fix,
terraform plan
After this fix,
terraform plan