equinor / terraform-baseline

Best practices for creating reusable Terraform modules using the Azure provider
https://equinor.github.io/terraform-baseline/
MIT License
10 stars 5 forks source link

function app module sticky_settings #183

Open sebastianlolv opened 1 week ago

sebastianlolv commented 1 week ago

Function App has an argument for sticky_settings which are names for app_settings and connections_strings under Environment Variables tab in the Function App Resource that will not change if someone decides to Swap Deployment Slots.

The issue is that if these are set manually in Azure, the pipeline will delete them as they aren't in the TF State. Example of some Azure sticky_settings app_settings names. image

Link to arguments in Terraform Registry: https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/linux_function_app#app_setting_names

Do we make the module ignore these, create a variable or do nothing?

hknutsen commented 6 days ago

I propose the following new variables:


variable "sticky_settings_app_setting_names" {
  description = "A list of names of app settings that this Function App will not swap between slots when a swap operation is triggered."
  type        = list(string)
  default     = []
}

variable "sticky_settings_connection_string_names" {
  description = "A list of names of connection strings that this Function App will not swap between slots when a swap operation is triggered."
  type        = list(string)
  default     = []
}