forked from hashicorp/terraform-provider-runscope
-
Notifications
You must be signed in to change notification settings - Fork 0
/
test.tf
55 lines (47 loc) · 1.39 KB
/
test.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
variable "access_token" {}
variable "team_uuid" {}
provider "runscope" {
access_token = "${var.access_token}"
}
resource "runscope_environment" "main" {
bucket_id = "${runscope_bucket.main.id}"
name = "shared-environment"
regions = ["us1", "eu1"]
}
# Create a bucket
resource "runscope_bucket" "main" {
name = "terraform-ftw"
team_uuid = "${var.team_uuid}"
}
# Create a test in the bucket
resource "runscope_test" "homepage_test" {
name = "homepage"
description = "checks example.com homepage is up and running"
bucket_id = "${runscope_bucket.main.id}"
}
# Create a test step
resource "runscope_step" "home_page_step" {
bucket_id = "${runscope_bucket.main.id}"
test_id = "${runscope_test.homepage_test.id}"
step_type = "request"
url = "http://example.com"
method = "GET"
assertions = [
{
source = "response_status"
comparison = "equal_number"
value = "200"
}
]
}
# Create a schedule to execute the test
resource "runscope_schedule" "hourly" {
bucket_id = "${runscope_bucket.main.id}"
test_id = "${runscope_test.homepage_test.id}"
interval = "1h"
note = "Hourly schedule"
environment_id = "${runscope_test.homepage_test.default_environment_id}"
}
output "bucket_url" {
value = "https://runscope.com/radar/${runscope_bucket.main.id}"
}