Open data-henrik opened 1 year ago
@data-henrik Terraform's configuration language is based on HCL language, A multiple contexts rule's context in json format is like this:
{
"contexts":[
{
"attributes":[
{
"name":"networkZoneId",
"value":""
}
]
},
{
"attributes":[
{
"name":"networkZoneId",
"value":""
}
]
}
]
}
but this config converted into HCL should be
"contexts" = {
"attributes" = {
"name" = "networkZoneId"
"value" = ""
}
}
"contexts" = {
"attributes" = {
"name" = "networkZoneId"
"value" = ""
}
}
so the correct format for our config should be:
resource "ibm_cbr_rule" "cbr_rule_COS" {
contexts {
attributes {
name = "networkZoneId"
value = ibm_cbr_zone.cbr_zone_CE.id
}
}
contexts {
attributes {
name = "networkZoneId"
value = ibm_cbr_zone.homezone2.id
}
}
Please give this a try, and let me know if it works for you.
a syntax like that works and it creates two contexts in the rule
@data-henrik this issue should now be resolved, please reopen if there are unresolved items with this issue.
Community Note
Terraform CLI and Terraform IBM Provider Version
Affected Resource(s)
Terraform Configuration Files
Please include all Terraform configurations required to reproduce the bug. Bug reports without a functional reproduction may be closed without investigation.
Expected Behavior
The rule is created with the two zones as contexts. If there are problems, there should be errors or warnings
Actual Behavior
No warnings, no error messages, the rule is created, but only with a single context.