diff --git a/examples/Microsoft.CognitiveServices_accounts_raiPolicies@2024-10-01/main.tf b/examples/Microsoft.CognitiveServices_accounts_raiPolicies@2024-10-01/main.tf new file mode 100644 index 00000000..bb8836ae --- /dev/null +++ b/examples/Microsoft.CognitiveServices_accounts_raiPolicies@2024-10-01/main.tf @@ -0,0 +1,72 @@ +terraform { + required_providers { + azapi = { + source = "Azure/azapi" + } + } +} + +provider "azapi" { + skip_provider_registration = false +} + +variable "resource_name" { + type = string + default = "acctest0003" +} + +variable "location" { + type = string + default = "eastus" +} + +resource "azapi_resource" "resourceGroup" { + type = "Microsoft.Resources/resourceGroups@2020-06-01" + name = var.resource_name + location = var.location +} + +resource "azapi_resource" "account" { + type = "Microsoft.CognitiveServices/accounts@2022-10-01" + parent_id = azapi_resource.resourceGroup.id + name = var.resource_name + location = var.location + + body = { + kind = "OpenAI" + properties = { + disableLocalAuth = false + dynamicThrottlingEnabled = false + publicNetworkAccess = "Enabled" + restrictOutboundNetworkAccess = false + } + sku = { + name = "S0" + } + } + schema_validation_enabled = false + response_export_values = ["*"] +} + +resource "azapi_resource" "raiPolicy" { + type = "Microsoft.CognitiveServices/accounts/raiPolicies@2024-10-01" + name = "NoModerationPolicy" + parent_id = azapi_resource.account.id + + body = { + properties = { + basePolicyName = "Microsoft.Default" + contentFilters = [ + { + blocking = true + enabled = true + name = "Hate" + severityThreshold = "High" + source = "Prompt" + } + ] + } + } + schema_validation_enabled = false + response_export_values = ["*"] +}