-
Notifications
You must be signed in to change notification settings - Fork 730
Open
Labels
Description
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform Version and Provider Version
erraform v1.12.2
on darwin_arm64
- provider registry.terraform.io/oracle/oci v7.27.0
Affected Resource(s)
affected_resources = oci_core_drg_route_distribution_statement
affected_resources = terraform
Terraform Configuration Files
resource "oci_core_drg_route_distribution_statement" "test_drg_route_distribution_statement" {
#Required
drg_route_distribution_id = var.drg_route_distribution_id
action = "ACCEPT"
dynamic "match_criteria" {
for_each = var.match_criteria
content {
match_type = match_criteria.value.match_type
#Optional
attachment_type = lookup(match_criteria.value, "attachment_type", null)
drg_attachment_id = lookup(match_criteria.value, "drg_attachment_id", null)
priority = lookup(match_criteria.value, "priority", null)
}
}
}Debug Output
╷
│ Error: Insufficient match_criteria blocks
│
│ on test.tf line 14, in resource "oci_core_drg_route_distribution_statement" "drg_route_distribution_statements":
│ 14: resource "oci_core_drg_route_distribution_statement" "test_drg_route_distribution_statement" {
│
│ At least 1 "match_criteria" blocks are required.Panic Output
Expected Behavior
Optional attribute match_criteria may be excluded if the intention is to match "all".
Actual Behavior
Optional attribute 'match_criteriamust be included or an error will be thrown by the provider. Additionally,match_criteriamust have at least one match statement (i.e. it is not good enough to have an emptymatch_criteria` block)
Steps to Reproduce
terraform apply- Note the error if
var.match_criteria = [] - Add at least one
match_criteriablock to the list and note error does not occur. Note that default distribution list "ALL" created when DRG is created does not havematch_criteria(has empty list)
Important Factoids
References
- API reference for route distribution statements showing list size of 0 is acceptable
https://docs.oracle.com/en-us/iaas/api/#/en/iaas/20160918/datatypes/AddDrgRouteDistributionStatementDetails