Skip to content

Commit

Permalink
Merge pull request #8 from checkly/groups
Browse files Browse the repository at this point in the history
Add groups
  • Loading branch information
bitfield authored Jun 10, 2020
2 parents 0191d88 + fc1fe1e commit 184b093
Show file tree
Hide file tree
Showing 9 changed files with 927 additions and 184 deletions.
85 changes: 83 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ resource "checkly_check" "example-check" {
frequency = 1
double_check = true
ssl_check = true
ssl_check_domain = "api.example.com"
use_global_alert_settings = true
locations = [
Expand Down Expand Up @@ -94,7 +93,6 @@ resource "checkly_check" "example-check2" {
activated = true
should_fail = true
frequency = 1
ssl_check_domain = "api.example.com"
double_check = true
degraded_response_time = 5000
max_response_time = 10000
Expand Down Expand Up @@ -160,6 +158,89 @@ resource "checkly_check" "example-check2" {
}
```

### Groups

Checkly's groups feature allows you to group together a set of related checks, which can also share default settings for various attributes. Here is an example check group:

```terraform
resource "checkly_check_group" "test-group1" {
name = "My test group 1"
activated = true
muted = false
tags = [
"auto"
]
locations = [
"eu-west-1",
]
concurrency = 3
api_check_defaults {
url = "http://example.com/"
headers = {
X-Test = "foo"
}
query_parameters = {
query = "foo"
}
assertion {
source = "STATUS_CODE"
property = ""
comparison = "EQUALS"
target = "200"
}
basic_auth {
username = "user"
password = "pass"
}
}
environment_variables = {
ENVTEST = "Hello world"
}
double_check = true
use_global_alert_settings = false
alert_settings {
escalation_type = "RUN_BASED"
run_based_escalation {
failed_run_threshold = 1
}
time_based_escalation {
minutes_failing_threshold = 5
}
ssl_certificates {
enabled = true
alert_threshold = 30
}
reminders {
amount = 2
interval = 5
}
}
local_setup_script = "setup-test"
local_teardown_script = "teardown-test"
}
```

To add a check to a group, set its `group_id` attribute to the ID of the group. For example:

```terraform
resource "checkly_check" "test-check1" {
name = "My test check 1"
...
group_id = checkly_check_group.test-group1.id
group_order = 1
}
The `group_order` attribute specifies in which order the checks will be executed: 1, 2, 3, etc.
## Developing the provider
Clone the repo, build the project and add it to your Terraform plugins directory. You will need to have Go installed.
Expand Down
42 changes: 23 additions & 19 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,39 @@ module github.com/checkly/terraform-provider-checkly
go 1.14

require (
cloud.google.com/go v0.53.0 // indirect
github.com/aws/aws-sdk-go v1.29.7 // indirect
github.com/bmatcuk/doublestar v1.2.2 // indirect
github.com/checkly/checkly-go-sdk v0.3.0
cloud.google.com/go/storage v1.9.0 // indirect
github.com/agext/levenshtein v1.2.3 // indirect
github.com/aws/aws-sdk-go v1.31.11 // indirect
github.com/bmatcuk/doublestar v1.3.1 // indirect
github.com/checkly/checkly-go-sdk v0.4.1
github.com/fatih/color v1.9.0 // indirect
github.com/google/go-cmp v0.4.0
github.com/google/go-cmp v0.4.1
github.com/gruntwork-io/terratest v0.18.3
github.com/hashicorp/go-hclog v0.12.0 // indirect
github.com/hashicorp/go-plugin v1.0.1 // indirect
github.com/hashicorp/go-hclog v0.14.1 // indirect
github.com/hashicorp/go-multierror v1.1.0 // indirect
github.com/hashicorp/go-retryablehttp v0.6.6 // indirect
github.com/hashicorp/go-uuid v1.0.2 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/hashicorp/hil v0.0.0-20190212132231-97b3a9cdfa93 // indirect
github.com/hashicorp/terraform v0.12.21
github.com/hashicorp/hcl/v2 v2.6.0 // indirect
github.com/hashicorp/hil v0.0.0-20200423225030-a18a1cd20038 // indirect
github.com/hashicorp/terraform v0.12.26
github.com/hashicorp/terraform-svchost v0.0.0-20191119180714-d2e4933b9136 // indirect
github.com/hashicorp/yamux v0.0.0-20190923154419-df201c70410d // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mattn/go-isatty v0.0.12 // indirect
github.com/mattn/go-colorable v0.1.6 // indirect
github.com/mitchellh/cli v1.1.1 // indirect
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
github.com/mitchellh/mapstructure v1.3.1 // indirect
github.com/mitchellh/reflectwalk v1.0.1 // indirect
github.com/oklog/run v1.1.0 // indirect
github.com/posener/complete v1.2.3 // indirect
github.com/spf13/afero v1.2.2 // indirect
github.com/ulikunitz/xz v0.5.6 // indirect
github.com/ulikunitz/xz v0.5.7 // indirect
github.com/vmihailenco/msgpack v4.0.4+incompatible // indirect
github.com/zclconf/go-cty v1.3.0 // indirect
golang.org/x/crypto v0.0.0-20200220183623-bac4c82f6975 // indirect
golang.org/x/exp v0.0.0-20200213203834-85f925bdd4d0 // indirect
golang.org/x/net v0.0.0-20200219183655-46282727080f // indirect
golang.org/x/sys v0.0.0-20200219091948-cb0a6d8edb6c // indirect
golang.org/x/tools v0.0.0-20200220224806-8a925fa4c0df // indirect
google.golang.org/genproto v0.0.0-20200218151345-dad8c97a84f5 // indirect
honnef.co/go/tools v0.0.1-2020.1.2 // indirect
github.com/zclconf/go-cty v1.4.2 // indirect
golang.org/x/crypto v0.0.0-20200604202706-70a84ac30bf9 // indirect
golang.org/x/net v0.0.0-20200602114024-627f9648deb9 // indirect
golang.org/x/sys v0.0.0-20200602225109-6fdc65e7d980 // indirect
golang.org/x/tools v0.0.0-20200604183345-4d5ea46c79fe // indirect
google.golang.org/genproto v0.0.0-20200605102947-12044bf5ea91 // indirect
)
Loading

0 comments on commit 184b093

Please sign in to comment.