From 9042a960bb2859a2a665ab61b7e0021f776df8e4 Mon Sep 17 00:00:00 2001 From: Rob Gil Date: Wed, 22 Jan 2020 19:35:19 -0500 Subject: [PATCH] Adds configurable service endpoints to subnets in the vpc module --- terraform/modules/vpc/main.tf | 2 ++ terraform/modules/vpc/variables.tf | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/terraform/modules/vpc/main.tf b/terraform/modules/vpc/main.tf index dbbe4bfa..a27f2139 100644 --- a/terraform/modules/vpc/main.tf +++ b/terraform/modules/vpc/main.tf @@ -39,6 +39,8 @@ resource "azurerm_subnet" "subnet" { lifecycle { ignore_changes = [route_table_id] } + + service_endpoints = split(",", var.service_endpoints[each.key]) #delegation { # name = "acctestdelegation" # diff --git a/terraform/modules/vpc/variables.tf b/terraform/modules/vpc/variables.tf index 9f331534..ac2dbac9 100644 --- a/terraform/modules/vpc/variables.tf +++ b/terraform/modules/vpc/variables.tf @@ -46,3 +46,9 @@ variable "gateway_subnet" { type = string description = "The Subnet CIDR that we'll use for the virtual_network_gateway 'GatewaySubnet'" } + +variable "service_endpoints" { + type = map + description = "A map of the service endpoints and its mapping to subnets" + +}