16 Apr 2024 05:02 PM - last edited on 17 Apr 2024 08:11 AM by MaciejNeumann
I am using Terraform to enable all GCP extensions 2.0 in my tenant.
Considering the following blocks:
# Get available extension 2.0 items from hub
data "dynatrace_hub_items" "extension2_0" {
type = "EXTENSION2"
}
# Add each google extension
resource "dynatrace_hub_extension_active_version" "google_extensions" {
for_each = { for item in data.dynatrace_hub_items.extension2_0.items : item.item_id => item["artifact_id"] if startswith(item.item_id, "google-") }
name = each.value
version = "1.0.5"
}
The resource dynatrace_hub_extension_active_version requires a specific version.
Is there a way to get the latest version for each extension & pass it ton the resource block?
I'm also interested in whether all GCP extensions are released with a common release number? E.g. will all extensions release 1.0.6 at the same time (if indeed that version was to be released)?
Solved! Go to Solution.
17 Apr 2024 03:15 PM
Hi @benjamin_johnso I don't see a direct approach for this, but I've been thinking and my best idea is to use the RSS News feed to get the version by script and to use it in your terraform script.
Hope it helps.
17 May 2024 08:44 AM
Thanks - I just created a python script that pulls the extensions from the hub API & gets the latest version.
This builds a yaml list & then the terraform resource iterates over the list.