Course outlines for learning terraform.
export TF_VAR_checkly_api_key="your-api-key"
Add this to versions.tf
:
terraform {
required_providers {
checkly = {
source = "checkly/checkly"
version = "0.8.1-rc2"
}
}
}
providers.tf
:variable "checkly_api_key" {}
provider "checkly" {
api_key = var.checkly_api_key
}
main.tf
, or create a new file, for example checkly.tf
.resource "checkly_check" "example-check" {
name = "Example check"
type = "API"
activated = true
should_fail = false
frequency = 1
double_check = true
ssl_check = true
use_global_alert_settings = true
locations = [
"us-west-1"
]
request {
url = "https://${azurerm_public_ip.publicip.ip_address}/"
follow_redirects = true
assertion {
source = "STATUS_CODE"
comparison = "EQUALS"
target = "200"
}
}
}
terraform init
, terraform plan
and terraform apply
.