Skip to content

Commit

Permalink
update terraform client version
Browse files Browse the repository at this point in the history
  • Loading branch information
8naama committed Mar 17, 2024
1 parent c053f4b commit d17c92f
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/hashicorp/go-cty v1.4.1-0.20200414143053-d3edf31b6320
github.com/hashicorp/terraform-plugin-log v0.8.0
github.com/hashicorp/terraform-plugin-sdk/v2 v2.26.1
github.com/logzio/logzio_terraform_client v1.20.0
github.com/logzio/logzio_terraform_client v1.20.1
github.com/stoewer/go-strcase v1.3.0
github.com/stretchr/testify v1.8.1
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,8 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
github.com/kylelemons/godebug v1.1.0 h1:RPNrshWIDI6G2gRW9EHilWtl7Z6Sb1BR0xunSBf0SNc=
github.com/logzio/logzio_terraform_client v1.20.0 h1:0eynfD4nDB5H7pNwsodWeff6fh4Ccd7Cj8DGaWwRnyU=
github.com/logzio/logzio_terraform_client v1.20.0/go.mod h1:hEQixCq9RPpvyzWerxIWKf0SYgangyWpPeogN7nytC0=
github.com/logzio/logzio_terraform_client v1.20.1 h1:ZSrYwKqYavvPNUfjV4R1Ld+Aa13dmCaxhL6bsiUN7TY=
github.com/logzio/logzio_terraform_client v1.20.1/go.mod h1:hEQixCq9RPpvyzWerxIWKf0SYgangyWpPeogN7nytC0=
github.com/matryer/is v1.2.0/go.mod h1:2fLPjFQM9rhQ15aVEtbuwhJinnOqrmgXPNdZsdwlWXA=
github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU=
github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc=
Expand Down
43 changes: 43 additions & 0 deletions logzio/resource_grafana_alert_rule_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/logzio/logzio_terraform_provider/logzio/utils"
"os"
"regexp"
"testing"
)

Expand Down Expand Up @@ -86,6 +87,11 @@ func TestAccLogzioGrafanaAlertRule_CreateUpdateAlertRule(t *testing.T) {
resource.TestCheckResourceAttr(resourceFullName, grafanaAlertRuleFor, "4m30s"),
),
},
{
// Update invalid name
Config: getGrafanaAlertRuleConfigInvalidTitle(folderUid),
ExpectError: regexp.MustCompile("alert Title cannot contain '/' or '\\\\\\\\' charchters"),
},
},
})
}
Expand Down Expand Up @@ -235,3 +241,40 @@ resource "logzio_grafana_alert_rule" "test_grafana_alert" {
}
`, folderUid)
}

func getGrafanaAlertRuleConfigInvalidTitle(folderUid string) string {
return fmt.Sprintf(`
resource "logzio_grafana_alert_rule" "test_grafana_alert" {
annotations = {
"foo" = "bar"
"hello" = "world"
}
condition = "A"
data {
ref_id = "B"
datasource_uid = "AB1C234567D89012E"
query_type = ""
model = jsonencode({
hide = false
intervalMs = 2000
refId = "B"
})
relative_time_range {
from = 700
to = 0
}
}
labels = {
"hey" = "oh"
"lets" = "go"
}
is_paused = false
exec_err_state = "Alerting"
folder_uid = "%s"
for = "4m30s"
no_data_state = "OK"
rule_group = "rule_group_1"
title = "invalid/title"
}
`, folderUid)
}
2 changes: 2 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,8 @@ terraform import logzio_subaccount.my_subaccount <SUBACCOUNT-ID>

### Changelog

- **v1.14.1**:
- Upgrade `logzio_client_terraform to 1.20.1`.
- **v1.14.0**:
- Upgrade `logzio_client_terraform to 1.20.0`.
- Support Grafana folders.
Expand Down

0 comments on commit d17c92f

Please sign in to comment.