Skip to content

Commit

Permalink
Suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Darrell Bolger committed Jan 23, 2024
1 parent 6261a41 commit 987a9fd
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 44 deletions.
2 changes: 1 addition & 1 deletion modules/cognitive-services/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# CHANGELOG
# Changelog
24 changes: 3 additions & 21 deletions modules/cognitive-services/src/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,10 @@ resource "azurerm_cognitive_account" "main" {
}
}

resource "azurerm_cognitive_deployment" "main" {
for_each = var.deployment

cognitive_account_id = azurerm_cognitive_account.main.id
name = each.value.name
rai_policy_name = each.value.rai_policy_name

model {
format = each.value.model_format
name = each.value.model_name
version = each.value.model_version
}
scale {
type = each.value.scale_type
}
}

resource "azurerm_monitor_diagnostic_setting" "main" {
name = "log-analytics"
target_resource_id = azurerm_cognitive_account.main.id
log_analytics_workspace_id = var.log_analytics_workspace_id
log_analytics_destination_type = "AzureDiagnostics"
name = "log-analytics"
target_resource_id = azurerm_cognitive_account.main.id
log_analytics_workspace_id = var.log_analytics_workspace_id

dynamic "enabled_log" {
for_each = var.log_categories
Expand Down
12 changes: 0 additions & 12 deletions modules/cognitive-services/src/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,6 @@ variable "custom_subdomain_name" {
default = null
}

variable "deployment" {
type = map(object({
name = string
model_format = string
model_name = string
model_version = string
scale_type = string
rai_policy_name = optional(string)
}))
default = {}
}

variable "dynamic_throttling_enabled" {
type = bool
default = null
Expand Down
11 changes: 6 additions & 5 deletions modules/cognitive-services/test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ provider "azurerm" {
module "cognitive-search" {
source = "../src"

environment = "bar"
identifier = "baz"
location = "uksouth"
environment = "bar"
identifier = "baz"
location = "uksouth"
resource_group_name = "foobar"
zone = "bat"

log_analytics_workspace_id = "foo"
resource_group_name = "foobar"
zone = "bat"

tags = {
Foo = "Bar"
Expand Down
2 changes: 2 additions & 0 deletions modules/search-service/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ module "search_service" {
resource_group_name = module.resource_group.name
zone = "mtg"
log_analytics_workspace_id = data.azurerm_log_analytics_workspace.main.id
tags = {
WorkloadType = "MortgagesLZ/ai-services"
}
Expand Down
2 changes: 1 addition & 1 deletion modules/service-plan/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1 +1 @@
# CHANGELOG
# Changelog
8 changes: 5 additions & 3 deletions modules/service-plan/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@ This module creates an [App Service: Service Plan](https://registry.terraform.io

```hcl
module "service_plan" {
source = "https://github.com/gofrontier-com/azurerm-terraform-modules/releases/download/app-service-plan/[VERSION]/module.tar.gz//src"
source = "https://github.com/gofrontier-com/azurerm-terraform-modules/releases/download/service-plan/[VERSION]/module.tar.gz//src"
environment = "dev"
identifier = "mortgages"
location = "uksouth"
os_type = "Linux"
resource_group_name = module.resource_group.name
sku_name = "P0v3"
zone = "mtg"
os_type = "Linux"
sku_name = "P0v3"
tags = {
WorkloadType = "MortgagesLZ/web-services"
}
Expand Down
2 changes: 1 addition & 1 deletion modules/service-plan/test/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ provider "azurerm" {
features {}
}

module "app_service_plan" {
module "service_plan" {
source = "../src"

environment = "bar"
Expand Down

0 comments on commit 987a9fd

Please sign in to comment.