From 0ab2e80e8e91c45dbf15f6d7f3bd713f7b43a3c0 Mon Sep 17 00:00:00 2001 From: Marcio Goda Date: Mon, 10 May 2021 11:03:14 +0100 Subject: [PATCH] Removed deprecated provider --- modules/fastly-frontend/main.tf | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/modules/fastly-frontend/main.tf b/modules/fastly-frontend/main.tf index 2d79aba..33ea538 100644 --- a/modules/fastly-frontend/main.tf +++ b/modules/fastly-frontend/main.tf @@ -180,28 +180,23 @@ resource "fastly_service_v1" "fastly" { vcl { name = "custom_vcl" - content = data.template_file.custom_vcl.rendered + content = templatefile("${path.module}/custom.vcl", + { + proxy_error_response = var.proxy_error_response + custom_vcl_backends = var.custom_vcl_backends + custom_vcl_recv = var.custom_vcl_recv + custom_vcl_recv_no_shield = var.custom_vcl_recv_no_shield + custom_vcl_recv_shield_only = var.custom_vcl_recv_shield_only + custom_vcl_error = var.custom_vcl_error + custom_vcl_deliver = var.custom_vcl_deliver + vcl_recv_default_action = var.caching == "true" ? "lookup" : "pass" + }) main = true } force_destroy = true } -data "template_file" "custom_vcl" { - template = file("${path.module}/custom.vcl") - - vars = { - proxy_error_response = var.proxy_error_response - custom_vcl_backends = var.custom_vcl_backends - custom_vcl_recv = var.custom_vcl_recv - custom_vcl_recv_no_shield = var.custom_vcl_recv_no_shield - custom_vcl_recv_shield_only = var.custom_vcl_recv_shield_only - custom_vcl_error = var.custom_vcl_error - custom_vcl_deliver = var.custom_vcl_deliver - vcl_recv_default_action = var.caching == "true" ? "lookup" : "pass" - } -} - # resource performing bare-domain redirection to prefix; only for live resource "fastly_service_v1" "fastly_bare_domain_redirection" { name = "${var.bare_redirect_domain_name}-redirection"