-
Notifications
You must be signed in to change notification settings - Fork 0
/
constants.go
104 lines (96 loc) · 2.01 KB
/
constants.go
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
package synthetics
const (
tfSimpleMonitorType = "newrelic_synthetics_monitor"
tfStepMonitorType = "newrelic_synthetics_monitor_step"
tfScriptMonitorType = "newrelic_synthetics_script_monitor"
getMonitors = `query($query: String!) {
actor {
entitySearch(query: $query) {
results {
entities {
... on SyntheticMonitorEntityOutline {
guid
name
monitorType
monitoredUrl
goldenTags {
tags {
key
}
}
tags {
key
values
}
}
}
}
}
}
}
`
getSteps = `query($accountID: Int!, $guid: EntityGuid!) {
actor {
account(id: $accountID) {
synthetics {
steps(monitorGuid: $guid) {
ordinal
type
values
}
}
}
}
}
`
getScript = `query($accountID: Int!, $guid: EntityGuid!) {
actor {
account(id: $accountID) {
synthetics {
script(monitorGuid: $guid) {
text
}
}
}
}
}
`
providerTF = `# Configure the New Relic provider
provider "newrelic" {
account_id = var.account_id
api_key = var.api_key
region = "US"
}
variable "account_id" {
type = number
description = "The New Relic Account ID"
default = %d
}
variable "api_key" {
type = string
description = "The New Relic API Key"
}
`
)
// these should be treated as constants as well, but Go
// does not allow map or slice types to be constant
var (
periodMap = map[string]string{
"1": "EVERY_MINUTE",
"5": "EVERY_5_MINUTES",
"10": "EVERY_10_MINUTES",
"15": "EVERY_15_MINUTES",
"30": "EVERY_30_MINUTES",
"60": "EVERY_HOUR",
"360": "EVERY_6_HOURS",
"720": "EVERY_12_HOURS",
"1440": "EVERY_DAY",
}
regionMap = map[string]string{
"Montreal, Québec, CA": "CA_CENTRAL_1",
"Washington, DC, USA": "US_EAST_1",
"Columbus, OH, USA": "US_EAST_2",
"San Francisco, CA, USA": "US_WEST_1",
"Portland, OR, USA": "US_WEST_2",
}
)