add module telemetry
This commit is contained in:
Родитель
07ec41c896
Коммит
2171ecc6e7
|
@ -192,12 +192,15 @@ Originally created by [Eugene Chuvyrov](http://github.com/echuvyrov)
|
|||
|------|---------|
|
||||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.5 |
|
||||
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | ~> 4.0 |
|
||||
| <a name="requirement_modtm"></a> [modtm](#requirement\_modtm) | 0.3.2 |
|
||||
|
||||
## Providers
|
||||
|
||||
| Name | Version |
|
||||
|------|---------|
|
||||
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | ~> 4.0 |
|
||||
| <a name="provider_modtm"></a> [modtm](#provider\_modtm) | 0.3.2 |
|
||||
| <a name="provider_random"></a> [random](#provider\_random) | n/a |
|
||||
|
||||
## Modules
|
||||
|
||||
|
@ -213,6 +216,10 @@ No modules.
|
|||
| [azurerm_subnet_route_table_association.vnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_route_table_association) | resource |
|
||||
| [azurerm_virtual_network.vnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) | resource |
|
||||
| [azurerm_virtual_network_dns_servers.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network_dns_servers) | resource |
|
||||
| [modtm_telemetry.telemetry](https://registry.terraform.io/providers/Azure/modtm/0.3.2/docs/resources/telemetry) | resource |
|
||||
| [random_uuid.telemetry](https://registry.terraform.io/providers/hashicorp/random/latest/docs/resources/uuid) | resource |
|
||||
| [azurerm_client_config.telemetry](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |
|
||||
| [modtm_module_source.telemetry](https://registry.terraform.io/providers/Azure/modtm/0.3.2/docs/data-sources/module_source) | data source |
|
||||
|
||||
## Inputs
|
||||
|
||||
|
@ -222,6 +229,7 @@ No modules.
|
|||
| <a name="input_bgp_community"></a> [bgp\_community](#input\_bgp\_community) | (Optional) The BGP community attribute in format `<as-number>:<community-value>`. | `string` | `null` | no |
|
||||
| <a name="input_ddos_protection_plan"></a> [ddos\_protection\_plan](#input\_ddos\_protection\_plan) | The set of DDoS protection plan configuration | <pre>object({<br> enable = bool<br> id = string<br> })</pre> | `null` | no |
|
||||
| <a name="input_dns_servers"></a> [dns\_servers](#input\_dns\_servers) | The DNS servers to be used with vNet. | `list(string)` | `[]` | no |
|
||||
| <a name="input_enable_telemetry"></a> [enable\_telemetry](#input\_enable\_telemetry) | This variable controls whether or not telemetry is enabled for the module.<br>For more information see https://aka.ms/avm/telemetryinfo.<br>If it is set to false, then no telemetry will be collected. | `bool` | `true` | no |
|
||||
| <a name="input_nsg_ids"></a> [nsg\_ids](#input\_nsg\_ids) | A map of subnet name to Network Security Group IDs | `map(string)` | `{}` | no |
|
||||
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | Name of the resource group to be imported. | `string` | n/a | yes |
|
||||
| <a name="input_route_tables_ids"></a> [route\_tables\_ids](#input\_route\_tables\_ids) | A map of subnet name to Route table ids | `map(string)` | `{}` | no |
|
||||
|
|
|
@ -12,4 +12,5 @@ module "vnet" {
|
|||
resource_group_name = azurerm_resource_group.example.name
|
||||
use_for_each = var.use_for_each
|
||||
vnet_location = var.vnet_location
|
||||
enable_telemetry = false
|
||||
}
|
|
@ -23,6 +23,7 @@ module "vnet" {
|
|||
source = "../../"
|
||||
resource_group_name = azurerm_resource_group.example.name
|
||||
use_for_each = var.use_for_each
|
||||
enable_telemetry = false
|
||||
address_space = ["10.0.0.0/16"]
|
||||
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
||||
subnet_names = ["subnet1", "subnet2", "subnet3"]
|
||||
|
|
|
@ -12,6 +12,7 @@ module "vnet" {
|
|||
resource_group_name = azurerm_resource_group.example.name
|
||||
use_for_each = var.use_for_each
|
||||
vnet_location = var.location
|
||||
enable_telemetry = false
|
||||
address_space = ["10.0.0.0/16"]
|
||||
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
||||
subnet_names = ["subnet1", "subnet2", "subnet3"]
|
||||
|
|
|
@ -13,6 +13,7 @@ module "vnet" {
|
|||
resource_group_name = azurerm_resource_group.example.name
|
||||
use_for_each = var.use_for_each
|
||||
vnet_location = var.location
|
||||
enable_telemetry = false
|
||||
address_space = ["10.0.0.0/16"]
|
||||
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
||||
subnet_names = ["subnet1", "subnet2", "subnet3"]
|
||||
|
|
|
@ -12,6 +12,7 @@ module "vnet" {
|
|||
resource_group_name = azurerm_resource_group.example.name
|
||||
use_for_each = var.use_for_each
|
||||
vnet_location = var.location
|
||||
enable_telemetry = false
|
||||
address_space = ["10.0.0.0/16"]
|
||||
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
||||
subnet_names = ["subnet1", "subnet2", "subnet3"]
|
||||
|
|
|
@ -12,6 +12,7 @@ module "vnet" {
|
|||
resource_group_name = azurerm_resource_group.example.name
|
||||
use_for_each = var.use_for_each
|
||||
vnet_location = var.location
|
||||
enable_telemetry = false
|
||||
address_space = ["10.0.0.0/16"]
|
||||
subnet_prefixes = ["10.0.1.0/24", "10.0.2.0/24", "10.0.3.0/24"]
|
||||
subnet_names = ["subnet1", "subnet2", "subnet3"]
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
data "azurerm_client_config" "telemetry" {
|
||||
count = var.enable_telemetry ? 1 : 0
|
||||
}
|
||||
|
||||
data "modtm_module_source" "telemetry" {
|
||||
count = var.enable_telemetry ? 1 : 0
|
||||
|
||||
module_path = path.module
|
||||
}
|
||||
|
||||
resource "random_uuid" "telemetry" {
|
||||
count = var.enable_telemetry ? 1 : 0
|
||||
}
|
||||
|
||||
resource "modtm_telemetry" "telemetry" {
|
||||
count = var.enable_telemetry ? 1 : 0
|
||||
|
||||
tags = {
|
||||
subscription_id = one(data.azurerm_client_config.telemetry).subscription_id
|
||||
tenant_id = one(data.azurerm_client_config.telemetry).tenant_id
|
||||
module_source = one(data.modtm_module_source.telemetry).module_source
|
||||
module_version = one(data.modtm_module_source.telemetry).module_version
|
||||
random_id = one(random_uuid.telemetry).result
|
||||
}
|
||||
}
|
11
variables.tf
11
variables.tf
|
@ -38,6 +38,17 @@ variable "dns_servers" {
|
|||
description = "The DNS servers to be used with vNet."
|
||||
}
|
||||
|
||||
variable "enable_telemetry" {
|
||||
type = bool
|
||||
default = true
|
||||
nullable = false
|
||||
description = <<DESCRIPTION
|
||||
This variable controls whether or not telemetry is enabled for the module.
|
||||
For more information see https://aka.ms/avm/telemetryinfo.
|
||||
If it is set to false, then no telemetry will be collected.
|
||||
DESCRIPTION
|
||||
}
|
||||
|
||||
variable "nsg_ids" {
|
||||
type = map(string)
|
||||
default = {
|
||||
|
|
|
@ -6,5 +6,9 @@ terraform {
|
|||
source = "hashicorp/azurerm"
|
||||
version = "~> 4.0"
|
||||
}
|
||||
modtm = {
|
||||
source = "Azure/modtm"
|
||||
version = "0.3.2"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче