Skip to content

Commit

Permalink
Fix mass renaming issue
Browse files Browse the repository at this point in the history
  • Loading branch information
frasermolyneux committed May 21, 2024
1 parent 1b06c8b commit 1df37c9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 43 deletions.
60 changes: 30 additions & 30 deletions terraform/api_management_api.tf
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -15,23 +15,23 @@ 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

display_name = "repository-api-active-backend"
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

Expand All @@ -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"
Expand All @@ -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 = <<XML
<policies>
Expand Down Expand Up @@ -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

Expand Down
20 changes: 10 additions & 10 deletions terraform/api_management_logger.tf
Original file line number Diff line number Diff line change
@@ -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"

Expand All @@ -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}}}"
}
}
6 changes: 3 additions & 3 deletions terraform/integration_tests_api_subscription.tf
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit 1df37c9

Please sign in to comment.