diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index 7724649..920ab58 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -19,7 +19,7 @@ } run-e2e-tests: - if: github.event.repository.name != 'terraform-azurerm-avm-template' && github.event.pull_request.head.repo.fork == false + if: github.event.pull_request.head.repo.fork == false uses: Azure/terraform-azurerm-avm-template/.github/workflows/test-examples-template.yml@main name: end to end secrets: inherit diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index 254164d..864db46 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -21,7 +21,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - name: check docs uses: Azure/terraform-azurerm-avm-template/.github/actions/docs-check@main @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - name: lint terraform uses: Azure/terraform-azurerm-avm-template/.github/actions/linting@main @@ -45,7 +45,7 @@ jobs: runs-on: ubuntu-latest steps: - name: checkout repository - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - name: avmfix uses: Azure/terraform-azurerm-avm-template/.github/actions/avmfix@main diff --git a/.github/workflows/version-check.yml b/.github/workflows/version-check.yml index c117502..8719641 100644 --- a/.github/workflows/version-check.yml +++ b/.github/workflows/version-check.yml @@ -16,7 +16,7 @@ jobs: if: github.event.repository.name != 'terraform-azurerm-avm-template' runs-on: ubuntu-latest steps: - - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 #v4.1.7 + - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 #v4.2.2 - name: Check version uses: Azure/terraform-azurerm-avm-template/.github/actions/version-check@main with: diff --git a/.gitignore b/.gitignore index e3faf45..b3ae623 100644 --- a/.gitignore +++ b/.gitignore @@ -20,8 +20,6 @@ crash.*.log # are not checked in override.tf override.tf.json -*_override.tf -*_override.tf.json # Include override files you do wish to add to version control using negated pattern # !example_override.tf @@ -51,4 +49,3 @@ avm.tflint_module.hcl avm.tflint_module.merged.hcl *.tfrc - diff --git a/README.md b/README.md index 787d566..bca9b48 100644 --- a/README.md +++ b/README.md @@ -103,7 +103,7 @@ The following requirements are needed by this module: - [alz](#requirement\_alz) (~> 0.16, >= 0.16.2) -- [azapi](#requirement\_azapi) (~> 2.0, >= 2.0.1) +- [azapi](#requirement\_azapi) (~> 2.0, >= 2.2) - [modtm](#requirement\_modtm) (~> 0.3) diff --git a/avm b/avm index 9716dfb..612108f 100755 --- a/avm +++ b/avm @@ -27,7 +27,7 @@ fi # Check if we are running in a container # If we are then just run make directly if [ -z "$AVM_IN_CONTAINER" ]; then - $CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm $AZURE_VOLUME -v /etc/passwd:/etc/passwd -v /etc/group:/etc/group -v "$(pwd)":/src -w /src -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1" + $CONTAINER_RUNTIME run --pull always --user "$(id -u):$(id -g)" --rm $AZURE_VOLUME -v "$(pwd)":/src -w /src -e GITHUB_TOKEN -e GITHUB_REPOSITORY -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make "$1" else make "$1" fi diff --git a/avm.bat b/avm.bat index 6b177be..2828801 100644 --- a/avm.bat +++ b/avm.bat @@ -18,6 +18,6 @@ IF "%~1"=="" ( ) REM Run the make target with CONTAINER_RUNTIME -%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1 +%CONTAINER_RUNTIME% run --pull always --rm -v "%cd%":/src -w /src --user "1000:1000" -e GITHUB_TOKEN -e ARM_SUBSCRIPTION_ID -e GITHUB_REPOSITORY -e GITHUB_REPOSITORY_OWNER mcr.microsoft.com/azterraform make %1 ENDLOCAL diff --git a/avm.tflint_example.override.hcl b/avm.tflint_example.override.hcl index 6632aa9..ff3d2a0 100644 --- a/avm.tflint_example.override.hcl +++ b/avm.tflint_example.override.hcl @@ -6,12 +6,6 @@ rule "terraform_comment_syntax" { enabled = false } -plugin "terraform" { - enabled = true - version = "0.9.1" - source = "github.com/terraform-linters/tflint-ruleset-terraform" -} - rule "terraform_unused_required_providers" { enabled = false } diff --git a/examples/management/README.md b/examples/management/README.md index 908f624..3af6b4e 100644 --- a/examples/management/README.md +++ b/examples/management/README.md @@ -33,7 +33,7 @@ locals { module "management" { source = "Azure/avm-ptn-alz-management/azurerm" - version = "0.4.0" + version = "0.6.0" automation_account_name = local.automation_account_name location = local.location @@ -86,7 +86,7 @@ The following requirements are needed by this module: - [azapi](#requirement\_azapi) (~> 2.0, >= 2.0.1) -- [azurerm](#requirement\_azurerm) (~> 3.100) +- [azurerm](#requirement\_azurerm) (~> 4.0) ## Resources @@ -129,6 +129,6 @@ Version: Source: Azure/avm-ptn-alz-management/azurerm -Version: 0.4.0 +Version: 0.6.0 \ No newline at end of file diff --git a/examples/management/main.tf b/examples/management/main.tf index 5e1905c..794261a 100644 --- a/examples/management/main.tf +++ b/examples/management/main.tf @@ -27,7 +27,7 @@ locals { module "management" { source = "Azure/avm-ptn-alz-management/azurerm" - version = "0.4.0" + version = "0.6.0" automation_account_name = local.automation_account_name location = local.location diff --git a/examples/management/terraform.tf b/examples/management/terraform.tf index 83c1dc2..450026d 100644 --- a/examples/management/terraform.tf +++ b/examples/management/terraform.tf @@ -11,7 +11,7 @@ terraform { } azurerm = { source = "hashicorp/azurerm" - version = "~> 3.100" + version = "~> 4.0" } } } diff --git a/examples/policy-assignment-modification-with-custom-lib/README.md b/examples/policy-assignment-modification-with-custom-lib/README.md index a6d774e..00c529a 100644 --- a/examples/policy-assignment-modification-with-custom-lib/README.md +++ b/examples/policy-assignment-modification-with-custom-lib/README.md @@ -92,7 +92,7 @@ The following requirements are needed by this module: - [azapi](#requirement\_azapi) (~> 2.0) -- [azurerm](#requirement\_azurerm) (~> 3.107) +- [azurerm](#requirement\_azurerm) (~> 4.0) ## Resources diff --git a/examples/policy-assignment-modification-with-custom-lib/terraform.tf b/examples/policy-assignment-modification-with-custom-lib/terraform.tf index fd5294d..8bce9a0 100644 --- a/examples/policy-assignment-modification-with-custom-lib/terraform.tf +++ b/examples/policy-assignment-modification-with-custom-lib/terraform.tf @@ -11,7 +11,7 @@ terraform { } azurerm = { source = "hashicorp/azurerm" - version = "~> 3.107" + version = "~> 4.0" } } } diff --git a/examples/privatednszones/README.md b/examples/privatednszones/README.md index eb87e70..0953ff7 100644 --- a/examples/privatednszones/README.md +++ b/examples/privatednszones/README.md @@ -30,7 +30,7 @@ locals { module "private_dns_zones" { source = "Azure/avm-ptn-network-private-link-private-dns-zones/azurerm" - version = "0.6.0" + version = "0.7.0" location = local.location resource_group_name = local.resource_group_name } @@ -75,7 +75,7 @@ The following requirements are needed by this module: - [azapi](#requirement\_azapi) (~> 2.0, >= 2.0.1) -- [azurerm](#requirement\_azurerm) (~> 3.100) +- [azurerm](#requirement\_azurerm) (~> 4.0) ## Resources @@ -118,6 +118,6 @@ Version: Source: Azure/avm-ptn-network-private-link-private-dns-zones/azurerm -Version: 0.6.0 +Version: 0.7.0 \ No newline at end of file diff --git a/examples/privatednszones/main.tf b/examples/privatednszones/main.tf index 190f547..07a2777 100644 --- a/examples/privatednszones/main.tf +++ b/examples/privatednszones/main.tf @@ -24,7 +24,7 @@ locals { module "private_dns_zones" { source = "Azure/avm-ptn-network-private-link-private-dns-zones/azurerm" - version = "0.6.0" + version = "0.7.0" location = local.location resource_group_name = local.resource_group_name } diff --git a/examples/privatednszones/terraform.tf b/examples/privatednszones/terraform.tf index 83c1dc2..450026d 100644 --- a/examples/privatednszones/terraform.tf +++ b/examples/privatednszones/terraform.tf @@ -11,7 +11,7 @@ terraform { } azurerm = { source = "hashicorp/azurerm" - version = "~> 3.100" + version = "~> 4.0" } } } diff --git a/main.telemetry_override.tf b/main.telemetry_override.tf new file mode 100644 index 0000000..7f5b824 --- /dev/null +++ b/main.telemetry_override.tf @@ -0,0 +1,32 @@ +data "azapi_client_config" "telemetry" { + count = var.enable_telemetry ? 1 : 0 +} + +data "alz_metadata" "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 = merge({ + subscription_id = one(data.azapi_client_config.telemetry).subscription_id + tenant_id = one(data.azapi_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 + alz_library_references = jsonencode(one(data.alz_metadata.telemetry).alz_library_references) + }, + var.partner_id != null ? { partner_id = var.partner_id } : {} + ) +} diff --git a/terraform.tf b/terraform.tf index ce8c4c9..ab8e151 100644 --- a/terraform.tf +++ b/terraform.tf @@ -7,7 +7,7 @@ terraform { } azapi = { source = "azure/azapi" - version = "~> 2.0, >= 2.0.1" + version = "~> 2.0, >= 2.2" } modtm = { source = "azure/modtm"