You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
synthetic_monitoring_installation: Better integration with stack (#898)
* `synthetic_monitoring_installation`: Better integration with stack
Closes#867
Currently, the way to configure this is very convoluted:
- It requires three attributes from the stack
- It doesn't set the SM API URL. For that, the user must use the provider level sm_api_url. This isn't easy to figure out
In this PR, I squashed all three stack attributes into one and added a way to configure the SM API URL
* Update examples/provider/provider-sm.tf
Co-authored-by: Leandro López <[email protected]>
* Extract SM API URLs + fix bad examples
---------
Co-authored-by: Leandro López <[email protected]>
Copy file name to clipboardExpand all lines: docs/resources/synthetic_monitoring_installation.md
+18-7Lines changed: 18 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@ description: |-
6
6
Sets up Synthetic Monitoring on a Grafana cloud stack and generates a token.
7
7
Once a Grafana Cloud stack is created, a user can either use this resource or go into the UI to install synthetic monitoring.
8
8
This resource cannot be imported but it can be used on an existing Synthetic Monitoring installation without issues.
9
+
Note that this resource must be used on a provider configured with Grafana Cloud credentials.
9
10
Official documentation https://grafana.com/docs/grafana-cloud/synthetic-monitoring/installation/API documentation https://github.com/grafana/synthetic-monitoring-api-go-client/blob/main/docs/API.md#apiv1registerinstall
10
11
---
11
12
@@ -15,6 +16,8 @@ Sets up Synthetic Monitoring on a Grafana cloud stack and generates a token.
15
16
Once a Grafana Cloud stack is created, a user can either use this resource or go into the UI to install synthetic monitoring.
16
17
This resource cannot be imported but it can be used on an existing Synthetic Monitoring installation without issues.
17
18
19
+
**Note that this resource must be used on a provider configured with Grafana Cloud credentials.**
-`logs_instance_id` (Number) The ID of the logs instance to install SM on (stack's `logs_user_id` attribute).
50
-
-`metrics_instance_id` (Number) The ID of the metrics instance to install SM on (stack's `prometheus_user_id` attribute).
51
56
-`metrics_publisher_key` (String, Sensitive) The Cloud API Key with the `MetricsPublisher` role used to publish metrics to the SM API
52
-
-`stack_id` (Number) The ID of the stack to install SM on.
57
+
-`stack_id` (String) The ID or slug of the stack to install SM on.
58
+
59
+
### Optional
60
+
61
+
-`logs_instance_id` (Number, Deprecated) Deprecated: Not used anymore.
62
+
-`metrics_instance_id` (Number, Deprecated) Deprecated: Not used anymore.
63
+
-`stack_sm_api_url` (String) The URL of the SM API to install SM on. This depends on the stack region, find the list of API URLs here: https://grafana.com/docs/grafana-cloud/synthetic-monitoring/private-probes/#probe-api-server-url. A static mapping exists in the provider but it may not contain all the regions. If it does contain the stack's region, this field is computed automatically and readable.
@@ -34,23 +55,30 @@ This resource cannot be imported but it can be used on an existing Synthetic Mon
34
55
ForceNew: true,
35
56
Description: "The Cloud API Key with the `MetricsPublisher` role used to publish metrics to the SM API",
36
57
},
58
+
"stack_sm_api_url": {
59
+
Type: schema.TypeString,
60
+
Optional: true,
61
+
Computed: true,
62
+
ForceNew: true,
63
+
Description: "The URL of the SM API to install SM on. This depends on the stack region, find the list of API URLs here: https://grafana.com/docs/grafana-cloud/synthetic-monitoring/private-probes/#probe-api-server-url. A static mapping exists in the provider but it may not contain all the regions. If it does contain the stack's region, this field is computed automatically and readable.",
64
+
},
37
65
"stack_id": {
38
-
Type: schema.TypeInt,
66
+
Type: schema.TypeString,
39
67
Required: true,
40
68
ForceNew: true,
41
-
Description: "The ID of the stack to install SM on.",
69
+
Description: "The ID or slug of the stack to install SM on.",
42
70
},
43
71
"metrics_instance_id": {
44
72
Type: schema.TypeInt,
45
-
Required: true,
46
-
ForceNew: true,
47
-
Description: "The ID of the metrics instance to install SM on (stack's `prometheus_user_id` attribute).",
73
+
Optional: true,
74
+
Deprecated: "Not used anymore.",
75
+
Description: "Deprecated: Not used anymore.",
48
76
},
49
77
"logs_instance_id": {
50
78
Type: schema.TypeInt,
51
-
Required: true,
52
-
ForceNew: true,
53
-
Description: "The ID of the logs instance to install SM on (stack's `logs_user_id` attribute).",
79
+
Optional: true,
80
+
Deprecated: "Not used anymore.",
81
+
Description: "Deprecated: Not used anymore.",
54
82
},
55
83
"sm_access_token": {
56
84
Type: schema.TypeString,
@@ -62,22 +90,44 @@ This resource cannot be imported but it can be used on an existing Synthetic Mon
0 commit comments