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
feat(cloud_stack): add cloud_provider_url, connections_api_url, and sm_url outputs
Add computed URL attributes to the grafana_cloud_stack resource and data
source so users can wire them directly to the provider config without
manual URL construction:
- cloud_provider_url: derived from cluster_slug
- connections_api_url: derived from cluster_slug
- sm_url: read from GCOM API (RegionSyntheticMonitoringApiUrl)
Update provider docs to show the Terraform-native approach and remove
the manual curl/jq alternatives.
Copy file name to clipboardExpand all lines: docs/data-sources/cloud_stack.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,8 +40,10 @@ available at “https://<stack_slug>.grafana.net".
40
40
-`alertmanager_status` (String) Status of the Alertmanager instance configured for this stack.
41
41
-`alertmanager_url` (String) Base URL of the Alertmanager instance configured for this stack.
42
42
-`alertmanager_user_id` (Number) User ID of the Alertmanager instance configured for this stack.
43
+
-`cloud_provider_url` (String) Base URL of the Cloud Provider API for this stack's cluster. This can be used with the `cloud_provider_url` provider config option to manage Cloud Provider resources for this stack.
43
44
-`cluster_name` (String) Name of the cluster where this stack resides.
44
45
-`cluster_slug` (String) Slug of the cluster where this stack resides.
46
+
-`connections_api_url` (String) Base URL of the Connections API for this stack's cluster. This can be used with the `connections_api_url` provider config option to manage Connections resources for this stack.
45
47
-`delete_protection` (Boolean) Whether to enable delete protection for the stack, preventing accidental deletion.
46
48
-`description` (String) Description of stack.
47
49
-`fleet_management_name` (String) Name of the Fleet Management instance configured for this stack.
@@ -121,6 +123,7 @@ available at “https://<stack_slug>.grafana.net".
121
123
-`prometheus_url` (String) Prometheus url for this instance.
122
124
-`prometheus_user_id` (Number) Prometheus user ID. Used for e.g. remote_write.
123
125
-`region_slug` (String) The region this stack is deployed to.
126
+
-`sm_url` (String) Base URL of the Synthetic Monitoring API for this stack's region. This can be used with the `sm_url` provider config option. Note: Synthetic Monitoring requires activation either via the `grafana_synthetic_monitoring_installation` resource or manually in the Grafana Cloud UI before it can be used.
124
127
-`status` (String) Status of the stack.
125
128
-`traces_ip_allow_list_cname` (String) Comma-separated list of CNAMEs that can be whitelisted to access the Traces instance (Optional)
Copy file name to clipboardExpand all lines: docs/index.md
+17-50Lines changed: 17 additions & 50 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -161,6 +161,18 @@ data "grafana_synthetic_monitoring_probes" "main" {
161
161
}
162
162
```
163
163
164
+
The Synthetic Monitoring API URL for a stack's region is available as an output of the `grafana_cloud_stack` resource or data source via the `sm_url` attribute. This can be used with the `sm_url` provider config option:
~> **Note:** Synthetic Monitoring must be activated before it can be used. Use the `grafana_synthetic_monitoring_installation` resource or activate it manually in the Grafana Cloud UI.
175
+
164
176
### Managing Grafana OnCall
165
177
166
178
Note that you may need to set the `oncall_api_url` in the provider block
@@ -343,35 +355,12 @@ the in-screen instructions, of following [this guide](https://grafana.com/docs/g
343
355
344
356
#### Obtaining Cloud Provider API hostname
345
357
346
-
Having created the token, we can find the correct Cloud Provider API hostname by running the following script, that requires `curl` and [`jq`](https://jqlang.org/) installed:
347
-
348
-
```bash
349
-
curl -sH "Authorization: Bearer <Access Token from previous step>""https://grafana.com/api/instances"| \
This script will return a list of all the Grafana Cloud stacks you own, with the Cloud Provider API hostname for each one. Choose the correct hostname for the stack you want to manage.
354
-
For example, in the following response, the correct hostname for the `herokublogpost` stack is `https://cloud-provider-api-prod-us-central-0.grafana.net`.
cloud_provider_access_token = "<Access Token from previous step>"
375
364
}
376
365
```
377
366
@@ -476,33 +465,11 @@ the in-screen instructions, of following [this guide](https://grafana.com/docs/g
476
465
477
466
#### Obtaining Connections API hostname
478
467
479
-
Having created the token, we can find the correct Connections API hostname by running the following script, that requires `curl` and [`jq`](https://jqlang.org/) installed:
480
-
481
-
```bash
482
-
curl -sH "Authorization: Bearer <Access Token from previous step>""https://grafana.com/api/instances"| \
This script will return a list of all the Grafana Cloud stacks you own, with the Connections API hostname for each one. Choose the correct hostname for the stack you want to manage.
487
-
For example, in the following response, the correct hostname for the `examplestackname` stack is `https://connections-api-prod-eu-west-0.grafana.net`.
-`alertmanager_status` (String) Status of the Alertmanager instance configured for this stack.
55
55
-`alertmanager_url` (String) Base URL of the Alertmanager instance configured for this stack.
56
56
-`alertmanager_user_id` (Number) User ID of the Alertmanager instance configured for this stack.
57
+
-`cloud_provider_url` (String) Base URL of the Cloud Provider API for this stack's cluster. This can be used with the `cloud_provider_url` provider config option to manage Cloud Provider resources for this stack.
57
58
-`cluster_name` (String) Name of the cluster where this stack resides.
58
59
-`cluster_slug` (String) Slug of the cluster where this stack resides.
60
+
-`connections_api_url` (String) Base URL of the Connections API for this stack's cluster. This can be used with the `connections_api_url` provider config option to manage Connections resources for this stack.
59
61
-`fleet_management_name` (String) Name of the Fleet Management instance configured for this stack.
60
62
-`fleet_management_private_connectivity_info_availability_zone_ids` (List of String) Availability Zone IDs for Fleet Management when using AWS PrivateLink (only for AWS stacks)
61
63
-`fleet_management_private_connectivity_info_availability_zones` (List of String) Availability Zones for Fleet Management when using AWS PrivateLink (only for AWS stacks)
-`prometheus_status` (String) Prometheus status for this instance.
131
133
-`prometheus_url` (String) Prometheus url for this instance.
132
134
-`prometheus_user_id` (Number) Prometheus user ID. Used for e.g. remote_write.
135
+
-`sm_url` (String) Base URL of the Synthetic Monitoring API for this stack's region. This can be used with the `sm_url` provider config option. Note: Synthetic Monitoring requires activation either via the `grafana_synthetic_monitoring_installation` resource or manually in the Grafana Cloud UI before it can be used.
133
136
-`status` (String) Status of the stack.
134
137
-`traces_ip_allow_list_cname` (String) Comma-separated list of CNAMEs that can be whitelisted to access the Traces instance (Optional)
"sm_url": common.ComputedStringWithDescription("Base URL of the Synthetic Monitoring API for this stack's region. This can be used with the `sm_url` provider config option. Note: Synthetic Monitoring requires activation either via the `grafana_synthetic_monitoring_installation` resource or manually in the Grafana Cloud UI before it can be used."),
201
+
199
202
// OnCall
200
203
"oncall_api_url": common.ComputedStringWithDescription("Base URL of the OnCall API instance configured for this stack."),
"fleet_management_private_connectivity_info_availability_zone_ids": privateConnectivityArrayDescription("Availability Zone IDs", "Fleet Management"),
260
263
264
+
// Cloud Provider
265
+
"cloud_provider_url": common.ComputedStringWithDescription("Base URL of the Cloud Provider API for this stack's cluster. This can be used with the `cloud_provider_url` provider config option to manage Cloud Provider resources for this stack."),
266
+
261
267
// Connections
262
-
"influx_url": common.ComputedStringWithDescription("Base URL of the InfluxDB instance configured for this stack. The username is the same as the metrics' (`prometheus_user_id` attribute of this resource). See https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/ for docs on how to use this."),
263
-
"otlp_url": common.ComputedStringWithDescription("Base URL of the OTLP instance configured for this stack. The username is the stack's ID (`id` attribute of this resource). See https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/ for docs on how to use this."),
268
+
"connections_api_url": common.ComputedStringWithDescription("Base URL of the Connections API for this stack's cluster. This can be used with the `connections_api_url` provider config option to manage Connections resources for this stack."),
269
+
"influx_url": common.ComputedStringWithDescription("Base URL of the InfluxDB instance configured for this stack. The username is the same as the metrics' (`prometheus_user_id` attribute of this resource). See https://grafana.com/docs/grafana-cloud/send-data/metrics/metrics-influxdb/push-from-telegraf/ for docs on how to use this."),
270
+
"otlp_url": common.ComputedStringWithDescription("Base URL of the OTLP instance configured for this stack. The username is the stack's ID (`id` attribute of this resource). See https://grafana.com/docs/grafana-cloud/send-data/otlp/send-data-otlp/ for docs on how to use this."),
The Synthetic Monitoring API URL for a stack's region is available as an output of the `grafana_cloud_stack` resource or data source via the `sm_url` attribute. This can be used with the `sm_url` provider config option:
~> **Note:** Synthetic Monitoring must be activated before it can be used. Use the `grafana_synthetic_monitoring_installation` resource or activate it manually in the Grafana Cloud UI.
40
+
29
41
### Managing Grafana OnCall
30
42
31
43
Note that you may need to set the `oncall_api_url` in the provider block
@@ -103,35 +115,12 @@ the in-screen instructions, of following [this guide](https://grafana.com/docs/g
103
115
104
116
#### Obtaining Cloud Provider API hostname
105
117
106
-
Having created the token, we can find the correct Cloud Provider API hostname by running the following script, that requires `curl`and [`jq`](https://jqlang.org/) installed:
This script will return a list of all the Grafana Cloud stacks you own, with the Cloud Provider API hostname for each one. Choose the correct hostname for the stack you want to manage.
114
-
For example, in the following response, the correct hostname for the `herokublogpost` stack is `https://cloud-provider-api-prod-us-central-0.grafana.net`.
cloud_provider_access_token = "<Access Token from previous step>"
135
124
}
136
125
```
137
126
@@ -161,33 +150,11 @@ the in-screen instructions, of following [this guide](https://grafana.com/docs/g
161
150
162
151
#### Obtaining Connections API hostname
163
152
164
-
Having created the token, we can find the correct Connections API hostname by running the following script, that requires `curl`and [`jq`](https://jqlang.org/) installed:
This script will return a list of all the Grafana Cloud stacks you own, with the Connections API hostname for each one. Choose the correct hostname for the stack you want to manage.
172
-
For example, in the following response, the correct hostname for the `examplestackname` stack is `https://connections-api-prod-eu-west-0.grafana.net`.
0 commit comments