From 1df37c9c124d2d0afdeb13bd3465d880010c08b9 Mon Sep 17 00:00:00 2001 From: Fraser Molyneux Date: Tue, 21 May 2024 17:48:07 +0100 Subject: [PATCH] Fix mass renaming issue --- terraform/api_management_api.tf | 60 +++++++++---------- terraform/api_management_logger.tf | 20 +++---- .../integration_tests_api_subscription.tf | 6 +- 3 files changed, 43 insertions(+), 43 deletions(-) diff --git a/terraform/api_management_api.tf b/terraform/api_management_api.tf index df7aeb38..06319605 100644 --- a/terraform/api_management_api.tf +++ b/terraform/api_management_api.tf @@ -1,8 +1,8 @@ resource "azurerm_api_management_backend" "webapi_api_management_backend" { - provider = azurerm.api_management - name = local.workload_name - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name + provider = azurerm.api_management + name = local.workload_name + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name protocol = "http" title = local.workload_name @@ -15,11 +15,11 @@ resource "azurerm_api_management_backend" "webapi_api_management_backend" { } } -resource "azurerm_legacy_api_management_named_value" "webapi_active_backend_named_value" { - provider = azurerm.api_management - name = "repository-api-active-backend" - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name +resource "azurerm_api_management_named_value" "webapi_active_backend_named_value" { + provider = azurerm.api_management + name = "repository-api-active-backend" + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name secret = false @@ -27,11 +27,11 @@ resource "azurerm_legacy_api_management_named_value" "webapi_active_backend_name value = azurerm_api_management_backend.webapi_api_management_backend.name } -resource "azurerm_legacy_api_management_named_value" "webapi_audience_named_value" { - provider = azurerm.api_management - name = "repository-api-audience" - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name +resource "azurerm_api_management_named_value" "webapi_audience_named_value" { + provider = azurerm.api_management + name = "repository-api-audience" + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name secret = false @@ -40,10 +40,10 @@ resource "azurerm_legacy_api_management_named_value" "webapi_audience_named_valu } resource "azurerm_api_management_api" "repository_api" { - provider = azurerm.api_management - name = "repository-api" - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name + provider = azurerm.api_management + name = "repository-api" + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name revision = "1" display_name = "Repository API" @@ -65,10 +65,10 @@ resource "azurerm_api_management_api" "repository_api" { } resource "azurerm_api_management_api_policy" "example" { - provider = azurerm.api_management - api_name = azurerm_api_management_api.repository_api.name - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name + provider = azurerm.api_management + api_name = azurerm_api_management_api.repository_api.name + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name xml_content = < @@ -103,18 +103,18 @@ resource "azurerm_api_management_api_policy" "example" { XML depends_on = [ - azurerm_legacy_api_management_named_value.webapi_active_backend_named_value, - azurerm_legacy_api_management_named_value.webapi_audience_named_value + azurerm_api_management_named_value.webapi_active_backend_named_value, + azurerm_api_management_named_value.webapi_audience_named_value ] } resource "azurerm_api_management_api_diagnostic" "example" { - provider = azurerm.api_management - identifier = "applicationinsights" - api_name = azurerm_api_management_api.repository_api.name - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name - api_management_logger_id = azurerm_api_management_logger.api_management_logger.id + provider = azurerm.api_management + identifier = "applicationinsights" + api_name = azurerm_api_management_api.repository_api.name + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name + api_management_logger_id = azurerm_api_management_logger.api_management_logger.id sampling_percentage = 100 diff --git a/terraform/api_management_logger.tf b/terraform/api_management_logger.tf index a335b7e1..e1e9a0fa 100644 --- a/terraform/api_management_logger.tf +++ b/terraform/api_management_logger.tf @@ -1,8 +1,8 @@ -resource "azurerm_legacy_api_management_named_value" "app_insights_apim_instrumentation_key_named_value" { - provider = azurerm.api_management - name = "repository${data.azurerm_application_insights.core.name}-instrumentationkey" - resource_group_name = data.azurerm_api_management.platform.resource_group_name - legacy_api_management_name = data.azurerm_api_management.platform.name +resource "azurerm_api_management_named_value" "app_insights_apim_instrumentation_key_named_value" { + provider = azurerm.api_management + name = "repository${data.azurerm_application_insights.core.name}-instrumentationkey" + resource_group_name = data.azurerm_api_management.platform.resource_group_name + api_management_name = data.azurerm_api_management.platform.name display_name = "repository${data.azurerm_application_insights.core.name}-instrumentationkey" @@ -15,14 +15,14 @@ resource "azurerm_legacy_api_management_named_value" "app_insights_apim_instrume resource "azurerm_api_management_logger" "api_management_logger" { - provider = azurerm.api_management - name = local.app_insights_name - legacy_api_management_name = data.azurerm_api_management.platform.name - resource_group_name = data.azurerm_api_management.platform.resource_group_name + provider = azurerm.api_management + name = local.app_insights_name + api_management_name = data.azurerm_api_management.platform.name + resource_group_name = data.azurerm_api_management.platform.resource_group_name resource_id = data.azurerm_application_insights.core.id application_insights { - instrumentation_key = "{{${azurerm_legacy_api_management_named_value.app_insights_apim_instrumentation_key_named_value.display_name}}}" + instrumentation_key = "{{${azurerm_api_management_named_value.app_insights_apim_instrumentation_key_named_value.display_name}}}" } } diff --git a/terraform/integration_tests_api_subscription.tf b/terraform/integration_tests_api_subscription.tf index b8f2dd83..098509e8 100644 --- a/terraform/integration_tests_api_subscription.tf +++ b/terraform/integration_tests_api_subscription.tf @@ -1,7 +1,7 @@ resource "azurerm_api_management_subscription" "integration_tests" { - provider = azurerm.api_management - legacy_api_management_name = data.azurerm_api_management.platform.name - resource_group_name = data.azurerm_api_management.platform.resource_group_name + provider = azurerm.api_management + api_management_name = data.azurerm_api_management.platform.name + resource_group_name = data.azurerm_api_management.platform.resource_group_name state = "active" allow_tracing = false