resource "opslevel_check_alert_source_usage" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
alert_type = "pagerduty" # one of: "pagerduty", "datadog", "opsgenie"
alert_name_predicate = {
type = "exists"
value = null
}
}
resource "opslevel_check_repository_grep" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
filepaths = ["kjsd"]
directory_search = false
file_contents_predicate = {
type = "does_not_exist"
value = null
}
}
resource "opslevel_check_repository_file" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
filepaths = ["kjsd"]
use_absolute_root = false
directory_search = false
file_contents_predicate = {
type = "contains"
value = "asdf"
}
}
resource "opslevel_check_repository_search" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
file_contents_predicate = {
type = "contains"
value = "asdf"
}
}
resource "opslevel_check_service_ownership" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
tag_predicate = {
type = "contains"
value = "asdf"
}
}
resource "opslevel_check_service_property" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
property = "name"
predicate = {
type = "contains"
value = "asdf"
}
}
resource "opslevel_check_tag_defined" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
tag_key = "name"
tag_predicate = {
type = "contains"
value = "asdf"
}
}
resource "opslevel_check_tool_usage" "example" {
name = "foo"
enabled = true
# To set a future enable date remove field 'enabled' and use 'enable_on'
# enable_on = "2022-05-23T14:14:18.782000Z"
category = "Z2lkOi8vb3BzbGV2ZWwvQ2F0ZWdvcnkvNjk3OQ"
level = "Z2lkOi8vb3BzbGV2ZWwvTGV2ZWwvMzcwOA"
owner = "Z2lkOi8vb3BzbGV2ZWwvVGVhbS8xNzQzNA"
filter = "Z2lkOi8vb3BzbGV2ZWwvRmlsdGVyLzQ3NDM"
notes = "Optional additional info on why this check is run or how to fix it"
tool_category = "runbooks"
environment_predicate = {
type = "contains"
value = "asdf"
}
tool_name_predicate = {
type = "contains"
value = "asdf"
}
tool_url_predicate = {
type = "contains"
value = "asdf"
}
}
Modify the type and value of each
type = "exists" and type = "does_not_exist" should not have a value. terraform validate prints an error otherwise
All other type = "<valid type>" requires a value. terraform validate guides the dev along
Issues
Add filter predicate validation for Terraform configs
Changelog
Add predicate validation at config time, i.e.
terraform validate
(pre-plan).NOTE: predicated on update in this opslevel-go PR
changie
entryTophatting
Using this config
Modify the
type
andvalue
of eachtype = "exists"
andtype = "does_not_exist"
should not have a value.terraform validate
prints an error otherwisetype = "<valid type>"
requires a value.terraform validate
guides the dev along