Skip to content

Commit

Permalink
upgrade to azapi 1.13.1 & housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jun 19, 2024
1 parent d6aad77 commit 482cda6
Show file tree
Hide file tree
Showing 23 changed files with 42 additions and 50 deletions.
29 changes: 15 additions & 14 deletions infra/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions infra/modules/apim/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ resource "azapi_resource" "apim" {
type = "SystemAssigned"
}
schema_validation_enabled = false # requiered for now
body = jsonencode({
body = {
sku = {
name = "StandardV2"
capacity = 1
Expand All @@ -27,7 +27,7 @@ resource "azapi_resource" "apim" {
subnetResourceId = var.apim_subnet_id
} : null
}
})
}
response_export_values = [
"identity.principalId",
"properties.gatewayUrl"
Expand All @@ -51,7 +51,7 @@ resource "azapi_resource" "apim_backend_pool" {
parent_id = azapi_resource.apim.id
name = "openai-backend-pool"
schema_validation_enabled = false # requiered for now
body = jsonencode({
body = {
properties = {
description = "Azure OpenAI Backend Pool"
type = "Pool"
Expand All @@ -65,7 +65,7 @@ resource "azapi_resource" "apim_backend_pool" {
]
}
}
})
}
}

resource "azurerm_api_management_logger" "appi_logger" {
Expand Down Expand Up @@ -231,10 +231,10 @@ resource "azapi_update_resource" "diagnostics" {
type = "Microsoft.ApiManagement/service/diagnostics@2022-08-01"
resource_id = azurerm_api_management_diagnostic.diagnostics.id

body = jsonencode({
body = {
properties = {
loggerId = azurerm_api_management_logger.appi_logger.id
metrics = true
}
})
}
}
2 changes: 1 addition & 1 deletion infra/modules/apim/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ output "apim_name" {
}

output "gateway_url" {
value = jsondecode(azapi_resource.apim.output).properties.gatewayUrl
value = azapi_resource.apim.output.properties.gatewayUrl
}
2 changes: 0 additions & 2 deletions infra/modules/apim/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "azure/azapi"
version = "= 1.12.1"
}
}
}
4 changes: 2 additions & 2 deletions infra/modules/ca-aihub/auth_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "azapi_resource" "current" {
name = "Current"
parent_id = azapi_resource.ca_back.id
timeouts {}
body = jsonencode({
body = {
properties = {
platform = {
enabled = true
Expand Down Expand Up @@ -42,5 +42,5 @@ resource "azapi_resource" "current" {
preserveUrlFragmentsForLogins = false
}
}
})
}
}
4 changes: 2 additions & 2 deletions infra/modules/ca-aihub/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "azapi_resource" "ca_back" {
]
}

body = jsonencode({
body = {
properties : {
managedEnvironmentId = "${var.cae_id}"
configuration = {
Expand Down Expand Up @@ -272,7 +272,7 @@ resource "azapi_resource" "ca_back" {
]
}
}
})
}
response_export_values = ["properties.configuration.ingress.fqdn"]
}

Expand Down
2 changes: 1 addition & 1 deletion infra/modules/ca-aihub/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "fqdn" {
value = jsondecode(azapi_resource.ca_back.output).properties.configuration.ingress.fqdn
value = azapi_resource.ca_back.output.properties.configuration.ingress.fqdn
}

1 change: 0 additions & 1 deletion infra/modules/ca-aihub/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/ca-chat/auth_config.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "azapi_resource" "current" {
name = "Current"
parent_id = azapi_resource.ca_back.id
timeouts {}
body = jsonencode({
body = {
properties = {
platform = {
enabled = true
Expand Down Expand Up @@ -42,5 +42,5 @@ resource "azapi_resource" "current" {
preserveUrlFragmentsForLogins = false
}
}
})
}
}
4 changes: 2 additions & 2 deletions infra/modules/ca-chat/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "azapi_resource" "ca_back" {
]
}

body = jsonencode({
body = {
properties : {
managedEnvironmentId = "${var.cae_id}"
configuration = {
Expand Down Expand Up @@ -103,6 +103,6 @@ resource "azapi_resource" "ca_back" {
}
}
}
})
}
response_export_values = ["properties.configuration.ingress.fqdn"]
}
2 changes: 1 addition & 1 deletion infra/modules/ca-chat/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "fqdn" {
value = jsondecode(azapi_resource.ca_back.output).properties.configuration.ingress.fqdn
value = azapi_resource.ca_back.output.properties.configuration.ingress.fqdn
}

1 change: 0 additions & 1 deletion infra/modules/ca-chat/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/ca-plugin-fsi/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "azapi_resource" "ca_function" {
location = var.location
parent_id = var.resource_group_id
type = "Microsoft.Web/sites@2023-01-01"
body = jsonencode({
body = {
kind = "functionapp,linux,container,azurecontainerapps"
properties : {
language = "dotnet-isolated"
Expand Down Expand Up @@ -78,5 +78,5 @@ resource "azapi_resource" "ca_function" {
}
httpsOnly = false
}
})
}
}
1 change: 0 additions & 1 deletion infra/modules/ca-plugin-fsi/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/ca-plugin/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ resource "azapi_resource" "ca_function" {
location = var.location
parent_id = var.resource_group_id
type = "Microsoft.Web/sites@2023-01-01"
body = jsonencode({
body = {
kind = "functionapp,linux,container,azurecontainerapps"
properties : {
language = "dotnet-isolated"
Expand Down Expand Up @@ -70,5 +70,5 @@ resource "azapi_resource" "ca_function" {
}
httpsOnly = false
}
})
}
}
1 change: 0 additions & 1 deletion infra/modules/ca-plugin/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/ca-prep-docs/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ resource "azapi_resource" "ca_back" {
]
}

body = jsonencode({
body = {
properties : {
environmentId = "${var.cae_id}"
configuration = {
Expand Down Expand Up @@ -107,7 +107,7 @@ resource "azapi_resource" "ca_back" {
]
}
}
})
}
response_export_values = ["properties.configuration.ingress.fqdn"]
}

Expand Down
1 change: 0 additions & 1 deletion infra/modules/ca-prep-docs/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
4 changes: 2 additions & 2 deletions infra/modules/cae/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ resource "azapi_resource" "cae" {
parent_id = var.resource_group_id
type = "Microsoft.App/managedEnvironments@2022-11-01-preview"

body = jsonencode({
body = {
properties : {
daprAIInstrumentationKey = "${var.appi_key}"
appLogsConfiguration = {
Expand All @@ -25,6 +25,6 @@ resource "azapi_resource" "cae" {
},
]
}
})
}
response_export_values = ["properties.defaultDomain"]
}
2 changes: 1 addition & 1 deletion infra/modules/cae/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ output "cae_id" {
}

output "default_domain" {
value = jsondecode(azapi_resource.cae.output).properties.defaultDomain
value = azapi_resource.cae.output.properties.defaultDomain
}

1 change: 0 additions & 1 deletion infra/modules/cae/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
1 change: 0 additions & 1 deletion infra/modules/cog/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
}
azapi = {
source = "Azure/azapi"
Expand Down
2 changes: 1 addition & 1 deletion infra/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ terraform {
}
azapi = {
source = "Azure/azapi"
version = "1.12.1"
version = "1.13.1"
}
azuread = {
source = "hashicorp/azuread"
Expand Down

0 comments on commit 482cda6

Please sign in to comment.