Skip to content

Commit

Permalink
Merge pull request #136 from Ensono/fix/moves
Browse files Browse the repository at this point in the history
  • Loading branch information
ElvenSpellmaker authored Aug 13, 2024
2 parents 63bc257 + a87354b commit 814d5c1
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 19 deletions.
5 changes: 0 additions & 5 deletions azurerm/modules/azurerm-cosmosdb/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,6 @@ resource "azurerm_cosmosdb_account" "default" {
}

tags = var.resource_tags
lifecycle {
ignore_changes = [
tags,
]
}
}

resource "azurerm_cosmosdb_sql_database" "default" {
Expand Down
4 changes: 3 additions & 1 deletion azurerm/modules/azurerm-server-side-app/locals.tf
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
locals {
create_resource_group = var.create_cosmosdb || var.create_cache || var.create_cdn_endpoint

create_cdn_alias_dns = var.create_dns_record && var.create_cdn_endpoint && var.dns_enable_alias_record

# We want to create the A Record if we are trying to create DNS but not a
# CDN, OR, If we want to create an Alias DNS and a CDN
create_app_gateway_dns = (var.create_dns_record && !var.create_cdn_endpoint) || (var.create_dns_record && var.create_cdn_endpoint && var.dns_enable_alias_record) ? 1 : 0
create_app_gateway_dns = (var.create_dns_record && !var.create_cdn_endpoint) || local.create_cdn_alias_dns ? 1 : 0
}
15 changes: 2 additions & 13 deletions azurerm/modules/azurerm-server-side-app/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ resource "azurerm_dns_a_record" "default" {
# e.g. dev-api.nonprod.stacks.ensono.com is the intended CDN endpoint,
# dev-api-appgw.nonprod.stacks.ensono.com is the Alias record for the App GW
# public IP
name = var.create_dns_record && var.create_cdn_endpoint && var.dns_enable_alias_record ? "${var.dns_record}-appgw" : var.dns_record
name = local.create_cdn_alias_dns ? "${var.dns_record}-appgw" : var.dns_record
zone_name = var.dns_zone_name
resource_group_name = var.dns_zone_resource_group
ttl = var.dns_ttl
Expand All @@ -30,12 +30,6 @@ resource "azurerm_dns_a_record" "default" {
records = var.dns_enable_alias_record ? null : var.dns_a_records

tags = var.resource_tags

lifecycle {
ignore_changes = [
tags,
]
}
}

module "cosmosdb" {
Expand Down Expand Up @@ -65,6 +59,7 @@ resource "azurerm_redis_cache" "default" {
sku_name = var.cache_sku_name
enable_non_ssl_port = var.cach_enable_non_ssl_port
minimum_tls_version = var.cache_minimum_tls_version

redis_configuration {
enable_authentication = var.cache_redis_enable_authentication
maxmemory_reserved = var.cache_redis_maxmemory_reserved
Expand All @@ -73,10 +68,4 @@ resource "azurerm_redis_cache" "default" {
}

tags = var.resource_tags

lifecycle {
ignore_changes = [
tags,
]
}
}
9 changes: 9 additions & 0 deletions azurerm/modules/azurerm-server-side-app/moved.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
moved {
from = azurerm_resource_group.default
to = azurerm_resource_group.default[0]
}

moved {
from = module.app.module.cosmosdb
to = module.app.module.cosmosdb[0]
}

0 comments on commit 814d5c1

Please sign in to comment.