From 7f100c1ae132d243ca89b1c2b024a5cc58626031 Mon Sep 17 00:00:00 2001 From: Elizabeth Schneider Date: Tue, 19 Jan 2021 12:25:06 -0700 Subject: [PATCH] Changed AZP token to secure variable (#12) Update module to pass the Azure PAT into secure variables of the ACI container. --- main.tf | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/main.tf b/main.tf index 0aad79f..f77594f 100644 --- a/main.tf +++ b/main.tf @@ -61,9 +61,12 @@ resource "azurerm_container_group" "linux-container-group" { environment_variables = { AZP_URL = "https://dev.azure.com/${var.azure_devops_org_name}" AZP_POOL = var.linux_agents_configuration.agent_pool_name - AZP_TOKEN = var.azure_devops_personal_access_token AZP_AGENT_NAME = "${var.linux_agents_configuration.agent_name_prefix}-${count.index}" } + + secure_environment_variables = { + AZP_TOKEN = var.azure_devops_personal_access_token + } } # if an image registry server has been specified, then generate the image_registry_credential block. @@ -119,9 +122,11 @@ resource "azurerm_container_group" "windows-container-group" { environment_variables = { AZP_URL = "https://dev.azure.com/${var.azure_devops_org_name}" AZP_POOL = var.windows_agents_configuration.agent_pool_name - AZP_TOKEN = var.azure_devops_personal_access_token AZP_AGENT_NAME = "${var.windows_agents_configuration.agent_name_prefix}-${count.index}" } + secure_environment_variables = { + AZP_TOKEN = var.azure_devops_personal_access_token + } } # if an image registry server has been specified, then generate the image_registry_credential block. @@ -133,4 +138,4 @@ resource "azurerm_container_group" "windows-container-group" { server = var.image_registry_credential.server } } -} \ No newline at end of file +}