Skip to content

Commit

Permalink
chore: repository governance (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb authored Jan 17, 2025
1 parent 7259da7 commit b4c6d5e
Show file tree
Hide file tree
Showing 18 changed files with 53 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/version-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -51,4 +49,3 @@ avm.tflint_module.hcl
avm.tflint_module.merged.hcl

*.tfrc

2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ The following requirements are needed by this module:

- <a name="requirement_alz"></a> [alz](#requirement\_alz) (~> 0.16, >= 0.16.2)

- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0, >= 2.0.1)
- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0, >= 2.2)

- <a name="requirement_modtm"></a> [modtm](#requirement\_modtm) (~> 0.3)

Expand Down
2 changes: 1 addition & 1 deletion avm
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion avm.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 0 additions & 6 deletions avm.tflint_example.override.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
6 changes: 3 additions & 3 deletions examples/management/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -86,7 +86,7 @@ The following requirements are needed by this module:

- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0, >= 2.0.1)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 3.100)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 4.0)

## Resources

Expand Down Expand Up @@ -129,6 +129,6 @@ Version:

Source: Azure/avm-ptn-alz-management/azurerm

Version: 0.4.0
Version: 0.6.0

<!-- END_TF_DOCS -->
2 changes: 1 addition & 1 deletion examples/management/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion examples/management/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.100"
version = "~> 4.0"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ The following requirements are needed by this module:

- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 3.107)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 4.0)

## Resources

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.107"
version = "~> 4.0"
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions examples/privatednszones/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -75,7 +75,7 @@ The following requirements are needed by this module:

- <a name="requirement_azapi"></a> [azapi](#requirement\_azapi) (~> 2.0, >= 2.0.1)

- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 3.100)
- <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) (~> 4.0)

## Resources

Expand Down Expand Up @@ -118,6 +118,6 @@ Version:

Source: Azure/avm-ptn-network-private-link-private-dns-zones/azurerm

Version: 0.6.0
Version: 0.7.0

<!-- END_TF_DOCS -->
2 changes: 1 addition & 1 deletion examples/privatednszones/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion examples/privatednszones/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ terraform {
}
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.100"
version = "~> 4.0"
}
}
}
32 changes: 32 additions & 0 deletions main.telemetry_override.tf
Original file line number Diff line number Diff line change
@@ -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 } : {}
)
}
2 changes: 1 addition & 1 deletion terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
azapi = {
source = "azure/azapi"
version = "~> 2.0, >= 2.0.1"
version = "~> 2.0, >= 2.2"
}
modtm = {
source = "azure/modtm"
Expand Down

0 comments on commit b4c6d5e

Please sign in to comment.