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

SSCSSI-159 | Recreate sendgrid api key for removing from evidence share #3727

Merged
merged 1 commit into from
Apr 8, 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
23 changes: 23 additions & 0 deletions infrastructure/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,26 @@ data "azurerm_key_vault" "sscs_key_vault" {
locals {
azureVaultName = "sscs-${var.env}"
}

data "azurerm_key_vault" "send_grid" {
provider = azurerm.send-grid
name = var.env != "prod" ? "sendgridnonprod" : "sendgridprod"
resource_group_name = var.env != "prod" ? "SendGrid-nonprod" : "SendGrid-prod"
}

data "azurerm_key_vault_secret" "send_grid_api_key" {
provider = azurerm.send-grid
key_vault_id = data.azurerm_key_vault.send_grid.id
name = "sscs-api-key"
}

resource "azurerm_key_vault_secret" "sendgrid_api_key" {
key_vault_id = data.azurerm_key_vault.sscs_key_vault.id
name = "sscs-sendgrid-api-key"
value = data.azurerm_key_vault_secret.send_grid_api_key.value

content_type = "secret"
tags = merge(var.common_tags, {
"source" : "Vault ${data.azurerm_key_vault.sscs_key_vault.name}"
})
}
1 change: 1 addition & 0 deletions infrastructure/prod.tfvars
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
send_grid_subscription = "8999dec3-0104-4a27-94ee-6588559729d1"
6 changes: 6 additions & 0 deletions infrastructure/state.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,9 @@ terraform {
}
}
}

provider "azurerm" {
alias = "send-grid"
subscription_id = var.send_grid_subscription
features {}
}
4 changes: 4 additions & 0 deletions infrastructure/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,7 @@ variable "appinsights_instrumentation_key" {
description = "Instrumentation key of the App Insights instance this webapp should use. Module will create own App Insights resource if this is not provided"
default = ""
}

variable "send_grid_subscription" {
default = "1c4f0704-a29e-403d-b719-b90c34ef14c9"
}