1
1
# @todo #1000 CI: validate and check Terraform configuration
2
- # @todo #1000 Terraform: add UptimeRobot
3
2
# @todo #1000 Terraform: add Mailgun
4
3
5
4
variable "do_token" {
@@ -8,6 +7,15 @@ variable "do_token" {
8
7
type = string
9
8
}
10
9
10
+ variable "uptimerobot_token" {
11
+ # How to create API Key:
12
+ # - open https://uptimerobot.com/dashboard
13
+ # - go to MySettings
14
+ # - scroll down to API Settings and select "Main API Key"
15
+ description = " UptimeRobot API key"
16
+ type = string
17
+ }
18
+
11
19
# Digital Ocean provider docs: https://registry.terraform.io/providers/digitalocean/digitalocean/2.28.1/docs
12
20
provider "digitalocean" {
13
21
token = var. do_token
@@ -107,3 +115,33 @@ resource "digitalocean_record" "domain_key" {
107
115
value = " k=rsa; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDLo/TZgHYIM7xrU9dBJCJTTsP90rGhHuyTqSrC3LT+T3vsH5azrz1+9Dm86xz6TpcmrHV1WgmSnw72C++AXstlS8CEg6Z6XVuxMDKsMnMVEWDm1bpESy+h29Ns3kY/EzMTaF1V88ICmr6fSpQIOd9u/lZpsABjfh2wfag1rqWcGwIDAQAB"
108
116
}
109
117
118
+
119
+ # UptimeRobot provider docs: https://registry.terraform.io/providers/vexxhost/uptimerobot/0.8.2/docs
120
+ provider "uptimerobot" {
121
+ api_key = var. uptimerobot_token
122
+ }
123
+
124
+ # https://registry.terraform.io/providers/vexxhost/uptimerobot/0.8.2/docs/resources/alert_contact
125
+ resource "uptimerobot_alert_contact" "email" {
126
+
127
+ type = " e-mail"
128
+ friendly_name = " [email protected] "
129
+ }
130
+
131
+ # https://registry.terraform.io/providers/vexxhost/uptimerobot/0.8.2/docs/resources/monitor
132
+ resource "uptimerobot_monitor" "mystamps" {
133
+ url = " https://my-stamps.ru"
134
+ type = " http"
135
+ friendly_name = " MyStamps"
136
+ interval = 300 # 300 seconds by default
137
+
138
+ alert_contact {
139
+ id = uptimerobot_alert_contact. email . id
140
+ }
141
+ }
142
+
143
+ # https://registry.terraform.io/providers/vexxhost/uptimerobot/0.8.2/docs/resources/status_page
144
+ resource "uptimerobot_status_page" "status_page" {
145
+ friendly_name = " MyStamps Site Status"
146
+ monitors = [ uptimerobot_monitor . mystamps . id ]
147
+ }
0 commit comments