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.33k stars 1.73k forks source link

support for google_tag_manager_* resources #12439

Open maxcbc opened 2 years ago

maxcbc commented 2 years ago

Community Note

Description

Google Tag Manager has an API which enables GTM resources (containers, tags, triggers, variables etc) to be managed programatically.

I'm not sure whether this would precisely fall under this provider or not, though GTM is:

Managing this via terraform would be an absolute godsend, as there is little to no way of managing GTM as code currently, leading to issues for people trying to maintain consistency and compliance across multiple configurations.

Its something I'd love to work on myself, but I feel it would be better living within the google provider and I think it needs some real thought about how to design the implementation (which may require more time than I'm able to give it).

New or Affected Resource(s)

Potential Terraform Configuration

resource "google_tag_manager_container" "site_1" {
  display_name = "site_1.example.com"
}

resource "google_tag_manager_variable" "ga4_id" {
  name = "ga4_measurement_id"
  value = "somevalue"
}

resource "google_tag_manager_tag" "ga4" {
  container = google_tag_manager_container.site_1.id
  type = "google_analytics_ga4_configuration"
  config {
    measurement_id = google_tag_manager_variable.ga4_id.ref
  }
}

References

vvksh commented 6 months ago

any updates on this?