Skip to content

Commit

Permalink
chore(terraform): ignore changes to dbconnstr secret for api
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian Fosli committed Jan 29, 2024
1 parent ca91535 commit 1582905
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion terraform/api.tf
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,21 @@ resource "azurerm_container_app" "highscoreApi" {
# because it is currently (July, 2023) not supported by azurerm terraform provider
}

identity {
type = "SystemAssigned"
# Manaul step: Grant this Identity permissions to access the key vault
}

secret {
name = "db-connstr"
value = azurerm_key_vault_secret.mongoConnectionString.value
# Issue: Doesn't auto-update and if it does then the secret ends up in tf state
# Solution: Update to be a key vault reference in azure portal, ignore changes here.
# See upstream issue: https://github.com/hashicorp/terraform-provider-azurerm/issues/21739
}

lifecycle {
ignore_changes = [template[0].container[0].image, ingress[0]]
ignore_changes = [template[0].container[0].image, ingress[0], secret]
}

tags = local.common_tags
Expand Down

0 comments on commit 1582905

Please sign in to comment.