Closed acauret closed 1 month ago
Thanks for opening this pr to us @acauret and sorry for the late reply, this diagnostic setting is required by Azure Verified Module Specification so we won't fix it.
@lonegunmanb does this need more of a review? The code below will always want to make changes on each run, which is certainly not ideal. Setting the azurerm_monitor_diagnostic_setting
outside of the module is the useable workaround.
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
}
}
provider "azurerm" {
features {}
}
resource "random_string" "example" {
length = 5
special = false
upper = false
lower = true
}
resource "azurerm_resource_group" "rg" {
name = "rg-openai-avm"
location = "uksouth"
}
resource "azurerm_log_analytics_workspace" "law" {
name = "law-testing-${random_string.example.result}"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
sku = "PerGB2018"
retention_in_days = 30
}
module "openai" {
source = "Azure/avm-res-cognitiveservices-account/azurerm"
version = "0.3.0"
kind = "OpenAI"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
name = "oai-testing-${random_string.example.result}"
sku_name = "S0"
public_network_access_enabled = true
diagnostic_settings = {
sendToLogAnalytics = {
name = "sendToLogAnalytics"
workspace_resource_id = azurerm_log_analytics_workspace.law.id
}
}
cognitive_deployments = {
"gpt-35-turbo" = {
name = "gpt-35-turbo"
model = {
format = "OpenAI"
name = "gpt-35-turbo"
version = "0301"
}
scale = {
type = "Standard"
}
}
}
}
Check for previous/existing GitHub issues
Issue Type?
Bug
(Optional) Module Version
No response
(Optional) Correlation Id
No response
Description
The logAnalyticsDestinationType should not be Dedicated but allow seeting of null value
as everytime terrform runs it thinks there is a change.