-
Notifications
You must be signed in to change notification settings - Fork 0
/
locals.telemetry.tf
39 lines (39 loc) · 1.38 KB
/
locals.telemetry.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
locals {
module_name = "avm-res-network-bastionhost"
module_type = "res"
# This constructs the ARM deployment name that is used for the telemetry.
# We shouldn't ever hit the 64 character limit but use substr just in case.
telem_arm_deployment_name = substr(
format(
"%s.%s.%s.v%s.%s",
local.telem_puid,
local.module_type,
substr(local.module_name, 0, 30),
replace(local.module_version, ".", "-"),
local.telem_random_hex
),
0,
64
)
# This is an empty ARM deployment template.
telem_arm_template_content = jsonencode(
{
"$schema" = "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
"contentVersion" = "1.0.0.0",
"parameters" = {},
"variables" = {},
"resources" = [],
"outputs" = {
"telemetry" = {
"type" = "String",
"value" = "For more information, see https://aka.ms/avm/telemetry"
}
}
}
)
# This is the unique id AVM Terraform modules that is supplied by the AVM team.
# See https://azure.github.io/Azure-Verified-Modules/specs/shared/#id-sfr3---category-telemetry---deploymentusage-telemetry
telem_puid = "46d3xgtf"
# This ensures we don't get errors if telemetry is disabled.
telem_random_hex = can(random_id.telem[0].hex) ? random_id.telem[0].hex : ""
}