Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EYQB-233: Add reference to slot #187

Merged
merged 2 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions terraform/modules/azure-web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ No modules.
| [azurerm_web_application_firewall_policy.agw_wafp](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/web_application_firewall_policy) | resource |
| [azurerm_client_config.az_config](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |
| [azurerm_linux_web_app.ref](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_web_app) | data source |
| [azurerm_linux_web_app_slot.ref](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/linux_web_app_slot) | data source |

## Inputs

Expand Down
6 changes: 6 additions & 0 deletions terraform/modules/azure-web/web-app.tf
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,12 @@ resource "azurerm_key_vault_access_policy" "webapp_kv_app_service" {
certificate_permissions = ["Get"]
}

# References the web app slot to be used in KV access policy
data "azurerm_linux_web_app_slot" "ref" {
name = azurerm_linux_web_app_slot.webapp_slot.name
resource_group_name = azurerm_linux_web_app_slot.webapp_slot.resource_group_name
}

# Grants permissions to key vault for the managed identity of the App Service slot
resource "azurerm_key_vault_access_policy" "webapp_kv_app_service_slot" {
key_vault_id = var.kv_id
Expand Down