-
Notifications
You must be signed in to change notification settings - Fork 4
/
test-sample.tf
175 lines (156 loc) · 5.57 KB
/
test-sample.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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
provider "instana" {
api_token = ""
endpoint = ""
}
resource "instana_application_config" "terraform-test" {
label = "Terraform Test"
match_specification = "aws.ec2.tag.stage EQUALS 'live-test' AND entity.type EQUALS 'mysql' OR entity.type EQUALS 'elasticsearch'"
}
resource "instana_custom_event_spec_system_rule" "example" {
name = "test-instana-system-rule"
query = "entity.service.name:\"btm-payment-export\" AND entity.tag:stage=live-test"
enabled = true
triggering = true
description = "Terraform test of system rule"
expiration_time = 60000
rule_severity = "warning"
rule_system_rule_id = "entity.offline"
}
resource "instana_custom_event_spec_threshold_rule" "example" {
name = "test-instana-threshold-rule"
entity_type = "nomadScheduler"
query = "entity.tag:\"stage=dev\" AND entity.tag:\"region=aws-us-east-1\""
enabled = true
triggering = true
description = "Terraform test of threshold rule"
expiration_time = 60000
rule_severity = "warning"
rule_metric_name = "nomad.client.allocations.pending"
rule_window = 60000
rule_aggregation = "sum"
rule_condition_operator = ">"
rule_condition_value = 0.0
}
resource "instana_custom_event_spec_entity_verification_rule" "example" {
name = "name"
query = "query"
enabled = true
triggering = true
description = "description"
expiration_time = 60000
rule_severity = "warning"
rule_matching_entity_type = "process"
rule_matching_operator = "is"
rule_matching_entity_label = "entity-label"
rule_offline_duration = 60000
}
resource "instana_alerting_channel_email" "example" {
name = "my-email-alerting-channel"
emails = ["[email protected]", "[email protected]"]
}
resource "instana_alerting_channel_google_chat" "example" {
name = "my-google-chat-alerting-channel"
webhook_url = "https://my.google.chat.weebhook.exmaple.com/"
}
resource "instana_alerting_channel_office_365" "example" {
name = "my-office365-alerting-channel"
webhook_url = "https://my.office365.weebhook.exmaple.com/"
}
resource "instana_alerting_channel_ops_genie" "example" {
name = "my-ops-genie-alerting-channel"
api_key = "my-secure-api-key"
tags = ["tag1", "tag2"]
region = "EU"
}
resource "instana_alerting_channel_pager_duty" "example" {
name = "my-pager-duty-alerting-channel"
service_integration_key = "my-service-integration-key"
}
resource "instana_alerting_channel_slack" "example" {
name = "my-slack-alerting-channel"
webhook_url = "https://my.slack.weebhook.exmaple.com/"
icon_url = "https://my.slack.icon.exmaple.com/" #Optional
channel = "my-channel" #Optional
}
resource "instana_alerting_channel_splunk" "example" {
name = "my-splunk-alerting-channel"
url = "https://my.splunk.url.example.com"
token = "my-splunk-token"
}
resource "instana_alerting_channel_victor_ops" "example" {
name = "my-victor-ops-alerting-channel"
api_key = "my-victor-ops-api-key"
routing_key = "my-victor-ops-routing-key"
}
resource "instana_alerting_channel_webhook" "example" {
name = "my-generic-webhook-alerting-channel"
webhook_urls = ["https://my.weebhook1.exmaple.com/", "https://my.weebhook2.exmaple.com/"]
http_headers = { #Optional
header1 = "headerValue1"
header2 = "headerValue2"
}
}
resource "instana_alerting_config" "alerting_for_rules" {
alert_name = "name"
integration_ids = [
"${instana_alerting_channel_email.example.id}",
"${instana_alerting_channel_google_chat.example.id}"
]
event_filter_query = "entity.tag:stage=live-test"
event_filter_rule_ids = [
"${instana_custom_event_spec_system_rule.example.id}",
"${instana_custom_event_spec_threshold_rule.example.id}",
"${instana_custom_event_spec_entity_verification_rule.example.id}"
]
}
resource "instana_alerting_config" "alerting_for_event_types" {
alert_name = "name"
integration_ids = [
"${instana_alerting_channel_pager_duty.example.id}",
"${instana_alerting_channel_email.example.id}"
]
event_filter_query = "entity.tag:stage=live-test"
event_filter_event_types = ["incident", "critical"]
}
data "instana_synthetic_location" "monitor" {
label = "label-name"
location_type = "Private"
}
resource "instana_synthetic_test" "uptime_check" {
label = "test"
active = true
locations = [data.instana_synthetic_location.monitor.id]
test_frequency = 10
playback_mode = "Staggered"
configuration {
mark_synthetic_call = true
retries = 0
retry_interval = 1
synthetic_type = "HTTPAction"
timeout = "3m"
url = "https://example.com"
operation = "GET"
}
custom_properties = {
"foo" = "bar"
}
}
resource "instana_synthetic_test" "http_action" {
label = "test"
active = true
locations = [data.instana_synthetic_location.monitor.id]
configuration {
synthetic_type = "HTTPScript"
script = <<EOF
const assert = require('assert');
$http.get('https://terraform.io',
function(err, response, body) {
if (err) {
console.error(err);
return;
}
assert.equal(response.statusCode, 200, 'Expected a 200 OK response');
});
EOF
}
}