Closed davops closed 2 years ago
Hi @davops 🙂
Note that filter_must_not
expects an array of objects. In your config you inserted an object.
I tried your config with the following modification (wrapped the object in array brackets):
resource "logzio_alert_v2" "secrets_admin" {
title = "Secrets Role"
search_timeframe_minutes = 30
is_enabled = true
tags = ["aws", "terraform", "iam"]
suppress_notifications_minutes = 5
output_type = "JSON"
sub_components {
account_ids_to_query_on = [123, ]
query_string = "type:cloudtrail"
group_by_aggregation_fields = []
filter_must = jsonencode(
[
{
match_phrase = {
eventName = {
query = "Federate"
}
}
},
]
)
filter_must_not = jsonencode(
[
{
bool = {
minimum_should_match = 1
should = [
{
match_phrase = {
"serviceEventDetails.account_id" = "123456"
}
},
]
}
},
]
)
should_query_on_all_accounts = false
operation = "GREATER_THAN"
value_aggregation_type = "COUNT"
severity_threshold_tiers {
severity = "HIGH"
threshold = 0
}
columns {
field_name = "geoip.real_region_name"
}
columns {
field_name = "@timestamp"
}
}
}
This config worked for me. Can you please try this, and let us know if this solves your issue?
Hi @davops did you get a chance to check my suggestion?
Yes, that worked. Thanks @mirii1994. It may be worth fixing up the plan so that it doesn't look like it's going to add those when it's not an array.
Thank you for the feedback, we will work on improving it. Closing this issue :)
Affected Resource(s)
filter_must_not
Terraform Configuration Files
Expected Behavior
The alert should be updated when it applies and match the configuration in Terraform.
Actual Behavior
However, the alert itself doesn't have the
filter_must_not
configuration and Terraform will always show that it's missing.Detailed log:
Steps to Reproduce
terraform apply
Important Factoids