Skip to content

feat(cloud_stack): add cloud_provider_url, connections_api_url, sm_url and simplify provider docs#2679

Open
Duologic wants to merge 2 commits intomainfrom
duologic/moar_urls
Open

feat(cloud_stack): add cloud_provider_url, connections_api_url, sm_url and simplify provider docs#2679
Duologic wants to merge 2 commits intomainfrom
duologic/moar_urls

Conversation

@Duologic
Copy link
Copy Markdown
Contributor

Summary

  • Add three new computed URL attributes to the grafana_cloud_stack resource and data source: cloud_provider_url, connections_api_url, and sm_url. These allow users to wire all Grafana Cloud service URLs directly from the stack output, matching the provider configuration attribute names exactly.
  • Rewrite the comprehensive provider-cloud example to demonstrate a complete Grafana Cloud setup using only 2 provider blocks (one cloud alias for Cloud API, one default for all other services).
  • Simplify templates/index.md.tmpl by removing 6 sections that duplicated individual resource documentation (Synthetic Monitoring installation, OnCall, Frontend O11y, Cloud Provider, Connections, Fleet Management).
  • Clarify oncall_url and oncall_access_token provider attribute descriptions to explain they are only needed for OnCall OSS or dedicated tokens, not for Grafana Cloud usage.

URL derivation

Attribute Source
cloud_provider_url Derived from cluster_slug: https://cloud-provider-api-{clusterSlug}.grafana.net
connections_api_url Derived from cluster_slug: https://connections-api-{clusterSlug}.grafana.net
sm_url Returned directly by GCOM API as RegionSyntheticMonitoringApiUrl

Test plan

  • Existing grafana_cloud_stack resource and data source acceptance tests extended with regex-validated assertions for all three new URL attributes.
  • Unit tests pass (go test ./... -run TestUnit).
  • Docs regenerated cleanly (go generate ./...).

@github-actions
Copy link
Copy Markdown
Contributor

In order to lower resource usage and have a faster runtime, PRs will not run Cloud tests automatically.
To do so, a Grafana Labs employee must trigger the cloud acceptance tests workflow manually.

…m_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.
Rewrite the provider-cloud.tf example to show a complete Grafana Cloud
setup using only 2 provider blocks (cloud alias + default). Wire all
service URLs from the stack resource outputs (including the new
cloud_provider_url, connections_api_url, and sm_url attributes).

Simplify templates/index.md.tmpl by removing 6 sections (Synthetic
Monitoring installation, OnCall, Frontend O11y, Cloud Provider,
Connections, Fleet Management) that duplicated individual resource docs.

Update oncall_url and oncall_access_token descriptions in both framework
and legacy providers to clarify they are only needed for OnCall OSS or
dedicated tokens, not for Grafana Cloud usage.

Also update replace_references.go with new cross-references generated
from the updated example.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant