From f8d2645a8e684093ccf09391c6b32390b8792e76 Mon Sep 17 00:00:00 2001 From: hezijie Date: Wed, 31 Jul 2024 17:00:32 +0800 Subject: [PATCH 1/2] use new module telemetry solution --- .../providers.tf | 2 +- .../azureopenai-public-endpoint/providers.tf | 2 +- module_telemetry.tf | 23 ++++++++----------- providers.tf | 2 +- 4 files changed, 13 insertions(+), 16 deletions(-) diff --git a/examples/azureopenai-private-endpoints/providers.tf b/examples/azureopenai-private-endpoints/providers.tf index 0b298c0..e81a10d 100644 --- a/examples/azureopenai-private-endpoints/providers.tf +++ b/examples/azureopenai-private-endpoints/providers.tf @@ -9,7 +9,7 @@ terraform { } modtm = { source = "Azure/modtm" - version = ">= 0.1.8, < 1.0" + version = "~> 0.3" } } } diff --git a/examples/azureopenai-public-endpoint/providers.tf b/examples/azureopenai-public-endpoint/providers.tf index 0b298c0..e81a10d 100644 --- a/examples/azureopenai-public-endpoint/providers.tf +++ b/examples/azureopenai-public-endpoint/providers.tf @@ -9,7 +9,7 @@ terraform { } modtm = { source = "Azure/modtm" - version = ">= 0.1.8, < 1.0" + version = "~> 0.3" } } } diff --git a/module_telemetry.tf b/module_telemetry.tf index 3279691..223130f 100644 --- a/module_telemetry.tf +++ b/module_telemetry.tf @@ -1,17 +1,14 @@ -resource "modtm_telemetry" "this" { - tags = { +data "azurerm_client_config" "telemetry" {} - avm_git_commit = "85058677c04067d191d46e38e173e11d00caafa2" - avm_git_file = "module_telemetry.tf" - avm_git_last_modified_at = "2024-01-29 15:15:29" - avm_git_org = "Azure" - avm_git_repo = "terraform-azurerm-openai" - avm_yor_name = "this" - avm_yor_trace = "bbfeb8dc-4a52-40ab-b156-4e709a8e867e" - } - ephemeral_number = 26737 +data "modtm_module_source" "telemetry" { + module_path = path.module +} - lifecycle { - ignore_changes = [ephemeral_number] +resource "modtm_telemetry" "this" { + tags = { + subscription_id = data.azurerm_client_config.telemetry.subscription_id + tenant_id = data.azurerm_client_config.telemetry.tenant_id + module_source = data.modtm_module_source.telemetry.module_source + module_version = data.modtm_module_source.telemetry.module_version } } \ No newline at end of file diff --git a/providers.tf b/providers.tf index e5603f5..ada4f6c 100644 --- a/providers.tf +++ b/providers.tf @@ -9,7 +9,7 @@ terraform { } modtm = { source = "Azure/modtm" - version = ">= 0.1.8, < 1.0" + version = "~> 0.3" } random = { source = "hashicorp/random" From 3a15b7babfeb44db8a0e9c5e52144b91e60fd4a5 Mon Sep 17 00:00:00 2001 From: hezijie Date: Wed, 31 Jul 2024 17:04:12 +0800 Subject: [PATCH 2/2] update readme --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6f859f0..4f2f641 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,7 @@ Azure OpenAI Terraform Module and Samples |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | | [azurerm](#requirement\_azurerm) | ~> 3.80 | -| [modtm](#requirement\_modtm) | >= 0.1.8, < 1.0 | +| [modtm](#requirement\_modtm) | ~> 0.3 | | [random](#requirement\_random) | >= 3.0 | ## Providers @@ -17,7 +17,7 @@ Azure OpenAI Terraform Module and Samples | Name | Version | |------|---------| | [azurerm](#provider\_azurerm) | ~> 3.80 | -| [modtm](#provider\_modtm) | >= 0.1.8, < 1.0 | +| [modtm](#provider\_modtm) | ~> 0.3 | | [random](#provider\_random) | >= 3.0 | ## Modules @@ -36,11 +36,13 @@ No modules. | [azurerm_private_endpoint.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/private_endpoint) | resource | | [modtm_telemetry.this](https://registry.terraform.io/providers/Azure/modtm/latest/docs/resources/telemetry) | resource | | [random_integer.this](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/integer) | resource | +| [azurerm_client_config.telemetry](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source | | [azurerm_private_dns_zone.dns_zone](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/private_dns_zone) | data source | | [azurerm_resource_group.pe_vnet_rg](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source | | [azurerm_resource_group.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/resource_group) | data source | | [azurerm_subnet.pe_subnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/subnet) | data source | | [azurerm_virtual_network.vnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/virtual_network) | data source | +| [modtm_module_source.telemetry](https://registry.terraform.io/providers/Azure/modtm/latest/docs/data-sources/module_source) | data source | ## Inputs