From 17d46d6a81a57da7f725c67e482b015ddced6003 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 07:17:37 +0000 Subject: [PATCH 01/19] Upgrade to 3.105 --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index e411427323..605b96986c 100644 --- a/main.tf +++ b/main.tf @@ -3,7 +3,7 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "~> 3.75.0" + version = "~> 3.105.0" configuration_aliases = [ azurerm.vhub ] From f1641efc742a16147b9c83a129cc1311f0cabaa6 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 07:22:45 +0000 Subject: [PATCH 02/19] Remove update --- modules/apim/api_management_gateway_api/module.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/apim/api_management_gateway_api/module.tf b/modules/apim/api_management_gateway_api/module.tf index a955868d9e..6c4dd19ff7 100644 --- a/modules/apim/api_management_gateway_api/module.tf +++ b/modules/apim/api_management_gateway_api/module.tf @@ -19,7 +19,6 @@ resource "azurerm_api_management_gateway_api" "apim" { content { create = try(timeouts.value.create, null) read = try(timeouts.value.read, null) - update = try(timeouts.value.update, null) delete = try(timeouts.value.delete, null) } } From 0f63520ae368d57e8251ac23397a026bcebc62ee Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 07:31:30 +0000 Subject: [PATCH 03/19] Adding explicit azuread configuration for mock provider tests --- main.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/main.tf b/main.tf index 605b96986c..f56d26b496 100644 --- a/main.tf +++ b/main.tf @@ -35,6 +35,9 @@ provider "azapi" { skip_provider_registration = true } +provider "azuread" { +} + data "azurerm_subscription" "primary" {} data "azurerm_client_config" "current" {} data "azuread_client_config" "current" {} From acea3c3c0111a548fd9e2423dbef2ead7245a51b Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 08:22:57 +0000 Subject: [PATCH 04/19] Adding azuread provider stub --- examples/main.tf | 3 +++ 1 file changed, 3 insertions(+) diff --git a/examples/main.tf b/examples/main.tf index 64a74b9c1d..1834c20c66 100644 --- a/examples/main.tf +++ b/examples/main.tf @@ -57,6 +57,9 @@ provider "azurerm" { features {} } + +provider "azuread" {} + data "azurerm_client_config" "default" {} locals { From c2b900ae0f641a982b71b1716c0d6538e05c8386 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 08:28:03 +0000 Subject: [PATCH 05/19] Azuread provider --- main.tf | 3 --- 1 file changed, 3 deletions(-) diff --git a/main.tf b/main.tf index f56d26b496..605b96986c 100644 --- a/main.tf +++ b/main.tf @@ -35,9 +35,6 @@ provider "azapi" { skip_provider_registration = true } -provider "azuread" { -} - data "azurerm_subscription" "primary" {} data "azurerm_client_config" "current" {} data "azuread_client_config" "current" {} From e2de92d2e14067b7b82e89dfc1371385aff42723 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 08:45:11 +0000 Subject: [PATCH 06/19] Update long runner scenarios --- .github/workflows/standalone-scenarios-longrunners.json | 1 - .../103-vpn-site-to-site-connection/configuration.tfvars | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/standalone-scenarios-longrunners.json b/.github/workflows/standalone-scenarios-longrunners.json index 6bb91b665d..5712cd8f61 100644 --- a/.github/workflows/standalone-scenarios-longrunners.json +++ b/.github/workflows/standalone-scenarios-longrunners.json @@ -18,7 +18,6 @@ "apim/116-api_management_subscription", "apim/117-api_management_product", "apim/118-api_management_platform_stv2", - "app_gateway/301-agw-v1", "compute/vmware_cluster/101-vmware_cluster", "mssql_mi/200-mi", "networking/virtual_network_gateway/100-expressroute-gateway", diff --git a/examples/networking/virtual_network_gateway/103-vpn-site-to-site-connection/configuration.tfvars b/examples/networking/virtual_network_gateway/103-vpn-site-to-site-connection/configuration.tfvars index a0932a6965..72638fb57a 100644 --- a/examples/networking/virtual_network_gateway/103-vpn-site-to-site-connection/configuration.tfvars +++ b/examples/networking/virtual_network_gateway/103-vpn-site-to-site-connection/configuration.tfvars @@ -78,7 +78,7 @@ virtual_network_gateway_connections = { connection1 = { name = "connection" resource_group_key = "vpngw" - type = "IPSec" + type = "IPsec" region = "region1" virtual_network_gateway_key = "gateway1" local_network_gateway_key = "local1" From 4040c99e1396375fcb03b05f45825b59e20e50c8 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Mon, 27 May 2024 09:50:30 +0000 Subject: [PATCH 07/19] Deprecated attribute --- modules/databases/cosmos_dbs/output.tf | 4 ---- 1 file changed, 4 deletions(-) diff --git a/modules/databases/cosmos_dbs/output.tf b/modules/databases/cosmos_dbs/output.tf index 00995cc84d..379cff6d14 100644 --- a/modules/databases/cosmos_dbs/output.tf +++ b/modules/databases/cosmos_dbs/output.tf @@ -2,10 +2,6 @@ output "cosmos_account" { value = azurerm_cosmosdb_account.cosmos_account.id } -output "connection_string" { - value = azurerm_cosmosdb_account.cosmos_account.connection_strings[0] -} - output "primary_key" { value = azurerm_cosmosdb_account.cosmos_account.primary_key } From ce3d5f0571a1ec40d429eb31a60663ab7d9c49c4 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Tue, 28 May 2024 06:26:01 +0000 Subject: [PATCH 08/19] Update spark version number --- .../synapse_analytics/101-synapse-sparkpool/configuration.tfvars | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/synapse_analytics/101-synapse-sparkpool/configuration.tfvars b/examples/synapse_analytics/101-synapse-sparkpool/configuration.tfvars index 9ecadd8905..93f3b9a033 100644 --- a/examples/synapse_analytics/101-synapse-sparkpool/configuration.tfvars +++ b/examples/synapse_analytics/101-synapse-sparkpool/configuration.tfvars @@ -54,6 +54,7 @@ synapse_workspaces = { synapse_workspace_key = "synapse_wrkspc_re1" node_size_family = "MemoryOptimized" node_size = "Small" + spark_version = "3.4" auto_scale = { max_node_count = 50 min_node_count = 3 From cb4936260194d8e21bb7a970d1d043f678a615e9 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Tue, 28 May 2024 06:38:28 +0000 Subject: [PATCH 09/19] Iot config files update --- examples/iot/100-iot-hub/configuration.tfvars | 2 +- examples/iot/103-iot-hub-with-dps/configuration.tfvars | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/iot/100-iot-hub/configuration.tfvars b/examples/iot/100-iot-hub/configuration.tfvars index 28769ed613..835b5ddaf8 100644 --- a/examples/iot/100-iot-hub/configuration.tfvars +++ b/examples/iot/100-iot-hub/configuration.tfvars @@ -43,7 +43,7 @@ iot_hub_certificate = { key = "iothub1" } is_verified = true - certificate_content = "iot/100-iot-hub/cert.pem" + certificate_content = "examples/iot/100-iot-hub/cert.pem" } } diff --git a/examples/iot/103-iot-hub-with-dps/configuration.tfvars b/examples/iot/103-iot-hub-with-dps/configuration.tfvars index 11b85e838c..5a89365040 100644 --- a/examples/iot/103-iot-hub-with-dps/configuration.tfvars +++ b/examples/iot/103-iot-hub-with-dps/configuration.tfvars @@ -67,7 +67,7 @@ iot_dps_certificate = { key = "dps1" } resource_group_key = "ioth_region1" - certificate_content = "iot/103-iot-hub-with-dps/cert.pem" + certificate_content = "examples/iot/103-iot-hub-with-dps/cert.pem" } } From 2243907ebf5b181b78f2f3464b2e0e76f67faaca Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Tue, 28 May 2024 07:07:14 +0000 Subject: [PATCH 10/19] Update azurerm_servicebus_namespace --- .../101-adt-servicebus/configuration.tfvars | 3 ++- .../messaging/servicebus/namespace/namespace.tf | 15 ++++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/digital_twins/101-adt-servicebus/configuration.tfvars b/examples/digital_twins/101-adt-servicebus/configuration.tfvars index 94209583e9..de91dda74c 100644 --- a/examples/digital_twins/101-adt-servicebus/configuration.tfvars +++ b/examples/digital_twins/101-adt-servicebus/configuration.tfvars @@ -1,7 +1,7 @@ global_settings = { default_region = "region1" regions = { - region1 = "southeastasia" + region1 = "australiaeast" } } @@ -106,6 +106,7 @@ servicebus_namespaces = { sku = "Premium" # Basic | standard | Premium capacity = 1 # capacity only for Premium: 1,2,4,8,16 otherwise 0 # zone_redundant = false # only true for Premium + premium_messaging_partitions = 1 # tags = {} # optional namespace_auth_rules = { rule1 = { diff --git a/modules/messaging/servicebus/namespace/namespace.tf b/modules/messaging/servicebus/namespace/namespace.tf index 7a6094806e..6161f55de5 100644 --- a/modules/messaging/servicebus/namespace/namespace.tf +++ b/modules/messaging/servicebus/namespace/namespace.tf @@ -11,11 +11,12 @@ resource "azurecaf_name" "namespace" { } resource "azurerm_servicebus_namespace" "namespace" { - name = azurecaf_name.namespace.result - sku = var.settings.sku - capacity = try(var.settings.capacity, null) - zone_redundant = try(var.settings.zone_redundant, null) - tags = merge(local.base_tags, try(var.settings.tags, {})) - location = local.location - resource_group_name = local.resource_group_name + name = azurecaf_name.namespace.result + sku = var.settings.sku + capacity = try(var.settings.capacity, null) + zone_redundant = try(var.settings.zone_redundant, null) + tags = merge(local.base_tags, try(var.settings.tags, {})) + premium_messaging_partitions = try(var.settings.premium_messaging_partitions, null) + location = local.location + resource_group_name = local.resource_group_name } From 8bbcc42b0aee44e05920a4d8c671bc006485a440 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Tue, 28 May 2024 08:22:00 +0000 Subject: [PATCH 11/19] Tflint warning (List items should be accessed using square brackets) --- azuread_users.tf | 2 +- compute_virtual_machines.tf | 3 ++- compute_virtual_machines_scale_sets.tf | 3 ++- locals.tf | 6 +++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/azuread_users.tf b/azuread_users.tf index f75e57cc13..ac8d3d4860 100644 --- a/azuread_users.tf +++ b/azuread_users.tf @@ -4,7 +4,7 @@ module "azuread_users" { source = "./modules/azuread/users" - depends_on = [module.keyvault_access_policies, time_sleep.azurerm_role_assignment_for.0] + depends_on = [module.keyvault_access_policies, time_sleep.azurerm_role_assignment_for[0]] for_each = local.azuread.azuread_users client_config = local.client_config diff --git a/compute_virtual_machines.tf b/compute_virtual_machines.tf index 9e4f1bd07d..87f8344c28 100644 --- a/compute_virtual_machines.tf +++ b/compute_virtual_machines.tf @@ -12,7 +12,8 @@ module "virtual_machines" { module.packer_service_principal, module.proximity_placement_groups, module.storage_account_blobs, - time_sleep.azurerm_role_assignment_for.0 + time_sleep.azurerm_role_assignment_for[0] + ] ] for_each = local.compute.virtual_machines diff --git a/compute_virtual_machines_scale_sets.tf b/compute_virtual_machines_scale_sets.tf index 574860dc77..187282bf51 100644 --- a/compute_virtual_machines_scale_sets.tf +++ b/compute_virtual_machines_scale_sets.tf @@ -13,7 +13,8 @@ module "virtual_machine_scale_sets" { module.packer_build, module.packer_service_principal, module.proximity_placement_groups, - time_sleep.azurerm_role_assignment_for.0 + time_sleep.azurerm_role_assignment_for[0] + ] ] for_each = local.compute.virtual_machine_scale_sets diff --git a/locals.tf b/locals.tf index 9d0d3f8179..f6038e943f 100644 --- a/locals.tf +++ b/locals.tf @@ -225,8 +225,8 @@ locals { inherit_tags = try(var.global_settings.inherit_tags, false) passthrough = try(var.global_settings.passthrough, false) prefix = try(var.global_settings.prefix, null) - prefix_with_hyphen = try(var.global_settings.prefix_with_hyphen, format("%s-", try(var.global_settings.prefix, try(var.global_settings.prefixes[0], random_string.prefix.0.result)))) - prefixes = try(var.global_settings.prefix, null) == "" ? null : try([var.global_settings.prefix], try(var.global_settings.prefixes, [random_string.prefix.0.result])) + prefix_with_hyphen = try(var.global_settings.prefix_with_hyphen, format("%s-", try(var.global_settings.prefix, try(var.global_settings.prefixes[0], random_string.prefix[0].result)))) + prefixes = try(var.global_settings.prefix, null) == "" ? null : try([var.global_settings.prefix], try(var.global_settings.prefixes, [random_string.prefix[0].result])) random_length = try(var.global_settings.random_length, 0) regions = try(var.global_settings.regions, null) tags = try(var.global_settings.tags, null) @@ -347,7 +347,7 @@ locals { vpn_sites = try(var.networking.vpn_sites, {}) } - object_id = coalesce(var.logged_user_objectId, var.logged_aad_app_objectId, try(data.azuread_client_config.current.object_id, null), try(data.azuread_service_principal.logged_in_app.0.object_id, null)) + object_id = coalesce(var.logged_user_objectId, var.logged_aad_app_objectId, try(data.azuread_client_config.current.object_id, null), try(data.azuread_service_principal.logged_in_app[0].object_id, null)) security = { disk_encryption_sets = try(var.security.disk_encryption_sets, {}) From 90b76bcef9e1dc8a8a903be2659e32448da2fa92 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Tue, 28 May 2024 08:25:13 +0000 Subject: [PATCH 12/19] Extra char --- compute_virtual_machines.tf | 2 +- compute_virtual_machines_scale_sets.tf | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/compute_virtual_machines.tf b/compute_virtual_machines.tf index 87f8344c28..4152a9ecb0 100644 --- a/compute_virtual_machines.tf +++ b/compute_virtual_machines.tf @@ -14,7 +14,7 @@ module "virtual_machines" { module.storage_account_blobs, time_sleep.azurerm_role_assignment_for[0] ] - ] + for_each = local.compute.virtual_machines application_security_groups = local.combined_objects_application_security_groups diff --git a/compute_virtual_machines_scale_sets.tf b/compute_virtual_machines_scale_sets.tf index 187282bf51..175e213d33 100644 --- a/compute_virtual_machines_scale_sets.tf +++ b/compute_virtual_machines_scale_sets.tf @@ -15,7 +15,7 @@ module "virtual_machine_scale_sets" { module.proximity_placement_groups, time_sleep.azurerm_role_assignment_for[0] ] - ] + for_each = local.compute.virtual_machine_scale_sets availability_sets = local.combined_objects_availability_sets From e5810dbe3dd2c2ac2643261f24187ffb832ec900 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Tue, 28 May 2024 08:36:09 +0000 Subject: [PATCH 13/19] Tflint (Lookup with 2 arguments is deprecated (terraform_deprecated_lookup) --- machine_learning.tf | 6 +++--- shared_image_gallery.tf | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/machine_learning.tf b/machine_learning.tf index 18011d51ee..60ab47e2e4 100644 --- a/machine_learning.tf +++ b/machine_learning.tf @@ -7,9 +7,9 @@ module "machine_learning_workspaces" { global_settings = local.global_settings settings = each.value vnets = local.combined_objects_networking - storage_account_id = lookup(each.value, "storage_account_key") == null ? null : module.storage_accounts[each.value.storage_account_key].id - keyvault_id = lookup(each.value, "keyvault_key") == null ? null : module.keyvaults[each.value.keyvault_key].id - application_insights_id = lookup(each.value, "application_insights_key") == null ? null : module.azurerm_application_insights[each.value.application_insights_key].id + storage_account_id = lookup(each.value, "storage_account_key", null) == null ? null : module.storage_accounts[lookup(each.value, "storage_account_key")].id + keyvault_id = lookup(each.value, "keyvault_key", null) == null ? null : module.keyvaults[lookup(each.value, "keyvault_key")].id + application_insights_id = lookup(each.value, "application_insights_key", null) == null ? null : module.azurerm_application_insights[lookup(each.value, "application_insights_key")].id container_registry_id = can(each.value.container_registry_id) || can(each.value.container_registry_key) == false ? try(each.value.container_registry_id, null) : local.combined_objects_container_registry[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.container_registry_key].id base_tags = try(local.global_settings.inherit_tags, false) ? try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group.key, each.value.resource_group_key)].tags, {}) : {} diff --git a/shared_image_gallery.tf b/shared_image_gallery.tf index fe702a858f..9c8afaa8a8 100644 --- a/shared_image_gallery.tf +++ b/shared_image_gallery.tf @@ -44,7 +44,7 @@ module "packer_service_principal" { tenant_id = data.azurerm_client_config.current.tenant_id gallery_name = module.shared_image_galleries[each.value.shared_image_gallery_destination.gallery_key].name image_name = module.image_definitions[each.value.shared_image_gallery_destination.image_key].name - key_vault_id = lookup(each.value, "keyvault_key") == null ? null : module.keyvaults[each.value.keyvault_key].id + key_vault_id = lookup(each.value, "keyvault_key", null) == null ? null : module.keyvaults[each.value.keyvault_key].id settings = each.value depends_on = [ @@ -67,7 +67,7 @@ module "packer_build" { tenant_id = data.azurerm_client_config.current.tenant_id gallery_name = module.shared_image_galleries[each.value.shared_image_gallery_destination.gallery_key].name image_name = module.image_definitions[each.value.shared_image_gallery_destination.image_key].name - key_vault_id = lookup(each.value, "keyvault_key") == null ? null : module.keyvaults[each.value.keyvault_key].id + key_vault_id = each.value.keyvault_key == null ? null : module.keyvaults[each.value.keyvault_key].id managed_identities = local.combined_objects_managed_identities vnet_name = try(try(local.combined_objects_networking[each.value.lz_key][each.value.vnet_key].name, local.combined_objects_networking[local.client_config.landingzone_key][each.value.vnet_key].name), "") subnet_name = try(lookup(each.value, "lz_key", null) == null ? local.combined_objects_networking[local.client_config.landingzone_key][each.value.vnet_key].subnets[each.value.subnet_key].name : local.combined_objects_networking[each.value.lz_key][each.value.vnet_key].subnets[each.value.subnet_key].name, "") From 13a0b2f9491e78381b81b708340df2a38c08a754 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Wed, 29 May 2024 00:53:17 +0000 Subject: [PATCH 14/19] Simplify expression --- machine_learning.tf | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/machine_learning.tf b/machine_learning.tf index 60ab47e2e4..589e4bfe64 100644 --- a/machine_learning.tf +++ b/machine_learning.tf @@ -7,9 +7,9 @@ module "machine_learning_workspaces" { global_settings = local.global_settings settings = each.value vnets = local.combined_objects_networking - storage_account_id = lookup(each.value, "storage_account_key", null) == null ? null : module.storage_accounts[lookup(each.value, "storage_account_key")].id - keyvault_id = lookup(each.value, "keyvault_key", null) == null ? null : module.keyvaults[lookup(each.value, "keyvault_key")].id - application_insights_id = lookup(each.value, "application_insights_key", null) == null ? null : module.azurerm_application_insights[lookup(each.value, "application_insights_key")].id + storage_account_id = can(each.value.storage_account_key) ? try(module.storage_accounts[each.value.storage_account_key].id, null) : null + keyvault_id = can(each.value.keyvault_key) ? try(module.keyvaults[each.value.keyvault_key].id, null) : null + application_insights_id = can(each.value.application_insights_key) ? try(module.azurerm_application_insights[each.value.application_insights_key].id, null) : null container_registry_id = can(each.value.container_registry_id) || can(each.value.container_registry_key) == false ? try(each.value.container_registry_id, null) : local.combined_objects_container_registry[try(each.value.lz_key, local.client_config.landingzone_key)][each.value.container_registry_key].id base_tags = try(local.global_settings.inherit_tags, false) ? try(local.combined_objects_resource_groups[try(each.value.resource_group.lz_key, local.client_config.landingzone_key)][try(each.value.resource_group.key, each.value.resource_group_key)].tags, {}) : {} From 370d3dad91ef951136ee3d961cdb8a30957db7ed Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Wed, 29 May 2024 01:49:18 +0000 Subject: [PATCH 15/19] Additional mock data sources --- examples/tests/mock_data/data.tfmock.hcl | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/examples/tests/mock_data/data.tfmock.hcl b/examples/tests/mock_data/data.tfmock.hcl index b29c7c3f4d..09746fff75 100644 --- a/examples/tests/mock_data/data.tfmock.hcl +++ b/examples/tests/mock_data/data.tfmock.hcl @@ -14,4 +14,22 @@ mock_data "azuread_client_config" { subscription_id = "00000000-0000-0000-0000-000000000000" tenant_id = "00000000-0000-0000-0000-000000000000" } +} + +mock_data "azurerm_subscription" { + defaults = { + id = "/subscriptions/00000000-0000-0000-0000-000000000001" + subscription_id = "00000000-0000-0000-0000-000000000001" + display_name = "mock_subscription" + tenant_id = "00000000-0000-0000-0000-000000000000" + } +} + +mock_data "azuread_service_principal" { + defaults = { + client_id = "00000000-0000-0000-0000-000000000000" + application_id = "00000000-0000-0000-0000-000000000000" + display_name = "mock_service_principal" + object_id = "00000000-0000-0000-0000-000000000000" + } } \ No newline at end of file From 5707eec10701285f386ffc96a74e2a23cdffdd98 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Sun, 2 Jun 2024 18:49:48 -0700 Subject: [PATCH 16/19] Simplify workflows --- .../{pr_dispatch.yaml => pr_lint.yaml} | 25 +-- .github/workflows/pr_tests-azuread.yaml | 95 +++++++++++ .github/workflows/pr_tests-compute.yaml | 95 +++++++++++ .github/workflows/pr_tests-dataplat.yaml | 101 +++++++++++ .github/workflows/pr_tests-networking.yaml | 95 +++++++++++ .github/workflows/pr_tests-scenarios.yaml | 91 ++++++++++ ...s-azuread.json => standalone-azuread.json} | 0 .github/workflows/standalone-compute.json | 5 +- .github/workflows/standalone-compute.yaml | 152 ----------------- .github/workflows/standalone-dataplat.json | 76 +++++++++ .github/workflows/standalone-networking.json | 15 +- .github/workflows/standalone-networking.yaml | 152 ----------------- .../workflows/standalone-regressor-tf100.yaml | 3 +- .../standalone-scenarios-additional.json | 5 - .../standalone-scenarios-longrunners.json | 41 ----- .github/workflows/standalone-scenarios.json | 109 ++++-------- .github/workflows/standalone-tf100.yaml | 161 ------------------ .github/workflows/weekly_dispatch.yaml | 34 ++++ ...{pr_workflow.yaml => weekly_workflow.yaml} | 23 ++- 19 files changed, 648 insertions(+), 630 deletions(-) rename .github/workflows/{pr_dispatch.yaml => pr_lint.yaml} (58%) create mode 100644 .github/workflows/pr_tests-azuread.yaml create mode 100644 .github/workflows/pr_tests-compute.yaml create mode 100644 .github/workflows/pr_tests-dataplat.yaml create mode 100644 .github/workflows/pr_tests-networking.yaml create mode 100644 .github/workflows/pr_tests-scenarios.yaml rename .github/workflows/{standalone-scenarios-azuread.json => standalone-azuread.json} (100%) delete mode 100644 .github/workflows/standalone-compute.yaml create mode 100644 .github/workflows/standalone-dataplat.json delete mode 100644 .github/workflows/standalone-networking.yaml delete mode 100644 .github/workflows/standalone-scenarios-longrunners.json delete mode 100644 .github/workflows/standalone-tf100.yaml create mode 100644 .github/workflows/weekly_dispatch.yaml rename .github/workflows/{pr_workflow.yaml => weekly_workflow.yaml} (97%) diff --git a/.github/workflows/pr_dispatch.yaml b/.github/workflows/pr_lint.yaml similarity index 58% rename from .github/workflows/pr_dispatch.yaml rename to .github/workflows/pr_lint.yaml index f478bd51ff..8e0d16a3d4 100644 --- a/.github/workflows/pr_dispatch.yaml +++ b/.github/workflows/pr_lint.yaml @@ -3,7 +3,7 @@ # Licensed under the MIT License. # -name: PR Dispatch Workflow +name: PR Tflint on: pull_request: @@ -12,6 +12,7 @@ on: env: TF_VERSION: "1.8.4" TF_LINT_VERSION: "v0.50.3" + jobs: linting: name: Format and Lint Checks @@ -35,30 +36,10 @@ jobs: with: tflint_version: ${{ env.TF_LINT_VERSION }} - - name: Run TFLint with reviewdog uses: reviewdog/action-tflint@v1 with: github_token: ${{ secrets.GITHUB_TOKEN }} reporter: github-pr-check level: info - tflint_init: true - - dispatch: - runs-on: ubuntu-latest - strategy: - matrix: - scenario: - - standalone-scenarios-azuread.json - - standalone-scenarios.json - - standalone-compute.json - - standalone-networking.json - - standalone-scenarios-longrunners.json - - steps: - - name: Repository Dispatch - uses: peter-evans/repository-dispatch@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - event-type: pr-${{ matrix.scenario }} - client-payload: '{"scenario": "${{ (matrix.scenario) }}", "sha": "${{ github.event.pull_request.head.sha }}"}' + tflint_init: true \ No newline at end of file diff --git a/.github/workflows/pr_tests-azuread.yaml b/.github/workflows/pr_tests-azuread.yaml new file mode 100644 index 0000000000..60640e52ae --- /dev/null +++ b/.github/workflows/pr_tests-azuread.yaml @@ -0,0 +1,95 @@ +# +# Copyright (c) Microsoft Corporation +# Licensed under the MIT License. +# + +name: PR azuread-tests + +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + - 'azuread*' + - 'modules/azuread/**' + - 'examples/azuread/**' + - '.github/workflows/*azuread.*' + +env: + scenario: standalone-azuread.json + TF_VERSION: "1.8.4" + TF_LINT_VERSION: "v0.50.3" + +jobs: + load_scenarios: + name: Load Test Scenarios Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load_scenarios.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + - id: load_scenarios + run: | + cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) + echo "matrix=${cases}" >> $GITHUB_OUTPUT + + mock_plan_scenarios: + name: ${{ matrix.config_files }} + runs-on: ubuntu-latest + needs: load_scenarios + + strategy: + fail-fast: false + matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create environment variables + run: | + cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} + FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) + echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV + echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV + echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV + echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ env.TF_VERSION }} + + - name: Configure Terraform plugin cache + run: | + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" + mkdir --parents "$HOME/.terraform.d/plugin-cache" + + - name: Cache Terraform + uses: actions/cache@v4 + with: + path: | + ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} + restore-keys: | + ${{ runner.os }}-terraform- + + - name: Terraform Init example + id: tf_init + run: | + terraform -chdir=examples \ + init + + - name: Terraform Test example + id: tf_test + run: | + terraform -chdir=examples \ + test \ + -test-directory=./tests/mock \ + ${{ env.PARAMETER_FILES }} \ + -verbose \ No newline at end of file diff --git a/.github/workflows/pr_tests-compute.yaml b/.github/workflows/pr_tests-compute.yaml new file mode 100644 index 0000000000..993d2269a0 --- /dev/null +++ b/.github/workflows/pr_tests-compute.yaml @@ -0,0 +1,95 @@ +# +# Copyright (c) Microsoft Corporation +# Licensed under the MIT License. +# + +name: PR compute-tests + +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + - 'compute_*' + - 'modules/compute/**' + - 'examples/compute/**' + - '.github/workflows/*compute.*' + +env: + scenario: standalone-compute.json + TF_VERSION: "1.8.4" + TF_LINT_VERSION: "v0.50.3" + +jobs: + load_scenarios: + name: Load Test Scenarios Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load_scenarios.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + - id: load_scenarios + run: | + cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) + echo "matrix=${cases}" >> $GITHUB_OUTPUT + + mock_plan_scenarios: + name: ${{ matrix.config_files }} + runs-on: ubuntu-latest + needs: load_scenarios + + strategy: + fail-fast: false + matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create environment variables + run: | + cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} + FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) + echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV + echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV + echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV + echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ env.TF_VERSION }} + + - name: Configure Terraform plugin cache + run: | + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" + mkdir --parents "$HOME/.terraform.d/plugin-cache" + + - name: Cache Terraform + uses: actions/cache@v4 + with: + path: | + ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} + restore-keys: | + ${{ runner.os }}-terraform- + + - name: Terraform Init example + id: tf_init + run: | + terraform -chdir=examples \ + init + + - name: Terraform Test example + id: tf_test + run: | + terraform -chdir=examples \ + test \ + -test-directory=./tests/mock \ + ${{ env.PARAMETER_FILES }} \ + -verbose \ No newline at end of file diff --git a/.github/workflows/pr_tests-dataplat.yaml b/.github/workflows/pr_tests-dataplat.yaml new file mode 100644 index 0000000000..5aaabd1a60 --- /dev/null +++ b/.github/workflows/pr_tests-dataplat.yaml @@ -0,0 +1,101 @@ +# +# Copyright (c) Microsoft Corporation +# Licensed under the MIT License. +# + +name: PR dataplat-tests + +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + - 'mssql*' + - 'modules/analytics/**' + - 'modules/databases/**' + - 'modules/data_factory/**' + - 'modules/purview/**' + - 'examples/analytics/**' + - 'examples/databases/**' + - 'examples/data_factory/**' + - 'examples/purview/**' + - '.github/workflows/*dataplat.*' + +env: + scenario: standalone-dataplat.json + TF_VERSION: "1.8.4" + TF_LINT_VERSION: "v0.50.3" + +jobs: + load_scenarios: + name: Load Test Scenarios Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load_scenarios.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + - id: load_scenarios + run: | + cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) + echo "matrix=${cases}" >> $GITHUB_OUTPUT + + mock_plan_scenarios: + name: ${{ matrix.config_files }} + runs-on: ubuntu-latest + needs: load_scenarios + + strategy: + fail-fast: false + matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create environment variables + run: | + cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} + FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) + echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV + echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV + echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV + echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ env.TF_VERSION }} + + - name: Configure Terraform plugin cache + run: | + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" + mkdir --parents "$HOME/.terraform.d/plugin-cache" + + - name: Cache Terraform + uses: actions/cache@v4 + with: + path: | + ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} + restore-keys: | + ${{ runner.os }}-terraform- + + - name: Terraform Init example + id: tf_init + run: | + terraform -chdir=examples \ + init + + - name: Terraform Test example + id: tf_test + run: | + terraform -chdir=examples \ + test \ + -test-directory=./tests/mock \ + ${{ env.PARAMETER_FILES }} \ + -verbose \ No newline at end of file diff --git a/.github/workflows/pr_tests-networking.yaml b/.github/workflows/pr_tests-networking.yaml new file mode 100644 index 0000000000..24a07e0855 --- /dev/null +++ b/.github/workflows/pr_tests-networking.yaml @@ -0,0 +1,95 @@ +# +# Copyright (c) Microsoft Corporation +# Licensed under the MIT License. +# + +name: PR networking-tests + +on: + pull_request: + types: [opened, synchronize, reopened] + paths: + - 'network*' + - 'modules/networking/**' + - 'examples/networking/**' + - '.github/workflows/*networking.*' + +env: + scenario: standalone-networking.json + TF_VERSION: "1.8.4" + TF_LINT_VERSION: "v0.50.3" + +jobs: + load_scenarios: + name: Load Test Scenarios Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load_scenarios.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + - id: load_scenarios + run: | + cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) + echo "matrix=${cases}" >> $GITHUB_OUTPUT + + mock_plan_scenarios: + name: ${{ matrix.config_files }} + runs-on: ubuntu-latest + needs: load_scenarios + + strategy: + fail-fast: false + matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create environment variables + run: | + cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} + FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) + echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV + echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV + echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV + echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ env.TF_VERSION }} + + - name: Configure Terraform plugin cache + run: | + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" + mkdir --parents "$HOME/.terraform.d/plugin-cache" + + - name: Cache Terraform + uses: actions/cache@v4 + with: + path: | + ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} + restore-keys: | + ${{ runner.os }}-terraform- + + - name: Terraform Init example + id: tf_init + run: | + terraform -chdir=examples \ + init + + - name: Terraform Test example + id: tf_test + run: | + terraform -chdir=examples \ + test \ + -test-directory=./tests/mock \ + ${{ env.PARAMETER_FILES }} \ + -verbose \ No newline at end of file diff --git a/.github/workflows/pr_tests-scenarios.yaml b/.github/workflows/pr_tests-scenarios.yaml new file mode 100644 index 0000000000..8bd8c90965 --- /dev/null +++ b/.github/workflows/pr_tests-scenarios.yaml @@ -0,0 +1,91 @@ +# +# Copyright (c) Microsoft Corporation +# Licensed under the MIT License. +# + +name: PR all-tests + +on: + pull_request: + types: [opened, synchronize, reopened] + +env: + scenario: standalone-scenarios.json + TF_VERSION: "1.8.4" + TF_LINT_VERSION: "v0.50.3" + +jobs: + load_scenarios: + name: Load Test Scenarios Matrix + runs-on: ubuntu-latest + outputs: + matrix: ${{ steps.load_scenarios.outputs.matrix }} + steps: + - uses: actions/checkout@v4 + + + - id: load_scenarios + run: | + cases=$(cat ./.github/workflows/${{ env.SCENARIO }} | jq -c .) + echo "matrix=${cases}" >> $GITHUB_OUTPUT + + mock_plan_scenarios: + name: ${{ matrix.config_files }} + runs-on: ubuntu-latest + needs: load_scenarios + + strategy: + fail-fast: false + matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Create environment variables + run: | + cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} + FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) + echo STATE_FILE=${HOME}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV + echo PLAN_FILE=${HOME}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV + echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV + echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV + + - name: Install Node + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install Terraform + uses: hashicorp/setup-terraform@v3 + with: + terraform_version: ${{ env.TF_VERSION }} + + - name: Configure Terraform plugin cache + run: | + echo "TF_PLUGIN_CACHE_DIR=$HOME/.terraform.d/plugin-cache" >>"$GITHUB_ENV" + mkdir --parents "$HOME/.terraform.d/plugin-cache" + + - name: Cache Terraform + uses: actions/cache@v4 + with: + path: | + ~/.terraform.d/plugin-cache + key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} + restore-keys: | + ${{ runner.os }}-terraform- + + - name: Terraform Init example + id: tf_init + run: | + terraform -chdir=examples \ + init + + - name: Terraform Test example + id: tf_test + run: | + terraform -chdir=examples \ + test \ + -test-directory=./tests/mock \ + ${{ env.PARAMETER_FILES }} \ + -verbose \ No newline at end of file diff --git a/.github/workflows/standalone-scenarios-azuread.json b/.github/workflows/standalone-azuread.json similarity index 100% rename from .github/workflows/standalone-scenarios-azuread.json rename to .github/workflows/standalone-azuread.json diff --git a/.github/workflows/standalone-compute.json b/.github/workflows/standalone-compute.json index 0ef269d56b..a1effb7e50 100644 --- a/.github/workflows/standalone-compute.json +++ b/.github/workflows/standalone-compute.json @@ -2,9 +2,9 @@ "config_files": [ "compute/availability_set/100-simple-availabilityset", "compute/availability_set/101-availabilityset-with-proximity-placement-group", - "compute/azure_virtual_desktop/wvd_resources", "compute/azure_redhat_openshift/101_basic_private_cluster", "compute/azure_redhat_openshift/102_basic_public_cluster", + "compute/azure_virtual_desktop/wvd_resources", "compute/batch/batch_account/100-batch-account-storage", "compute/batch/batch_account/100-batch-account", "compute/batch/batch_account/200-batch-account-private-endpoint", @@ -49,6 +49,7 @@ "compute/virtual_machine/214-vm-generic_extensions_complex", "compute/virtual_machine/215-vm-keyvault-for-windows-extension", "compute/virtual_machine/216-vm-linux_diagnostic_extensions", - "compute/virtual_machine/217-vm-disk-encryption-set-msi" + "compute/virtual_machine/217-vm-disk-encryption-set-msi", + "compute/vmware_cluster/101-vmware_cluster" ] } diff --git a/.github/workflows/standalone-compute.yaml b/.github/workflows/standalone-compute.yaml deleted file mode 100644 index 17696aa0e1..0000000000 --- a/.github/workflows/standalone-compute.yaml +++ /dev/null @@ -1,152 +0,0 @@ -# -# Copyright (c) Microsoft Corporation -# Licensed under the MIT License. -# - -name: standalone-compute - -on: - push: - paths: - - 'compute_*' - - 'modules/compute/**' - - 'examples/compute/**' - - '.github/workflows/*compute.*' - -env: - TF_CLI_ARGS: "-no-color" - TF_CLI_ARGS_destroy: "-auto-approve -refresh=false" - ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} - ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} - ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} - ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} - TF_REGISTRY_DISCOVERY_RETRY: 5 - TF_REGISTRY_CLIENT_TIMEOUT: 15 - ROVER_RUNNER: true - -jobs: - load_scenarios: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.load_scenarios.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - id: load_scenarios - run: | - cases=$(cat ./.github/workflows/standalone-compute.json | jq -c .) - echo "matrix=${cases}" >> $GITHUB_OUTPUT - - testcases: - name: test - runs-on: ubuntu-latest - needs: load_scenarios - - strategy: - fail-fast: false - matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} - - container: - image: aztfmod/rover:1.8.4-2405.2306 - options: --user 0 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create environment variables - run: | - cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} - FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) - echo STATE_FILE=${TF_DATA_DIR}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV - echo PLAN_FILE=${TF_DATA_DIR}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV - echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV - echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV - - - name: Login azure - run: | - az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}' - az account set -s ${{ env.ARM_SUBSCRIPTION_ID }} - - - name: Terraform Init example - id: tf_init - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - init -upgrade=true | grep -P '^- (?=Downloading|Using|Finding|Installing)|^[^-]' - - - name: Terraform Plan example - id: tf_plan - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - plan \ - ${{ env.PARAMETER_FILES }} \ - -var tags='{testing_job_id='"${{ github.run_id }}"'}' \ - -var var_folder_path=${{ env.CURRENT_FOLDER }} \ - -refresh=true \ - -input=false \ - -state=${{ env.STATE_FILE }} \ - -out=${{ env.PLAN_FILE }} - - - name: Terraform Apply example - id: tf_apply - if: steps.tf_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - apply \ - -parallelism=30 \ - -state=${{ env.STATE_FILE }} \ - ${{ env.PLAN_FILE }} - - - name: Terraform Destroy planning example - id: tf_destroy_plan - if: steps.tf_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - plan \ - ${{ env.PARAMETER_FILES }} \ - -var tags='{testing_job_id='"${{ github.run_id }}"'}' \ - -var var_folder_path=${{ env.CURRENT_FOLDER }} \ - -refresh=true \ - -input=false \ - -destroy \ - -state=${{ env.STATE_FILE }} \ - -out=${{ env.PLAN_FILE }}-destroy - - - name: Terraform Destroy apply example - id: tf_destroy_apply - if: steps.tf_destroy_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - apply \ - -refresh=false \ - -parallelism=30 \ - -auto-approve \ - -state=${{ env.STATE_FILE }} \ - ${{ env.PLAN_FILE }}-destroy - - purge: - name: purge - runs-on: ubuntu-latest - if: ${{ failure() || cancelled() }} - - needs: [testcases] - - container: - image: aztfmod/rover:1.8.4-2405.2306 - options: --user 0 - - steps: - - name: Login azure - run: | - az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}' - az account set -s ${{ env.ARM_SUBSCRIPTION_ID }} - - - name: Complete purge - run: | - for i in `az monitor diagnostic-settings subscription list -o tsv --query "value[?contains(name, '${{ github.run_id }}' )].name"`; do echo "purging subscription diagnostic-settings: $i" && $(az monitor diagnostic-settings subscription delete --name $i --yes); done - for i in `az monitor log-profiles list -o tsv --query '[].name'`; do az monitor log-profiles delete --name $i; done - for i in `az ad group list --query "[?contains(displayName, '${{ github.run_id }}')].id" -o tsv`; do echo "purging Azure AD group: $i" && $(az ad group delete --verbose --group $i || true); done - for i in `az ad app list --query "[?contains(displayName, '${{ github.run_id }}')].appId" -o tsv`; do echo "purging Azure AD app: $i" && $(az ad app delete --verbose --id $i || true); done - for i in `az keyvault list-deleted --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do az keyvault purge --name $i; done - for i in `az group list --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do echo "purging resource group: $i" && $(az group delete -n $i -y --no-wait || true); done - for i in `az role assignment list --query "[?contains(roleDefinitionName, '${{ github.run_id }}')].roleDefinitionName" -o tsv`; do echo "purging role assignment: $i" && $(az role assignment delete --role $i || true); done - for i in `az role definition list --query "[?contains(roleName, '${{ github.run_id }}')].roleName" -o tsv`; do echo "purging custom role definition: $i" && $(az role definition delete --name $i || true); done diff --git a/.github/workflows/standalone-dataplat.json b/.github/workflows/standalone-dataplat.json new file mode 100644 index 0000000000..1a1a565a55 --- /dev/null +++ b/.github/workflows/standalone-dataplat.json @@ -0,0 +1,76 @@ +{ + "config_files": [ + "cosmos_db/100-cosmos-db-sql-role-mapping", + "cosmos_db/100-simple-cosmos-db-cassandra", + "cosmos_db/100-simple-cosmos-db-gremlin", + "cosmos_db/100-simple-cosmos-db-mongo", + "cosmos_db/100-simple-cosmos-db-sql", + "cosmos_db/100-simple-cosmos-db-table", + "cosmos_db/101-decomposed-cosmosdb-sql", + "cosmos_db/101-private-endpoint-cosmos-db", + "data_explorer/101-kusto_clusters_basic", + "data_explorer/102-kusto_clusters_vnet", + "data_explorer/103-kusto_clusters_identity", + "data_explorer/104-kusto_cluster_database", + "data_explorer/105-kusto_attached_database_configuration", + "data_explorer/106-database_principal_assignment", + "data_explorer/107-private-endpoint", + "data_factory/101-data_factory", + "data_factory/102-data_factory_pipeline", + "data_factory/103-data_factory_trigger_schedule", + "data_factory/104-data_factory_dataset_azure_blob", + "data_factory/105-data_factory_dataset_cosmosdb_sqlapi", + "data_factory/106-data_factory_dataset_delimited_text", + "data_factory/107-data_factory_dataset_http", + "data_factory/108-data_factory_dataset_json", + "data_factory/109-data_factory_dataset_mysql", + "data_factory/110-data_factory_dataset_postgresql", + "data_factory/111-data_factory_dataset_sql_server_table", + "data_factory/112-data_factory_integration_runtime_azure_ssis", + "data_factory/113-data_factory_integration_runtime_azure_ssis_mssql_server", + "data_factory/114-data_factory_integration_runtime_self_hosted", + "data_factory/115-data_factory_runtime_self_hoste_databricks", + "data_factory/116-data_factory_linked_service_azure_databricks", + "data_protection/100-backup-vault-blob-storage", + "data_protection/101-backup-vault-disk", + "database_migration_services/100-dms", + "databricks/100-standard-databricks-no-vnet", + "databricks/101-standard-databricks-vnet", + "databricks/102-premium-aml", + "databricks/102-premium-databricks-vnet-private-endpoint", + "datalake/101-datalake-storage", + "machine_learning/100-aml", + "machine_learning/101-aml-vnet", + "machine_learning/102-aml-compute_instance", + "mariadb_server/100-simple-mariadb", + "mariadb_server/101-vnet-rule-mariadb", + "mariadb_server/102-private-endpoint-mariadb", + "mariadb_server/103-private-endpoint-with-fw-rule-mariadb", + "mssql_mi/200-mi", + "mssql_server/101-sqlserver-simple", + "mssql_server/102-sqlserver-extend", + "mssql_server/104-sqlserver-elastic_pools", + "mssql_server/105-sqlserver-failover_groups", + "mssql_server/107-sqlserver-db-retention-policy", + "mssql_server/108-sqlserver-db-diagnostics", + "mssql_server/109-sqlserver-network-firewall-rule", + "mysql_flexible_server/100-simple-mysql-flexible", + "mysql_flexible_server/101-delegated-subnet-with-fw-rule", + "mysql_flexible_server/102-advanced-mysql-flexible", + "mysql_server/100-simple-mysql", + "mysql_server/101-vnet-rule-mysql", + "mysql_server/102-private-endpoint-mysql", + "mysql_server/103-private-endpoint-with-fw-rule-mysql", + "postgresql_flexible_server/100-simple-postgresql-flexible", + "postgresql_flexible_server/101-delegated-subnet-with-fw-rule", + "postgresql_flexible_server/102-advanced-postgresql-flexible", + "postgresql_flexible_server/104-private-endpoint", + "postgresql_server/100-simple-postgresql", + "postgresql_server/101-vnet-rule-postgresql", + "postgresql_server/102-private-endpoint-postgresql", + "postgresql_server/103-private-endpoint-with-fw-rule", + "powerbi_embedded/100-simple-powerbi", + "purview/100-purview_account", + "purview/101-purview_account_private_link" + ] +} diff --git a/.github/workflows/standalone-networking.json b/.github/workflows/standalone-networking.json index c1a3a787c9..0697afeee1 100644 --- a/.github/workflows/standalone-networking.json +++ b/.github/workflows/standalone-networking.json @@ -36,6 +36,10 @@ "networking/private_dns/100-private-dns-vnet-links", "networking/private_links/endpoints/centralized", "networking/private_links/endpoints/static_ip", + "networking/virtual_network_gateway/100-expressroute-gateway", + "networking/virtual_network_gateway/101-vpn-site-to-site", + "networking/virtual_network_gateway/102-vpn-site-to-site-active-active", + "networking/virtual_network_gateway/103-vpn-site-to-site-connection", "networking/virtual_network/100-import-rg", "networking/virtual_network/100-simple-vnet-subnets-nsgs", "networking/virtual_network/100-subnet-delegation", @@ -44,7 +48,16 @@ "networking/virtual_network/201-nsg-flow-logs-v1", "networking/virtual_subnets/100-simple-subnet-rbac", "networking/virtual_wan/100-vwan-multi-hubs", + "networking/virtual_wan/101-vwan-hub-firewall-legacy", + "networking/virtual_wan/102-vwan-hub-firewall-secured-vhub", + "networking/virtual_wan/102a-vwan-hub-firewall-secured-vhub-fw-mgr", + "networking/virtual_wan/103-vwan-hub-gw-legacy", + "networking/virtual_wan/104-vwan-hub-gw-spp", + "networking/virtual_wan/105-vwan-hub-route-table", "networking/virtual_wan/106-vwan-hub-routes", - "networking/virtual_wan/108-vwan-vpn-site" + "networking/virtual_wan/108-vwan-vpn-site", + "networking/virtual_wan/109-vwan-vpn-gateway-connection", + "networking/virtual_wan/110-vwan-hub-gw-p2s-keyvault-cert", + "networking/virtual_wan/111-vwan-vpn-gateway-connection-with-nat" ] } diff --git a/.github/workflows/standalone-networking.yaml b/.github/workflows/standalone-networking.yaml deleted file mode 100644 index 3ae0243874..0000000000 --- a/.github/workflows/standalone-networking.yaml +++ /dev/null @@ -1,152 +0,0 @@ -# -# Copyright (c) Microsoft Corporation -# Licensed under the MIT License. -# - -name: standalone-networking - -on: - push: - paths: - - 'network*' - - 'modules/networking/**' - - 'examples/networking/**' - - '.github/workflows/*networking.*' - -env: - TF_CLI_ARGS: "-no-color" - TF_CLI_ARGS_destroy: "-auto-approve -refresh=false" - ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} - ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} - ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} - ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} - TF_REGISTRY_DISCOVERY_RETRY: 5 - TF_REGISTRY_CLIENT_TIMEOUT: 15 - ROVER_RUNNER: true - -jobs: - load_scenarios: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.load_scenarios.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - id: load_scenarios - run: | - cases=$(cat ./.github/workflows/standalone-networking.json | jq -c .) - echo "matrix=${cases}" >> $GITHUB_OUTPUT - - testcases: - name: test - runs-on: ubuntu-latest - needs: load_scenarios - - strategy: - fail-fast: false - matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} - - container: - image: aztfmod/rover:1.8.4-2405.2306 - options: --user 0 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create environment variables - run: | - cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} - FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) - echo STATE_FILE=${TF_DATA_DIR}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV - echo PLAN_FILE=${TF_DATA_DIR}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV - echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV - echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV - - - name: Login azure - run: | - az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}' - az account set -s ${{ env.ARM_SUBSCRIPTION_ID }} - - - name: Terraform Init example - id: tf_init - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - init -upgrade=true | grep -P '^- (?=Downloading|Using|Finding|Installing)|^[^-]' - - - name: Terraform Plan example - id: tf_plan - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - plan \ - ${{ env.PARAMETER_FILES }} \ - -var tags='{testing_job_id='"${{ github.run_id }}"'}' \ - -var var_folder_path=${{ env.CURRENT_FOLDER }} \ - -refresh=true \ - -input=false \ - -state=${{ env.STATE_FILE }} \ - -out=${{ env.PLAN_FILE }} - - - name: Terraform Apply example - id: tf_apply - if: steps.tf_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - apply \ - -parallelism=30 \ - -state=${{ env.STATE_FILE }} \ - ${{ env.PLAN_FILE }} - - - name: Terraform Destroy planning example - id: tf_destroy_plan - if: steps.tf_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - plan \ - ${{ env.PARAMETER_FILES }} \ - -var tags='{testing_job_id='"${{ github.run_id }}"'}' \ - -var var_folder_path=${{ env.CURRENT_FOLDER }} \ - -refresh=true \ - -input=false \ - -destroy \ - -state=${{ env.STATE_FILE }} \ - -out=${{ env.PLAN_FILE }}-destroy - - - name: Terraform Destroy apply example - id: tf_destroy_apply - if: steps.tf_destroy_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - apply \ - -refresh=false \ - -parallelism=30 \ - -auto-approve \ - -state=${{ env.STATE_FILE }} \ - ${{ env.PLAN_FILE }}-destroy - - purge: - name: purge - runs-on: ubuntu-latest - if: ${{ failure() || cancelled() }} - - needs: [testcases] - - container: - image: aztfmod/rover:1.8.0-2405.0203 - options: --user 0 - - steps: - - name: Login azure - run: | - az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}' - az account set -s ${{ env.ARM_SUBSCRIPTION_ID }} - - - name: Complete purge - run: | - for i in `az monitor diagnostic-settings subscription list -o tsv --query "value[?contains(name, '${{ github.run_id }}' )].name"`; do echo "purging subscription diagnostic-settings: $i" && $(az monitor diagnostic-settings subscription delete --name $i --yes); done - for i in `az monitor log-profiles list -o tsv --query '[].name'`; do az monitor log-profiles delete --name $i; done - for i in `az ad group list --query "[?contains(displayName, '${{ github.run_id }}')].id" -o tsv`; do echo "purging Azure AD group: $i" && $(az ad group delete --verbose --group $i || true); done - for i in `az ad app list --query "[?contains(displayName, '${{ github.run_id }}')].appId" -o tsv`; do echo "purging Azure AD app: $i" && $(az ad app delete --verbose --id $i || true); done - for i in `az keyvault list-deleted --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do az keyvault purge --name $i; done - for i in `az group list --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do echo "purging resource group: $i" && $(az group delete -n $i -y --no-wait || true); done - for i in `az role assignment list --query "[?contains(roleDefinitionName, '${{ github.run_id }}')].roleDefinitionName" -o tsv`; do echo "purging role assignment: $i" && $(az role assignment delete --role $i || true); done - for i in `az role definition list --query "[?contains(roleName, '${{ github.run_id }}')].roleName" -o tsv`; do echo "purging custom role definition: $i" && $(az role definition delete --name $i || true); done diff --git a/.github/workflows/standalone-regressor-tf100.yaml b/.github/workflows/standalone-regressor-tf100.yaml index 22a66c6458..60bf4d639b 100644 --- a/.github/workflows/standalone-regressor-tf100.yaml +++ b/.github/workflows/standalone-regressor-tf100.yaml @@ -18,11 +18,10 @@ on: type: choice default: 'standalone-scenarios.json' options: - - standalone-scenarios-azuread.json + - standalone-azuread.json - standalone-scenarios.json - standalone-compute.json - standalone-networking.json - - standalone-scenarios-longrunners.json env: TF_CLI_ARGS: '-no-color' diff --git a/.github/workflows/standalone-scenarios-additional.json b/.github/workflows/standalone-scenarios-additional.json index 2e0450829d..5c141c24bd 100644 --- a/.github/workflows/standalone-scenarios-additional.json +++ b/.github/workflows/standalone-scenarios-additional.json @@ -14,11 +14,6 @@ "consumption_budget/105-consumption-budget-subscription-aks", "messaging/signalr/100-signalr-simple", "mssql_mi/200-mi-two-regions", - "networking/virtual_network_gateway/100-expressroute-gateway", - "networking/virtual_network_gateway/101-vpn-site-to-site", - "networking/virtual_network_gateway/102-vpn-site-to-site-active-active", - "networking/virtual_network_gateway/103-vpn-site-to-site-connection", - "networking/virtual_wan/100-vwan-multi-hubs", "networking/virtual_wan/101-vwan-hub-firewall-legacy", "networking/virtual_wan/102-vwan-hub-firewall-new", "networking/virtual_wan/103-vwan-hub-gw", diff --git a/.github/workflows/standalone-scenarios-longrunners.json b/.github/workflows/standalone-scenarios-longrunners.json deleted file mode 100644 index 5712cd8f61..0000000000 --- a/.github/workflows/standalone-scenarios-longrunners.json +++ /dev/null @@ -1,41 +0,0 @@ -{ - "config_files": [ - "apim/100-basic", - "apim/101-api", - "apim/102-diagnostics", - "apim/103-api_operations", - "apim/104-backend", - "apim/105-api_policy", - "apim/106-api_operation_tag", - "apim/107-api_operation_policy", - "apim/108-api_management_user", - "apim/110-api_management_diagnostic", - "apim/111-api_management_certificate", - "apim/112-api_management_gateway", - "apim/113-api_management_gateway_api", - "apim/114-api-management-group", - "apim/115-api_management_private_virtual_network", - "apim/116-api_management_subscription", - "apim/117-api_management_product", - "apim/118-api_management_platform_stv2", - "compute/vmware_cluster/101-vmware_cluster", - "mssql_mi/200-mi", - "networking/virtual_network_gateway/100-expressroute-gateway", - "networking/virtual_network_gateway/101-vpn-site-to-site", - "networking/virtual_network_gateway/102-vpn-site-to-site-active-active", - "networking/virtual_network_gateway/103-vpn-site-to-site-connection", - "networking/virtual_wan/101-vwan-hub-firewall-legacy", - "networking/virtual_wan/102-vwan-hub-firewall-secured-vhub", - "networking/virtual_wan/102a-vwan-hub-firewall-secured-vhub-fw-mgr", - "networking/virtual_wan/103-vwan-hub-gw-legacy", - "networking/virtual_wan/104-vwan-hub-gw-spp", - "networking/virtual_wan/105-vwan-hub-route-table", - "networking/virtual_wan/109-vwan-vpn-gateway-connection", - "networking/virtual_wan/110-vwan-hub-gw-p2s-keyvault-cert", - "networking/virtual_wan/111-vwan-vpn-gateway-connection-with-nat", - "redis_cache/100-redis-standard", - "redis_cache/101-redis-diagnostics", - "redis_cache/102-redis-private", - "webapps/appservice-environment/102-simple_asev3" - ] -} diff --git a/.github/workflows/standalone-scenarios.json b/.github/workflows/standalone-scenarios.json index a7f95055b5..c0e560b63d 100644 --- a/.github/workflows/standalone-scenarios.json +++ b/.github/workflows/standalone-scenarios.json @@ -1,5 +1,23 @@ { "config_files": [ + "apim/100-basic", + "apim/101-api", + "apim/102-diagnostics", + "apim/103-api_operations", + "apim/104-backend", + "apim/105-api_policy", + "apim/106-api_operation_tag", + "apim/107-api_operation_policy", + "apim/108-api_management_user", + "apim/110-api_management_diagnostic", + "apim/111-api_management_certificate", + "apim/112-api_management_gateway", + "apim/113-api_management_gateway_api", + "apim/114-api-management-group", + "apim/115-api_management_private_virtual_network", + "apim/116-api_management_subscription", + "apim/117-api_management_product", + "apim/118-api_management_platform_stv2", "app_config/100-simple", "app_config/101-private-link", "app_insights/100-all-attributes", @@ -12,69 +30,30 @@ "automation/103-automation-private-endpoints", "automation/104-automation-schedule-runbook", "communication/communication_services/101-communication_service", - "cosmos_db/100-simple-cosmos-db-cassandra", - "cosmos_db/100-simple-cosmos-db-gremlin", - "cosmos_db/100-simple-cosmos-db-mongo", - "cosmos_db/100-simple-cosmos-db-sql", - "cosmos_db/100-simple-cosmos-db-table", - "cosmos_db/100-cosmos-db-sql-role-mapping", - "cosmos_db/101-decomposed-cosmosdb-sql", - "cosmos_db/101-private-endpoint-cosmos-db", - "data_explorer/101-kusto_clusters_basic", - "data_explorer/102-kusto_clusters_vnet", - "data_explorer/103-kusto_clusters_identity", - "data_explorer/104-kusto_cluster_database", - "data_explorer/105-kusto_attached_database_configuration", - "data_explorer/106-database_principal_assignment", - "data_explorer/107-private-endpoint", - "data_factory/101-data_factory", - "data_factory/102-data_factory_pipeline", - "data_factory/103-data_factory_trigger_schedule", - "data_factory/104-data_factory_dataset_azure_blob", - "data_factory/105-data_factory_dataset_cosmosdb_sqlapi", - "data_factory/106-data_factory_dataset_delimited_text", - "data_factory/107-data_factory_dataset_http", - "data_factory/108-data_factory_dataset_json", - "data_factory/109-data_factory_dataset_mysql", - "data_factory/110-data_factory_dataset_postgresql", - "data_factory/111-data_factory_dataset_sql_server_table", - "data_factory/112-data_factory_integration_runtime_azure_ssis", - "data_factory/113-data_factory_integration_runtime_azure_ssis_mssql_server", - "data_factory/114-data_factory_integration_runtime_self_hosted", - "data_factory/115-data_factory_runtime_self_hoste_databricks", - "data_factory/116-data_factory_linked_service_azure_databricks", - "data_protection/100-backup-vault-blob-storage", - "data_protection/101-backup-vault-disk", - "database_migration_services/100-dms", - "databricks/100-standard-databricks-no-vnet", - "databricks/101-standard-databricks-vnet", - "databricks/102-premium-aml", - "databricks/102-premium-databricks-vnet-private-endpoint", - "datalake/101-datalake-storage", + "diagnostics_profiles/100-multiple-destinations", "diagnostics_profiles/100-multiple-destinations", "diagnostics_profiles/101-log-analytics-destination-type-profile", "diagnostics_profiles/200-diagnostics-eventhub-namespaces", + "diagnostics_profiles/200-diagnostics-eventhub-namespaces", + "diagnostics_profiles/201-multi-eventhub-diagnostics", "diagnostics_profiles/201-multi-eventhub-diagnostics", "digital_twins/100-basic", "digital_twins/101-adt-servicebus", "digital_twins/102-digital_twins_instance_eventhub", - "diagnostics_profiles/100-multiple-destinations", - "diagnostics_profiles/200-diagnostics-eventhub-namespaces", - "diagnostics_profiles/201-multi-eventhub-diagnostics", "eventhub/100-simple-eventhub-namespace", "eventhub/101-evh-namespace-with-private-endpoint", "eventhub/102-namespace-and-evh-with-auth-rules", "eventhub/103-eventhub-consumer-groups", "eventhub/104-namespace-and-evh-with-storage", - "keyvault/101-keyvault-policies", - "keyvault/102-keyvault-cert-issuer", - "keyvault/104-keyvault-dynamic-secret", - "keyvault/105-keyvault-dynamic-certificate", "iot/100-iot-hub", "iot/101-iot-hub-endpoints-and-file-upload", "iot/103-iot-hub-with-dps", "iot/110-iot-central-application", "iot/111-iot-security-solution", + "keyvault/101-keyvault-policies", + "keyvault/102-keyvault-cert-issuer", + "keyvault/104-keyvault-dynamic-secret", + "keyvault/105-keyvault-dynamic-certificate", "load_test/100-load-test", "logic_app/100-logic_app_workflow", "logic_app/102-logic_app_integration_account", @@ -84,19 +63,12 @@ "logic_app/106-logic_app_trigger_recurrence", "logic_app/107-logic_app_trigger_custom", "logic_app/109-logic_app_standard_vnet_integration", - "machine_learning/100-aml", - "machine_learning/101-aml-vnet", - "machine_learning/102-aml-compute_instance", "maintenance_configuration/100-maintenance-configuration", "maintenance_configuration/101-maintenance-configuration-schedule", "maintenance_configuration/200-maintenance-configuration-assignment-vm-windows", "maintenance_configuration/201-maintenance-configuration-assignment-vm-linux", - "maps/101-azure-maps-account", "managed_service_identity/100-msi-levels", - "mariadb_server/100-simple-mariadb", - "mariadb_server/101-vnet-rule-mariadb", - "mariadb_server/102-private-endpoint-mariadb", - "mariadb_server/103-private-endpoint-with-fw-rule-mariadb", + "maps/101-azure-maps-account", "messaging/eventgrid/100-simple-eventgrid-topic", "messaging/eventgrid/101-simple-eventgrid-topic-private-endpoint", "messaging/eventgrid/102-eventgrid_subscription", @@ -111,33 +83,8 @@ "monitoring/102-monitor_activity_log_alert", "monitoring/103-monitor_metric_alert", "monitoring/104-log_analytics_storage_insights", - "mssql_server/101-sqlserver-simple", - "mssql_server/102-sqlserver-extend", - "mssql_server/104-sqlserver-elastic_pools", - "mssql_server/105-sqlserver-failover_groups", - "mssql_server/107-sqlserver-db-retention-policy", - "mssql_server/108-sqlserver-db-diagnostics", - "mssql_server/109-sqlserver-network-firewall-rule", - "mysql_flexible_server/100-simple-mysql-flexible", - "mysql_flexible_server/101-delegated-subnet-with-fw-rule", - "mysql_flexible_server/102-advanced-mysql-flexible", - "mysql_server/100-simple-mysql", - "mysql_server/101-vnet-rule-mysql", - "mysql_server/102-private-endpoint-mysql", - "mysql_server/103-private-endpoint-with-fw-rule-mysql", "netapp/101-nfs", "netapp/102-nfs-export-policy", - "postgresql_flexible_server/100-simple-postgresql-flexible", - "postgresql_flexible_server/101-delegated-subnet-with-fw-rule", - "postgresql_flexible_server/102-advanced-postgresql-flexible", - "postgresql_flexible_server/104-private-endpoint", - "postgresql_server/100-simple-postgresql", - "postgresql_server/101-vnet-rule-postgresql", - "postgresql_server/102-private-endpoint-postgresql", - "postgresql_server/103-private-endpoint-with-fw-rule", - "powerbi_embedded/100-simple-powerbi", - "purview/100-purview_account", - "purview/101-purview_account_private_link", "recovery_vault/101-simple-asrv", "recovery_vault/102-asr-protection", "recovery_vault/103-asr-with-private-endpoint", @@ -145,6 +92,9 @@ "recovery_vault/105-asr-with-network-mapping", "recovery_vault/106-backupvault-with-sqldatabase-saphana", "recovery_vault/107-asr-diagnostics", + "redis_cache/100-redis-standard", + "redis_cache/101-redis-diagnostics", + "redis_cache/102-redis-private", "redis_cache/103-redis-private-endpoints", "role_mapping/100-simple-role-mapping", "role_mapping/101-function-app-managed-identity", @@ -171,6 +121,7 @@ "storage_container/101-storage_container", "synapse_analytics/100-synapse", "synapse_analytics/101-synapse-sparkpool", + "webapps/appservice-environment/102-simple_asev3", "webapps/appservice/101-appservice-simple", "webapps/appservice/102-appservice-slots", "webapps/appservice/103-appservice-extend", diff --git a/.github/workflows/standalone-tf100.yaml b/.github/workflows/standalone-tf100.yaml deleted file mode 100644 index 3ba94fd09e..0000000000 --- a/.github/workflows/standalone-tf100.yaml +++ /dev/null @@ -1,161 +0,0 @@ -# -# Copyright (c) Microsoft Corporation -# Licensed under the MIT License. -# - -name: standalone-tf100 - -on: - workflow_dispatch: - inputs: - scenario: - description: "Select the scenario you want to run:" - required: false - type: choice - default: "standalone-scenarios.json" - options: - - standalone-scenarios-azuread.json - - standalone-scenarios.json - - standalone-compute.json - - standalone-networking.json - - standalone-scenarios-longrunners.json - -env: - TF_CLI_ARGS: "-no-color" - TF_CLI_ARGS_destroy: "-auto-approve -refresh=false" - ARM_CLIENT_SECRET: ${{ secrets.ARM_CLIENT_SECRET }} - ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }} - ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }} - ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }} - TF_REGISTRY_DISCOVERY_RETRY: 5 - TF_REGISTRY_CLIENT_TIMEOUT: 15 - ROVER_RUNNER: true - -jobs: - load_scenarios: - runs-on: ubuntu-latest - outputs: - matrix: ${{ steps.load_scenarios.outputs.matrix }} - steps: - - uses: actions/checkout@v4 - - id: load_scenarios - run: | - cases=$(( - cat ./.github/workflows/${{ github.event.inputs.scenario }}) | jq -c .) - echo "matrix=${cases}" >> $GITHUB_OUTPUT - - testcases: - name: test - runs-on: ubuntu-latest - needs: load_scenarios - - strategy: - max-parallel: 20 - fail-fast: false - matrix: ${{fromJSON(needs.load_scenarios.outputs.matrix)}} - - container: - image: aztfmod/rover:1.8.4-2405.2306 - options: --user 0 - - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Create environment variables - run: | - cd ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} - FILE_NAME=$(echo ${{ matrix.config_files }} | sed 's./..g' | xargs) - echo STATE_FILE=${TF_DATA_DIR}/tfstates/${FILE_NAME}.tfstate >> $GITHUB_ENV - echo PLAN_FILE=${TF_DATA_DIR}/tfstates/${FILE_NAME}.plan >> $GITHUB_ENV - echo CURRENT_FOLDER=${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} >> $GITHUB_ENV - echo PARAMETER_FILES=$(find ${GITHUB_WORKSPACE}/examples/${{ matrix.config_files }} | grep .tfvars | sed 's/.*/-var-file=&/' | xargs) >> $GITHUB_ENV - - - name: Login azure - run: | - az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}' - az account set -s ${{ env.ARM_SUBSCRIPTION_ID }} - - - name: Terraform Init example - id: tf_init - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - init -upgrade=true | grep -P '^- (?=Downloading|Using|Finding|Installing)|^[^-]' - - - name: Terraform Plan example - id: tf_plan - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - plan \ - ${{ env.PARAMETER_FILES }} \ - -var tags='{testing_job_id='"${{ github.run_id }}"'}' \ - -var var_folder_path=${{ env.CURRENT_FOLDER }} \ - -refresh=true \ - -input=false \ - -state=${{ env.STATE_FILE }} \ - -out=${{ env.PLAN_FILE }} - - - name: Terraform Apply example - id: tf_apply - if: steps.tf_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - apply \ - -parallelism=30 \ - -state=${{ env.STATE_FILE }} \ - ${{ env.PLAN_FILE }} - - - name: Terraform Destroy planning example - id: tf_destroy_plan - if: steps.tf_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - plan \ - ${{ env.PARAMETER_FILES }} \ - -var tags='{testing_job_id='"${{ github.run_id }}"'}' \ - -var var_folder_path=${{ env.CURRENT_FOLDER }} \ - -refresh=true \ - -input=false \ - -destroy \ - -state=${{ env.STATE_FILE }} \ - -out=${{ env.PLAN_FILE }}-destroy - - - name: Terraform Destroy apply example - id: tf_destroy_apply - if: steps.tf_destroy_plan.outcome == 'success' - run: | - terraform -chdir=${GITHUB_WORKSPACE}/examples \ - apply \ - -refresh=false \ - -parallelism=30 \ - -auto-approve \ - -state=${{ env.STATE_FILE }} \ - ${{ env.PLAN_FILE }}-destroy - - purge: - name: purge - runs-on: ubuntu-latest - if: ${{ failure() || cancelled() }} - - needs: [testcases] - - container: - image: aztfmod/rover:1.8.4-2405.2306 - options: --user 0 - - steps: - - name: Login azure - run: | - az login --service-principal -u '${{ env.ARM_CLIENT_ID }}' -p '${{ env.ARM_CLIENT_SECRET }}' --tenant '${{ env.ARM_TENANT_ID }}' - az account set -s ${{ env.ARM_SUBSCRIPTION_ID }} - - - name: Complete purge - run: | - for i in `az monitor diagnostic-settings subscription list -o tsv --query "value[?contains(name, '${{ github.run_id }}' )].name"`; do echo "purging subscription diagnostic-settings: $i" && $(az monitor diagnostic-settings subscription delete --name $i --yes); done - for i in `az monitor log-profiles list -o tsv --query '[].name'`; do az monitor log-profiles delete --name $i; done - for i in `az ad group list --query "[?contains(displayName, '${{ github.run_id }}')].id" -o tsv`; do echo "purging Azure AD group: $i" && $(az ad group delete --verbose --group $i || true); done - for i in `az ad app list --query "[?contains(displayName, '${{ github.run_id }}')].appId" -o tsv`; do echo "purging Azure AD app: $i" && $(az ad app delete --verbose --id $i || true); done - for i in `az keyvault list-deleted --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do az keyvault purge --name $i; done - for i in `az group list --query "[?tags.testing_job_id=='${{ github.run_id }}'].name" -o tsv`; do echo "purging resource group: $i" && $(az group delete -n $i -y --no-wait || true); done - for i in `az role assignment list --query "[?contains(roleDefinitionName, '${{ github.run_id }}')].roleDefinitionName" -o tsv`; do echo "purging role assignment: $i" && $(az role assignment delete --role $i || true); done - for i in `az role definition list --query "[?contains(roleName, '${{ github.run_id }}')].roleName" -o tsv`; do echo "purging custom role definition: $i" && $(az role definition delete --name $i || true); done diff --git a/.github/workflows/weekly_dispatch.yaml b/.github/workflows/weekly_dispatch.yaml new file mode 100644 index 0000000000..fc601ff4d7 --- /dev/null +++ b/.github/workflows/weekly_dispatch.yaml @@ -0,0 +1,34 @@ +# +# Copyright (c) Microsoft Corporation +# Licensed under the MIT License. +# + +name: PR Dispatch Workflow + +on: + schedule: + - cron: '0 5 * * 5' + +env: + TF_VERSION: "1.8.4" + TF_LINT_VERSION: "v0.50.3" + +jobs: + dispatch: + runs-on: ubuntu-latest + strategy: + matrix: + scenario: + - standalone-scenarios-azuread.json + - standalone-scenarios.json + - standalone-compute.json + - standalone-networking.json + - standalone-dataplat.json + + steps: + - name: Repository Dispatch + uses: peter-evans/repository-dispatch@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + event-type: int-${{ matrix.scenario }} + client-payload: '{"scenario": "${{ (matrix.scenario) }}", "sha": "${{ github.event.pull_request.head.sha }}"}' diff --git a/.github/workflows/pr_workflow.yaml b/.github/workflows/weekly_workflow.yaml similarity index 97% rename from .github/workflows/pr_workflow.yaml rename to .github/workflows/weekly_workflow.yaml index b5b6710518..ff2d792d7e 100644 --- a/.github/workflows/pr_workflow.yaml +++ b/.github/workflows/weekly_workflow.yaml @@ -7,7 +7,7 @@ name: PR tests on: repository_dispatch: - types: [pr-*] + types: [int-*] workflow_dispatch: inputs: scenario: @@ -22,10 +22,6 @@ on: - standalone-networking.json - standalone-scenarios-longrunners.json -permissions: - id-token: write - contents: read - env: DEFAULT_SCENARIO: "standalone-networking.json" TF_VERSION: "1.8.4" @@ -39,9 +35,6 @@ jobs: matrix: ${{ steps.load_scenarios.outputs.matrix }} steps: - uses: actions/checkout@v4 - with: - ref: ${{ github.event.client_payload.sha }} - - id: load_scenarios run: | echo "Scenario: ${{ github.event.client_payload.scenario }}" @@ -64,8 +57,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.client_payload.sha }} - name: Create environment variables run: | @@ -116,6 +107,10 @@ jobs: -verbose terraform_integration_tests: + permissions: + id-token: write + contents: read + name: Integration-${{ matrix.config_files }} runs-on: ubuntu-latest if: always() @@ -131,8 +126,6 @@ jobs: steps: - name: Checkout uses: actions/checkout@v4 - with: - ref: ${{ github.event.client_payload.sha }} - name: Create environment variables run: | @@ -161,7 +154,7 @@ jobs: key: ${{ runner.os }}-terraform-${{ hashFiles('**/.terraform.lock.hcl') }} restore-keys: | ${{ runner.os }}-terraform- - + - name: Azure Login uses: azure/login@v2 with: @@ -221,6 +214,10 @@ jobs: ${{ env.PLAN_FILE }}-destroy purge: + permissions: + id-token: write + contents: read + name: Purge Integration Environment runs-on: ubuntu-latest if: ${{ failure() || cancelled() }} From d6a1b21d67f35f211ff2098697a8af185de3be52 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Sun, 2 Jun 2024 19:16:27 -0700 Subject: [PATCH 17/19] Case --- .github/workflows/pr_tests-azuread.yaml | 2 +- .github/workflows/pr_tests-compute.yaml | 2 +- .github/workflows/pr_tests-dataplat.yaml | 2 +- .github/workflows/pr_tests-networking.yaml | 2 +- .github/workflows/pr_tests-scenarios.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/pr_tests-azuread.yaml b/.github/workflows/pr_tests-azuread.yaml index 60640e52ae..29c6f826ec 100644 --- a/.github/workflows/pr_tests-azuread.yaml +++ b/.github/workflows/pr_tests-azuread.yaml @@ -15,7 +15,7 @@ on: - '.github/workflows/*azuread.*' env: - scenario: standalone-azuread.json + SCENARIO: standalone-azuread.json TF_VERSION: "1.8.4" TF_LINT_VERSION: "v0.50.3" diff --git a/.github/workflows/pr_tests-compute.yaml b/.github/workflows/pr_tests-compute.yaml index 993d2269a0..aed5733f49 100644 --- a/.github/workflows/pr_tests-compute.yaml +++ b/.github/workflows/pr_tests-compute.yaml @@ -15,7 +15,7 @@ on: - '.github/workflows/*compute.*' env: - scenario: standalone-compute.json + SCENARIO: standalone-compute.json TF_VERSION: "1.8.4" TF_LINT_VERSION: "v0.50.3" diff --git a/.github/workflows/pr_tests-dataplat.yaml b/.github/workflows/pr_tests-dataplat.yaml index 5aaabd1a60..1724b6a6a6 100644 --- a/.github/workflows/pr_tests-dataplat.yaml +++ b/.github/workflows/pr_tests-dataplat.yaml @@ -21,7 +21,7 @@ on: - '.github/workflows/*dataplat.*' env: - scenario: standalone-dataplat.json + SCENARIO: standalone-dataplat.json TF_VERSION: "1.8.4" TF_LINT_VERSION: "v0.50.3" diff --git a/.github/workflows/pr_tests-networking.yaml b/.github/workflows/pr_tests-networking.yaml index 24a07e0855..94fc434ece 100644 --- a/.github/workflows/pr_tests-networking.yaml +++ b/.github/workflows/pr_tests-networking.yaml @@ -15,7 +15,7 @@ on: - '.github/workflows/*networking.*' env: - scenario: standalone-networking.json + SCENARIO: standalone-networking.json TF_VERSION: "1.8.4" TF_LINT_VERSION: "v0.50.3" diff --git a/.github/workflows/pr_tests-scenarios.yaml b/.github/workflows/pr_tests-scenarios.yaml index 8bd8c90965..16b6ed9843 100644 --- a/.github/workflows/pr_tests-scenarios.yaml +++ b/.github/workflows/pr_tests-scenarios.yaml @@ -10,7 +10,7 @@ on: types: [opened, synchronize, reopened] env: - scenario: standalone-scenarios.json + SCENARIO: standalone-scenarios.json TF_VERSION: "1.8.4" TF_LINT_VERSION: "v0.50.3" From 6e0e579e5b66783688388601ca60177236a93377 Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Sun, 2 Jun 2024 19:27:52 -0700 Subject: [PATCH 18/19] Add workflow_dispatch --- .github/workflows/pr_lint.yaml | 1 + .github/workflows/pr_tests-azuread.yaml | 1 + .github/workflows/pr_tests-compute.yaml | 1 + .github/workflows/pr_tests-dataplat.yaml | 1 + .github/workflows/pr_tests-networking.yaml | 1 + .github/workflows/pr_tests-scenarios.yaml | 1 + 6 files changed, 6 insertions(+) diff --git a/.github/workflows/pr_lint.yaml b/.github/workflows/pr_lint.yaml index 8e0d16a3d4..55fd1a3a91 100644 --- a/.github/workflows/pr_lint.yaml +++ b/.github/workflows/pr_lint.yaml @@ -6,6 +6,7 @@ name: PR Tflint on: + workflow_dispatch: pull_request: types: [opened, synchronize, reopened] diff --git a/.github/workflows/pr_tests-azuread.yaml b/.github/workflows/pr_tests-azuread.yaml index 29c6f826ec..4b82311ca0 100644 --- a/.github/workflows/pr_tests-azuread.yaml +++ b/.github/workflows/pr_tests-azuread.yaml @@ -6,6 +6,7 @@ name: PR azuread-tests on: + workflow_dispatch: pull_request: types: [opened, synchronize, reopened] paths: diff --git a/.github/workflows/pr_tests-compute.yaml b/.github/workflows/pr_tests-compute.yaml index aed5733f49..7b4678b323 100644 --- a/.github/workflows/pr_tests-compute.yaml +++ b/.github/workflows/pr_tests-compute.yaml @@ -6,6 +6,7 @@ name: PR compute-tests on: + workflow_dispatch: pull_request: types: [opened, synchronize, reopened] paths: diff --git a/.github/workflows/pr_tests-dataplat.yaml b/.github/workflows/pr_tests-dataplat.yaml index 1724b6a6a6..6c1ed84706 100644 --- a/.github/workflows/pr_tests-dataplat.yaml +++ b/.github/workflows/pr_tests-dataplat.yaml @@ -6,6 +6,7 @@ name: PR dataplat-tests on: + workflow_dispatch: pull_request: types: [opened, synchronize, reopened] paths: diff --git a/.github/workflows/pr_tests-networking.yaml b/.github/workflows/pr_tests-networking.yaml index 94fc434ece..0f8579c651 100644 --- a/.github/workflows/pr_tests-networking.yaml +++ b/.github/workflows/pr_tests-networking.yaml @@ -6,6 +6,7 @@ name: PR networking-tests on: + workflow_dispatch: pull_request: types: [opened, synchronize, reopened] paths: diff --git a/.github/workflows/pr_tests-scenarios.yaml b/.github/workflows/pr_tests-scenarios.yaml index 16b6ed9843..5c1f2c2f55 100644 --- a/.github/workflows/pr_tests-scenarios.yaml +++ b/.github/workflows/pr_tests-scenarios.yaml @@ -6,6 +6,7 @@ name: PR all-tests on: + workflow_dispatch: pull_request: types: [opened, synchronize, reopened] From a58c5dde1395483c8c99f0fdafa28e07e5333d6c Mon Sep 17 00:00:00 2001 From: Arnaud Lheureux Date: Sun, 2 Jun 2024 21:38:31 -0700 Subject: [PATCH 19/19] Updating servicebus testcases --- .github/workflows/standalone-scenarios.json | 1 + .../configuration.tfvars | 0 .../configuration.tfvars | 243 ------------------ 3 files changed, 1 insertion(+), 243 deletions(-) rename examples/{ => messaging}/servicebus/200-servicebus-privatelink/configuration.tfvars (100%) delete mode 100644 examples/servicebus/100-servicebus-simple/configuration.tfvars diff --git a/.github/workflows/standalone-scenarios.json b/.github/workflows/standalone-scenarios.json index c0e560b63d..36d5c48490 100644 --- a/.github/workflows/standalone-scenarios.json +++ b/.github/workflows/standalone-scenarios.json @@ -74,6 +74,7 @@ "messaging/eventgrid/102-eventgrid_subscription", "messaging/eventgrid/200-simple-eventgrid-domain-topic", "messaging/servicebus/100-servicebus-services", + "messaging/servicebus/200-servicebus-privatelink", "messaging/web_pubsub/100-simple-web-pubsub", "messaging/web_pubsub/101-web-pubsub-hub", "messaging/web_pubsub/102-web-pubsub-usermsi", diff --git a/examples/servicebus/200-servicebus-privatelink/configuration.tfvars b/examples/messaging/servicebus/200-servicebus-privatelink/configuration.tfvars similarity index 100% rename from examples/servicebus/200-servicebus-privatelink/configuration.tfvars rename to examples/messaging/servicebus/200-servicebus-privatelink/configuration.tfvars diff --git a/examples/servicebus/100-servicebus-simple/configuration.tfvars b/examples/servicebus/100-servicebus-simple/configuration.tfvars deleted file mode 100644 index ac6557c032..0000000000 --- a/examples/servicebus/100-servicebus-simple/configuration.tfvars +++ /dev/null @@ -1,243 +0,0 @@ -global_settings = { - default_region = "region1" - regions = { - region1 = "australiaeast" - } -} - - -resource_groups = { - rg1 = { - name = "servicebus-rg" - } -} - -vnets = { - vnet1 = { - resource_group_key = "rg1" - vnet = { - name = "servicebus-vnet" - address_space = ["172.33.0.0/16"] - } - subnets = { - subnet1 = { - name = "subnet1" - cidr = ["172.33.100.0/24"] - service_endpoints = ["Microsoft.ServiceBus"] - } - } - } -} - -servicebus_namespaces = { - namespace1 = { - resource_group = { - # lz_key = "" - key = "rg1" - } - name = "jstestbusaztfmod" - sku = "Premium" # Basic | standard | Premium - capacity = 1 # capacity only for Premium: 1,2,4,8,16 otherwise 0 - # zone_redundant = false # only true for Premium - # tags = {} # optional - namespace_auth_rules = { - rule1 = { - name = "rule1" - listen = true - send = true - manage = false - } - } - - network_rule_sets = { # created in terraform but not reflected in azure? - ruleset1 = { - default_action = "Allow" - ip_rules = ["1.1.1.1"] - network_rules = { - subnet1 = { - # lz_key = "" - vnet_key = "vnet1" - subnet_key = "subnet1" - ignore_missing_vnet_service_endpoint = false - } - } - } - } - - } -} - -servicebus_topics = { - topic1 = { - # resource_group = { # Default to follow the namespace resource group when not specified - # # lz_key = "" - # key = "rg1" - # } - servicebus_namespace = { - # lz_key = "" - key = "namespace1" - } - name = "topic1" - - # auto_delete_on_idle = "P0Y0M0DT0H5M0S" - # default_message_ttl = "P0Y0M0DT0H5M0S" - # duplicate_detection_history_time_window = "P0Y0M0DT0H5M0S" - enable_batched_operations = false - enable_express = false - enable_partitioning = false - max_size_in_megabytes = 1024 - requires_duplicate_detection = false - support_ordering = false - - topic_auth_rules = { - rule1 = { - name = "authrule1" - listen = true - send = false - manage = false # requires both listen and send - } - } - - subscriptions = { - sub1 = { - name = "subtest1" - max_delivery_count = 1 - - auto_delete_on_idle = "P14DT5M" - default_message_ttl = "P14D" - lock_duration = "PT30S" - dead_lettering_on_message_expiration = false - dead_lettering_on_filter_evaluation_error = true - enable_batched_operations = false - requires_session = false - status = "Active" # ReceiveDisabled, Disabled, Active (default) - - # forward_to = { - # # queue_name = "" # full name of the queue - # # topic_name = "" # full name of the topic - # queue = { # key reference only works for remote landingzone - # # name = "" - # # lz_key = "" - # # key = "" - # } - # # topic = { - # # # name = "" - # # lz_key = "" - # # key = "" - # # } - # } - - # forward_dead_lettered_messages_to = { - # # queue_name = "" # full name of the queue - # # topic_name = "" # full name of the topic - # queue = { # key reference only works for remote landingzone - # # name = "" - # # lz_key = "" - # # key = "" - # } - # # topic = { - # # # name = "" - # # lz_key = "" - # # key = "" - # # } - # } - - subscription_rules = { - - correlation_filter_rules = { - rule1 = { - name = "testrule1" - # action = "" # in sql syntax against BrokeredMessage - correlation_filter = { - correlation_id = "high" - label = "red" - properties = { - custom1 = "value" - } - } - } - } - - sql_filter_rules = { - rule1 = { - name = "testrule2" - # action = "" - filter_type = "SqlFilter" - sql_filter = "x=1" - } - } - - } - - } - } - } -} - -servicebus_queues = { - queue1 = { - name = "testqueue1" - servicebus_namespace = { - # lz_key = "" - key = "namespace1" - } - # resource_group = { # default to namespace rg - # lz_key = "" - # key = "" - # } - - # lock_duration = "PT30S" - # max_size_in_megabytes = 1024 - # requires_duplicate_detection = false - # requires_session = false - # default_message_ttl = "P14D" - # dead_lettering_on_message_expiration = false - # duplicate_detection_history_time_window = "PT10M" - # max_delivery_count = 1 - # status = "Active" # Active, Creating, Deleting, Disabled, ReceiveDisabled, Renaming, SendDisabled, Unknown - # enable_batched_operations = true - # auto_delete_on_idle = "PT5M" - # enable_partitioning = false - # enable_express = false - - # forward_to = { - # # queue_name = "" # full name of the queue - # # topic_name = "" # full name of the topic - # queue = { # key reference only works for remote landingzone - # # name = "" - # # lz_key = "" - # # key = "" - # } - # # topic = { - # # # name = "" - # # lz_key = "" - # # key = "" - # # } - # } - - # forward_dead_lettered_messages_to = { - # # queue_name = "" # full name of the queue - # # topic_name = "" # full name of the topic - # queue = { # key reference only works for remote landingzone - # # name = "" - # # lz_key = "" - # # key = "" - # } - # # topic = { - # # # name = "" - # # lz_key = "" - # # key = "" - # # } - # } - - queue_auth_rules = { - rule1 = { - name = "qauthrule1" - listen = true - send = false - manage = false - - } - } - } -}