Skip to content

Commit

Permalink
updated to azurerm 3.105.0
Browse files Browse the repository at this point in the history
  • Loading branch information
cmendible committed Jun 19, 2024
1 parent 482cda6 commit e66256d
Show file tree
Hide file tree
Showing 8 changed files with 42 additions and 68 deletions.
28 changes: 14 additions & 14 deletions infra/.terraform.lock.hcl

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

15 changes: 7 additions & 8 deletions infra/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -165,14 +165,13 @@ module "cog" {
}

module "cae" {
source = "./modules/cae"
location = azurerm_resource_group.rg.location
resource_group_id = azurerm_resource_group.rg.id
cae_name = local.cae_name
cae_subnet_id = module.vnet.cae_subnet_id
log_workspace_id = module.log.log_workspace_id
log_key = module.log.log_key
appi_key = module.appi.appi_key
source = "./modules/cae"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
cae_name = local.cae_name
cae_subnet_id = module.vnet.cae_subnet_id
log_id = module.log.log_id
appi_connection_string = module.appi.appi_connection_string
}

module "ca_chat" {
Expand Down
4 changes: 4 additions & 0 deletions infra/modules/appi/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ output "appi_id" {
output "appi_key" {
value = azurerm_application_insights.appinsights.instrumentation_key
}

output "appi_connection_string" {
value = azurerm_application_insights.appinsights.connection_string
}
39 changes: 11 additions & 28 deletions infra/modules/cae/main.tf
Original file line number Diff line number Diff line change
@@ -1,30 +1,13 @@
resource "azapi_resource" "cae" {
name = var.cae_name
location = var.location
parent_id = var.resource_group_id
type = "Microsoft.App/managedEnvironments@2022-11-01-preview"

body = {
properties : {
daprAIInstrumentationKey = "${var.appi_key}"
appLogsConfiguration = {
destination = "log-analytics"
logAnalyticsConfiguration = {
customerId = "${var.log_workspace_id}"
sharedKey = "${var.log_key}"
}
}
vnetConfiguration = {
internal = false
infrastructureSubnetId = "${var.cae_subnet_id}"
}
workloadProfiles = [
{
workloadProfileType = "Consumption"
name = "Consumption"
},
]
}
resource "azurerm_container_app_environment" "cae" {
name = var.cae_name
resource_group_name = var.resource_group_name
location = var.location
dapr_application_insights_connection_string = var.appi_connection_string
log_analytics_workspace_id = var.log_id
infrastructure_subnet_id = var.cae_subnet_id
workload_profile {
name = "Consumption"
workload_profile_type = "Consumption"
}
response_export_values = ["properties.defaultDomain"]
tags = {}
}
4 changes: 2 additions & 2 deletions infra/modules/cae/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
output "cae_id" {
value = azapi_resource.cae.id
value = azurerm_container_app_environment.cae.id
}

output "default_domain" {
value = azapi_resource.cae.output.properties.defaultDomain
value = azurerm_container_app_environment.cae.default_domain
}

11 changes: 0 additions & 11 deletions infra/modules/cae/providers.tf

This file was deleted.

7 changes: 3 additions & 4 deletions infra/modules/cae/variables.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
variable "resource_group_id" {}
variable "resource_group_name" {}
variable "location" {}
variable "cae_name" {}
variable "cae_subnet_id" {}
variable "log_workspace_id" {}
variable "log_key" {}
variable "appi_key" {}
variable "log_id" {}
variable "appi_connection_string" {}
2 changes: 1 addition & 1 deletion infra/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "3.87.0"
version = "3.105.0"
}
azapi = {
source = "Azure/azapi"
Expand Down

0 comments on commit e66256d

Please sign in to comment.