From 7e1337c14752eb3dc906d63c17c31e132d2688a5 Mon Sep 17 00:00:00 2001 From: Philip Date: Fri, 19 Apr 2024 09:50:35 +0200 Subject: [PATCH] terraform provision comms services and email service --- .../communication_services.tf | 24 +++++++++++++++++++ .../dpl-platform-environment/outputs.tf | 6 +++++ 2 files changed, 30 insertions(+) create mode 100644 infrastructure/terraform/modules/dpl-platform-environment/communication_services.tf diff --git a/infrastructure/terraform/modules/dpl-platform-environment/communication_services.tf b/infrastructure/terraform/modules/dpl-platform-environment/communication_services.tf new file mode 100644 index 00000000..87b4168c --- /dev/null +++ b/infrastructure/terraform/modules/dpl-platform-environment/communication_services.tf @@ -0,0 +1,24 @@ +# resource "azurerm_key_vault_secret" "azurerm_communication_service_connection_string" { +# name = "azurerm-communication-service-connection-string" +# value = azurerm_communication_service.acs.primary_connection_string +# key_vault_id = azurerm_key_vault.keyvault.id +# } +provider "azurerm" { + features {} +} + +resource "random_id" "acs" { + byte_length = 2 +} + +resource "azurerm_communication_service" "communications-services" { + name = "communication-services${random_id.acs.hex}" + resource_group_name = azurerm_resource_group.rg.name + data_location = "Germany" +} + +resource "azurerm_email_communication_service" "email-service" { + name = "email-service${random_id.acs.hex}" + resource_group_name = azurerm_resource_group.rg.name + data_location = "Germany" +} diff --git a/infrastructure/terraform/modules/dpl-platform-environment/outputs.tf b/infrastructure/terraform/modules/dpl-platform-environment/outputs.tf index cba4738d..fdbf4d6f 100644 --- a/infrastructure/terraform/modules/dpl-platform-environment/outputs.tf +++ b/infrastructure/terraform/modules/dpl-platform-environment/outputs.tf @@ -228,3 +228,9 @@ output "harbor_secondary_access_key_name" { description = "Name under which the secondary harbor storage account key is stored in keyvault" value = azurerm_key_vault_secret.harbor_secondary_access_key.name } + +output "acs_connection_string" { + description = "The conneciton string for Azure Communication Service" + value = azurerm_communication_service.communications-services.primary_connection_string + sensitive = true +}