Skip to content

Commit

Permalink
Merge pull request site24x7#83 from jim-billy/TERRAFORM_PROVIDER_SITE…
Browse files Browse the repository at this point in the history
…24X7_MAIN_BRANCH

Supported dependency_resource_ids in monitors.
  • Loading branch information
jim-0212 authored Jun 20, 2022
2 parents 8578c88 + 17962e0 commit 82e6ad9
Show file tree
Hide file tree
Showing 37 changed files with 264 additions and 100 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
// Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
5 changes: 4 additions & 1 deletion api/monitor_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ type WebsiteMonitor struct {
NotificationProfileID string `json:"notification_profile_id"`
ThresholdProfileID string `json:"threshold_profile_id"`
MonitorGroups []string `json:"monitor_groups,omitempty"`
DependencyResourceIDs []string `json:"dependency_resource_ids,omitempty"`
UserGroupIDs []string `json:"user_group_ids,omitempty"`
TagIDs []string `json:"tag_ids,omitempty"`
ThirdPartyServiceIDs []string `json:"third_party_services,omitempty"`
Expand Down Expand Up @@ -143,7 +144,7 @@ type WebPageSpeedMonitor struct {
NotificationProfileID string `json:"notification_profile_id"`
ThresholdProfileID string `json:"threshold_profile_id"`
MonitorGroups []string `json:"monitor_groups,omitempty"`
DependencyResourceID []string `json:"dependency_resource_ids,omitempty"`
DependencyResourceIDs []string `json:"dependency_resource_ids,omitempty"`
UserGroupIDs []string `json:"user_group_ids,omitempty"`
TagIDs []string `json:"tag_ids,omitempty"`
ThirdPartyServiceIDs []string `json:"third_party_services,omitempty"`
Expand Down Expand Up @@ -196,6 +197,7 @@ type SSLMonitor struct {
NotificationProfileID string `json:"notification_profile_id"`
ThresholdProfileID string `json:"threshold_profile_id"`
MonitorGroups []string `json:"monitor_groups,omitempty"`
DependencyResourceIDs []string `json:"dependency_resource_ids,omitempty"`
UserGroupIDs []string `json:"user_group_ids,omitempty"`
TagIDs []string `json:"tag_ids,omitempty"`
ThirdPartyServiceIDs []string `json:"third_party_services,omitempty"`
Expand Down Expand Up @@ -268,6 +270,7 @@ type RestApiMonitor struct {
NotificationProfileID string `json:"notification_profile_id"`
ThresholdProfileID string `json:"threshold_profile_id"`
MonitorGroups []string `json:"monitor_groups,omitempty"`
DependencyResourceIDs []string `json:"dependency_resource_ids,omitempty"`
UserGroupIDs []string `json:"user_group_ids,omitempty"`
TagIDs []string `json:"tag_ids,omitempty"`
ThirdPartyServiceIDs []string `json:"third_party_services,omitempty"`
Expand Down
13 changes: 13 additions & 0 deletions docs/resources/rest_api_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,18 @@ resource "site24x7_rest_api_monitor" "rest_api_monitor_us" {
// used.
notification_profile_name = "Terraform Profile"
// (Optional) List of monitor group IDs to associate the monitor to.
monitor_groups = [
"123",
"456"
]
// (Optional) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
dependency_resource_ids = [
"123",
"456"
]
// (Optional) List if user group IDs to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
Expand Down Expand Up @@ -159,6 +171,7 @@ resource "site24x7_rest_api_monitor" "rest_api_monitor_us" {
* `notification_profile_name` (String) Name of the notification profile to be associated with the monitor. Profile name matching works for both exact and partial match.
* `threshold_profile_id` (String) Threshold profile to be associated with the monitor.
* `monitor_groups` (List of String) List of monitor groups to which the monitor has to be associated.
* `dependency_resource_ids` (List of String) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
* `user_group_ids` (List of String) List of user groups to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `user_group_names` (List of String) List of user group names to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `tag_ids` (List of String) List of tags IDs to be associated to the monitor. Either specify tag_ids or tag_names.
Expand Down
72 changes: 72 additions & 0 deletions docs/resources/ssl_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,99 @@ Use this resource to create, update and delete a SSL monitor in Site24x7.
## Example Usage

```hcl
// Site24x7 SSL Certificate Monitor API doc - https://www.site24x7.com/help/api/#ssl-certificate
resource "site24x7_ssl_monitor" "ssl_monitor_us" {
// (Required) Display name for the monitor
display_name = "Example SSL Monitor"
// (Required) Domain name to be verified for SSL Certificate.
domain_name = "www.example.com"
// (Optional) Location Profile to be associated with the monitor. If
// location_profile_id and location_profile_name are omitted,
// the first profile returned by the /api/location_profiles endpoint
// (https://www.site24x7.com/help/api/#list-of-all-location-profiles) will be
// used.
location_profile_id = "123"
// (Optional) Name of the Location Profile that has to be associated with the monitor.
// Either specify location_profile_id or location_profile_name.
// If location_profile_id and location_profile_name are omitted,
// the first profile returned by the /api/location_profiles endpoint
// (https://www.site24x7.com/help/api/#list-of-all-location-profiles) will be
// used.
location_profile_name = "North America"
// (Optional) Notification profile to be associated with the monitor. If
// omitted, the first profile returned by the /api/notification_profiles
// endpoint (https://www.site24x7.com/help/api/#list-notification-profiles)
// will be used.
notification_profile_id = "123"
// (Optional) Name of the notification profile that has to be associated with the monitor.
// Profile name matching works for both exact and partial match.
// Either specify notification_profile_id or notification_profile_name.
// If notification_profile_id and notification_profile_name are omitted,
// the first profile returned by the /api/notification_profiles endpoint
// (https://www.site24x7.com/help/api/#list-notification-profiles) will be
// used.
notification_profile_name = "Terraform Profile"
// (Optional) Threshold profile to be associated with the monitor. If
// omitted, the first profile returned by the /api/threshold_profiles
// endpoint for the website monitor (https://www.site24x7.com/help/api/#list-threshold-profiles) will
// be used.
threshold_profile_id = "123"
// (Optional) List of monitor group IDs to associate the monitor to.
monitor_groups = [
"123",
"456"
]
// (Optional) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
dependency_resource_ids = [
"123",
"456"
]
// (Optional) List if user group IDs to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
// (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be used.
user_group_ids = [
"123",
]
// (Optional) List if user group names to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
// (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be used.
user_group_names = [
"Terraform",
"Network",
"Admin",
]
// (Optional) List if tag IDs to be associated to the monitor.
tag_ids = [
"123",
]
// (Optional) List of tag names to be associated to the monitor. Tag name matching works for both exact and
// partial match. Either specify tag_ids or tag_names.
tag_names = [
"Terraform",
"Network",
]
// (Optional) List of Third Party Service IDs to be associated to the monitor.
third_party_service_ids = [
"4567"
]
}
```

## Attributes Reference
Expand All @@ -53,6 +124,7 @@ resource "site24x7_ssl_monitor" "ssl_monitor_us" {
* `location_profile_id` (String) Location profile to be associated with the monitor.
* `location_profile_name` (String) Name of the location profile to be associated with the monitor.
* `monitor_groups` (List of String) List of monitor groups to which the monitor has to be associated.
* `dependency_resource_ids` (List of String) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
* `user_group_ids` (List of String) List of user groups to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `user_group_names` (List of String) List of user group names to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `tag_ids` (List of String) List of tags IDs to be associated to the monitor. Either specify tag_ids or tag_names.
Expand Down
7 changes: 7 additions & 0 deletions docs/resources/web_page_speed_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,12 @@ resource "site24x7_web_page_speed_monitor" "web_page_speed_monitor_example" {
"456"
]
// (Optional) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
dependency_resource_ids = [
"123",
"456"
]
// (Optional) List if user group IDs to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
Expand Down Expand Up @@ -225,6 +231,7 @@ resource "site24x7_web_page_speed_monitor" "web_page_speed_monitor_example" {
* `location_profile_id` (String) Location profile to be associated with the monitor.
* `location_profile_name` (String) Name of the location profile to be associated with the monitor.
* `monitor_groups` (List of String) List of monitor groups to which the monitor has to be associated.
* `dependency_resource_ids` (List of String) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
* `user_group_ids` (List of String) List of user groups to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `user_group_names` (List of String) List of user group names to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `tag_ids` (List of String) List of tags IDs to be associated to the monitor. Either specify tag_ids or tag_names.
Expand Down
7 changes: 7 additions & 0 deletions docs/resources/website_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ resource "site24x7_website_monitor" "website_monitor" {
"456"
]
// (Optional) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
dependency_resource_ids = [
"123",
"456"
]
// (Optional) List if user group IDs to be notified on down. If omitted, the
// first user group returned by the /api/user_groups endpoint
// (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be used.
Expand Down Expand Up @@ -163,6 +169,7 @@ resource "site24x7_website_monitor" "website_monitor" {
* `location_profile_id` (String) Location profile to be associated with the monitor.
* `location_profile_name` (String) Name of the location profile to be associated with the monitor.
* `monitor_groups` (List of String) List of monitor groups to which the monitor has to be associated.
* `dependency_resource_ids` (List of String) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
* `user_group_ids` (List of String) List of user groups to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `user_group_names` (List of String) List of user group names to be notified when the monitor is down. Either specify user_group_ids or user_group_names. If omitted, the first user group returned by the /api/user_groups endpoint will be used.
* `tag_ids` (List of String) List of tags IDs to be associated to the monitor. Either specify tag_ids or tag_names.
Expand Down
6 changes: 3 additions & 3 deletions examples/all_resources_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
// Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
// Uncomment for local setup
# source = "registry.zoho.io/zoho/site24x7"
# version = "1.0.15"
# version = "1.0.16"
# source = "registry.terraform.io/site24x7/site24x7"
# version = "1.0.15"
# version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/amazon_monitor_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/data-sources/monitor_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/data-sources/monitors_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/location_profile_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/monitor_group_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/notification_profile_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/opsgenie_integration_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/pagerduty_integration_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
14 changes: 13 additions & 1 deletion examples/rest_api_monitor_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down Expand Up @@ -82,6 +82,18 @@ resource "site24x7_rest_api_monitor" "rest_api_monitor_us" {
// used.
notification_profile_name = "Terraform Profile"

// (Optional) List of monitor group IDs to associate the monitor to.
monitor_groups = [
"123",
"456"
]

// (Optional) List of dependent resource IDs. Suppress alert when dependent monitor(s) is down.
dependency_resource_ids = [
"123",
"456"
]

// (Optional) List if user group IDs to be notified on down.
// Either specify user_group_ids or user_group_names. If omitted, the
// first user group returned by the /api/user_groups endpoint
Expand Down
2 changes: 1 addition & 1 deletion examples/schedule_maintenance_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/server_monitor_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/servicenow_integration_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/slack_integration_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ terraform {
site24x7 = {
source = "site24x7/site24x7"
# Update the latest version from https://registry.terraform.io/providers/site24x7/site24x7/latest
version = "1.0.15"
version = "1.0.16"
}
}
}
Expand Down
Loading

0 comments on commit 82e6ad9

Please sign in to comment.