hashicorp / terraform-provider-google

Terraform Provider for Google Cloud Platform
https://registry.terraform.io/providers/hashicorp/google/latest/docs
Mozilla Public License 2.0
2.25k stars 1.7k forks source link

google_monitoring_dashboard: Add a computed attribute url #7246

Open yegle opened 3 years ago

yegle commented 3 years ago

Community Note

Description

Right now the only computed attribute is the id.

In order to generate a link to the dashboard (e.g. use it in alert policy) one has to write something like this:

https://console.cloud.google.com/monitoring/dashboards/custom/${basename(google_monitoring_dashboard.dashboard-name.id)}?project=${var.project}

New or Affected Resource(s)

Potential Terraform Configuration

# Propose what you think the configuration to take advantage of this feature should look like.
# We may not use it verbatim, but it's helpful in understanding your intent.

References

danawillow commented 3 years ago

I'm pretty hesitant to add this since it isn't an attribute that the API returns. We'd have to hard-code it in the provider, and then if the URL ever changed, people would have to upgrade their provider version to get the new one. I'd recommend filing a feature request against the Monitoring team to see if they would add that as an output-only attribute in their API.