Skip to content

Commit

Permalink
Merge pull request #212 from sujithramagesh/EUM_TERRAFORM_PROVIDER_BR…
Browse files Browse the repository at this point in the history
…ANCH

Changes for Domain Expiry resource
  • Loading branch information
jim-billy-zoho authored Nov 23, 2023
2 parents b7cd250 + 36cb957 commit e7ab845
Show file tree
Hide file tree
Showing 4 changed files with 99 additions and 7 deletions.
65 changes: 62 additions & 3 deletions docs/resources/domain_expiry_monitor.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,69 @@ Use this resource to create, update and delete a Domain-Expiry monitor in Site24
// Site24x7 Domain-Expiry Monitor API doc - https://www.site24x7.com/help/api/#domain-expiry
resource "site24x7_domain_expiry_monitor"
"domain_expiry_monitor_example" {

// (Required) Display name for the monitor
display_name = "Domain Expiry Monitor"

//(Required)Host name of the monitor
host_name="www.example.com"

//(Optional) Domain name to be given to the monitor
domain_name="www.example.com"

//(Optional)Whois Server Port.Default value is 43
port=443

//Select IPv6 for monitoring the websites hosted with IPv6 address. If
//you choose non IPv6 supported locations, monitoring will happen through
//IPv4.
use_ipv6=true

//(Optional)Timeout for connecting to the host.Range 1 - 45.
timeout=10

//(Optional) Day threshold for domain expiry notification.Range 1 - 999.
expire_days=30

//(Optional)Toggle button to perform automation or not
perform_automation=true

//(Optional)if user_group_ids is not choosen
//On-Call Schedule of your choice.
//Create new On-Call Schedule or find your preferred On-Call Schedule ID.
on_call_schedule_id="456418000001258016"

//(Optional)Ignores the registry expiry date and prefer registrar expiry
//date when notifying for domain expiry.
ignore_registry_date=true

// (Optional) Check for the keyword in the response.
matching_keyword = {
severity= 2
value= "sample"
}

// (Optional) Check for non existence of keyword in the response.
unmatching_keyword = {
severity= 2
value= "smile"
}

// (Optional) Match the regular expression in the response.
match_regex = {
severity= 2
value= ".*aaa.*"
}

//(Optional)Perform case sensitive keyword search or not.
match_case = false

// (Optional) Map of status to actions that should be performed on monitor
// status changes. See
// https://www.site24x7.com/help/api/#action-rule-constants for all available
// status values.
actions = {1=465545643755}

// (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)
Expand All @@ -43,7 +103,8 @@ resource "site24x7_domain_expiry_monitor"
// (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.
// (https://www.site24x7.com/help/api/#list-of-all-user-groups) will be
//used.
user_group_ids = [
"123",
]
Expand Down Expand Up @@ -75,8 +136,6 @@ resource "site24x7_domain_expiry_monitor"
"4567"
]

// (Optional) Mandatory, if the user group ID is not given. On-Call Schedule ID of your choice.
on_call_schedule_id = "3455"
}

## Attributes Reference
Expand Down
35 changes: 31 additions & 4 deletions examples/domain_expiry_monitor_us.tf
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ provider "site24x7" {
}

// Site24x7 Domain Expiry monitor API doc - https://www.site24x7.com/help/api/#domain-expiry
resource "site24x7_ssl_monitor" "doamin_expiry_monitor_basic" {
resource "site24x7_domain_expiry_monitor" "doamin_expiry_monitor_basic" {
// (Required) Display name for the monitor
display_name = "Example domain expiry Monitor"

Expand All @@ -69,6 +69,30 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_us" {
//Domain name for the monitor
domain_name = "www.example.com"

//(Optional)Whois Server Port.Default value is 43
port=443

//Should we prefer to use IPV6 or not
use_ipv6=true

//(Optional)Timeout for connecting to the host.Range 1 - 45.
timeout=10

//(Optional) Day threshold for domain expiry notification.Range 1 - 999.
expire_days=30

//(Optional)Toggle button to perform automation or not
perform_automation=true

//(Optional)if user_group_ids is not choosen
//On-Call Schedule of your choice.
//Create new On-Call Schedule or find your preferred On-Call Schedule ID.
on_call_schedule_id="456418000001258016"

//(Optional)Ignores the registry expiry date and prefer registrar expiry
//date when notifying for domain expiry.
ignore_registry_date=true

// (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
Expand All @@ -84,19 +108,19 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_us" {
// used.
location_profile_name = "North America"

// (Optional) Check for the keyword in the website response.
// (Optional) Check for the keyword in the response.
matching_keyword = {
severity= 2
value= "sample"
}

// (Optional) Check for non existence of keyword in the website response.
// (Optional) Check for non existence of keyword in the response.
unmatching_keyword = {
severity= 2
value= "smile"
}

// (Optional) Match the regular expression in the website response.
// (Optional) Match the regular expression in the response.
match_regex = {
severity= 2
value= ".*aaa.*"
Expand All @@ -107,6 +131,9 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_us" {
// status values.
actions = {1=465545643755}

//(Optional)Perform case sensitive keyword search or not.
match_case = false

// (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)
Expand Down
5 changes: 5 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,8 @@ resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_basic" {
}


// DomainExpiry Server API doc: https://www.site24x7.com/help/api/#domain-expiry
resource "site24x7_domain_expiry_monitor" "domain_expiry_monitor_basic" {
// (Required) Display name for the monitor
display_name = "ignore registry 2"
host_name = "file.com"
1 change: 1 addition & 0 deletions site24x7/monitors/domain_expiry.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ var DomainExpiryMonitorSchema = map[string]*schema.Schema{
"domain_name": {
Type: schema.TypeString,
Optional: true,
Default: "whios.iana.org",
Description: "Specify the name of the Whois server from where you wish to query the domain data.",
},
"port": {
Expand Down

0 comments on commit e7ab845

Please sign in to comment.