Skip to content

Commit c645e01

Browse files
authored
feat: Upgrade azurerm provider to 2.9 (#396)
* upgrade azurerm provider to 2.6 * chaneg to the min version to 2.0.0 * remove upsupported field after upgrade * remove virtual_network_name param * change Web to web as part of upgrading to 2.x azurerm provider * change Web to web as part of azurerm upgrade * kick the CI * point to vnet ref 0.12.0 instead of 0.11.1 * remove unsupported var * remove extra / * fix service_endpoints var to be list of list * upgrade to azurerm 2.9 instead to solve app GT issue
1 parent a9331a7 commit c645e01

File tree

12 files changed

+33
-18
lines changed

12 files changed

+33
-18
lines changed

infra/modules/providers/azure/app-insights/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,3 +149,5 @@ Outputs:
149149
app_insights_app_id = xxxx5ba9-f5xx-xx94-93xx-xxxx0d40xxxx
150150
app_insights_instrumentation_key = xxxx75785-xx5f-42xx-xx80-xxxxx94c93xx
151151
```
152+
153+

infra/modules/providers/azure/app-service/main.tf

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,9 @@ resource "azurerm_app_service" "appsvc" {
5858
)
5959

6060
site_config {
61-
linux_fx_version = local.app_linux_fx_versions[local.app_names[count.index]]
62-
always_on = var.site_config_always_on
63-
virtual_network_name = var.vnet_name
64-
app_command_line = var.app_service_config[local.app_names[count.index]].app_command_line
61+
linux_fx_version = local.app_linux_fx_versions[local.app_names[count.index]]
62+
always_on = var.site_config_always_on
63+
app_command_line = var.app_service_config[local.app_names[count.index]].app_command_line
6564
}
6665

6766
identity {
@@ -96,10 +95,9 @@ resource "azurerm_app_service_slot" "appsvc_staging_slot" {
9695
)
9796

9897
site_config {
99-
linux_fx_version = local.app_linux_fx_versions[local.app_names[count.index]]
100-
always_on = var.site_config_always_on
101-
virtual_network_name = var.vnet_name
102-
app_command_line = var.app_service_config[local.app_names[count.index]].app_command_line
98+
linux_fx_version = local.app_linux_fx_versions[local.app_names[count.index]]
99+
always_on = var.site_config_always_on
100+
app_command_line = var.app_service_config[local.app_names[count.index]].app_command_line
103101
}
104102

105103
identity {

infra/modules/providers/azure/keyvault/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module "deployment_service_principal_keyvault_access_policies" {
3939
source = "../keyvault-policy"
4040
vault_id = azurerm_key_vault.keyvault.id
4141
tenant_id = data.azurerm_client_config.current.tenant_id
42-
object_ids = [data.azurerm_client_config.current.service_principal_object_id]
42+
object_ids = [data.azurerm_client_config.current.object_id]
4343
key_permissions = var.keyvault_key_permissions
4444
secret_permissions = var.keyvault_secret_permissions
4545
certificate_permissions = var.keyvault_certificate_permissions

infra/modules/providers/azure/provider/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This module will configure a provider and install required packages mentioned be
66

77
## Packages
88

9-
### Azure Resource Manager (Version 1.23.0 or higher)
9+
### Azure Resource Manager (Version 2.0.0 or higher)
1010

1111
Azure Resource Manager enables you to repeatedly deploy your app and have confidence your resources are deployed in a consistent state. In Cobalt, we use Azure Resource manager extensively for deployment of our resources using Terraform
1212

infra/modules/providers/azure/provider/main.tf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
provider "azurerm" {
2-
version = "~>1.40.0"
2+
version = "~> 2.9.0"
3+
features {}
34
}
45

56
provider "null" {

infra/templates/az-hello-world/backend.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,8 @@ terraform {
44
}
55
}
66

7+
provider "azurerm" {
8+
version = "~> 2.9.0"
9+
features {}
10+
}
11+

infra/templates/az-isolated-service-single-region/ase.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ module "app_insights" {
3131
source = "../../modules/providers/azure/app-insights"
3232
service_plan_resource_group_name = azurerm_resource_group.admin_rg.name
3333
appinsights_name = local.ai_name
34-
appinsights_application_type = "Web"
34+
appinsights_application_type = "web"
3535
providers = {
3636
"azurerm" = "azurerm.admin"
3737
}

infra/templates/az-isolated-service-single-region/backend.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,8 @@ terraform {
33
key = "terraform.tfstate"
44
}
55
}
6+
7+
provider "azurerm" {
8+
version = "~> 2.9.0"
9+
features {}
10+
}

infra/templates/az-isolated-service-single-region/tests/unit/unit_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ func TestTemplate(t *testing.T) {
6969
"location": "`+region+`"
7070
}`)
7171
expectedAppInsights := asMap(t, `{
72-
"application_type": "Web"
72+
"application_type": "web"
7373
}`)
7474
expectedKeyVault := asMap(t, `{
7575
"network_acls": [{

infra/templates/az-service-single-region/admin.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@ resource "azurerm_resource_group" "svcplan" {
44
}
55

66
module "vnet" {
7-
source = "github.com/microsoft/bedrock?ref=0.11.1//cluster/azure/vnet"
7+
source = "github.com/microsoft/bedrock?ref=0.12.0/cluster/azure/vnet"
88
vnet_name = local.vnet_name
99
address_space = var.address_space
1010
resource_group_name = azurerm_resource_group.svcplan.name
11-
resource_group_location = azurerm_resource_group.svcplan.location
1211
subnet_names = var.subnet_names
1312
subnet_prefixes = var.subnet_prefixes
1413
subnet_service_endpoints = var.subnet_service_endpoints

0 commit comments

Comments
 (0)