From ebe236a98269e051211cabf3c933632fdd291811 Mon Sep 17 00:00:00 2001 From: Adam Marczak Date: Wed, 10 Jul 2019 01:58:58 +0200 Subject: [PATCH 1/3] Update TF main --- news-infrastructure/main.tf | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/news-infrastructure/main.tf b/news-infrastructure/main.tf index 103c124..2ca2314 100644 --- a/news-infrastructure/main.tf +++ b/news-infrastructure/main.tf @@ -14,7 +14,7 @@ variable "zone" { } variable "cf_account_id" { - "default" = "d5b58a2229c11224b000073d2b8e33d3" + default = "d5b58a2229c11224b000073d2b8e33d3" type = "string" } @@ -65,7 +65,7 @@ resource "cloudflare_record" "domain" { } resource "null_resource" "cloudflare_worker" { - triggers { + triggers = { build_number = "${timestamp()}" } @@ -88,7 +88,7 @@ resource "cloudflare_worker_route" "route" { } resource "null_resource" "cloudflare_kv_settings" { - triggers { + triggers = { build_number = "${timestamp()}" } @@ -173,18 +173,16 @@ resource "azurerm_function_app" "functions" { storage_connection_string = "${azurerm_storage_account.storage.primary_connection_string}" version = "~2" - connection_string = [ - { + connection_string { name = "AccountStorage-Conn" type = "Custom" value = "${azurerm_storage_account.storage.primary_connection_string}" - }, - ] + } app_settings = { - "APPINSIGHTS_INSTRUMENTATIONKEY" = "${azurerm_application_insights.appinsights.instrumentation_key}" - "AccountStorage-Name" = "${azurerm_storage_account.storage.name}" - "WEBSITE_RUN_FROM_PACKAGE" = "1" + APPINSIGHTS_INSTRUMENTATIONKEY = "${azurerm_application_insights.appinsights.instrumentation_key}" + AccountStorage-Name = "${azurerm_storage_account.storage.name}" + WEBSITE_RUN_FROM_PACKAGE = "1" } } @@ -195,8 +193,8 @@ resource "azurerm_template_deployment" "function-settings" { template_body = "${file("function-settings.json")}" - parameters { - "name" = "${azurerm_function_app.functions.name}" + parameters = { + name = "${azurerm_function_app.functions.name}" } depends_on = [ @@ -211,13 +209,13 @@ resource "azurerm_template_deployment" "logicapp" { template_body = "${file("logic-apps.json")}" - parameters { - "queueApiConnectionName" = "azurequeues" - "storageAccountName" = "${azurerm_storage_account.storage.name}" - "storageAccountKey" = "${azurerm_storage_account.storage.primary_access_key}" - "rssApiConnectionName" = "rss" - "logicAppName" = "${terraform.workspace}-news-la" - "feedUrlList" = "https://azurecomcdn.azureedge.net/en-us/blog/feed/" + parameters = { + queueApiConnectionName = "azurequeues" + storageAccountName = "${azurerm_storage_account.storage.name}" + storageAccountKey = "${azurerm_storage_account.storage.primary_access_key}" + rssApiConnectionName = "rss" + logicAppName = "${terraform.workspace}-news-la" + feedUrlList = "https://azurecomcdn.azureedge.net/en-us/blog/feed/" } depends_on = [ From 68686677eef938e017c07b49a011f6cec3f215d8 Mon Sep 17 00:00:00 2001 From: Adam Marczak Date: Wed, 10 Jul 2019 02:00:57 +0200 Subject: [PATCH 2/3] logic-app change name --- news-infrastructure/logic-apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news-infrastructure/logic-apps.json b/news-infrastructure/logic-apps.json index 2fc92df..add04c2 100644 --- a/news-infrastructure/logic-apps.json +++ b/news-infrastructure/logic-apps.json @@ -92,7 +92,7 @@ { "type": "Microsoft.Logic/workflows", "apiVersion": "2017-07-01", - "name": "[concat(parameters('logicAppName'),'-',padLeft(copyIndex(),3,'0'))]", + "name": "[concat(parameters('logicAppName'),'-la-',padLeft(copyIndex(),3,'0'))]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Web/connections', parameters('rssApiConnectionName'))]", From 2e475ce102bb3f41abec003538187216c1168f59 Mon Sep 17 00:00:00 2001 From: Adam Marczak Date: Wed, 10 Jul 2019 21:18:57 +0200 Subject: [PATCH 3/3] reverted --- news-infrastructure/logic-apps.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/news-infrastructure/logic-apps.json b/news-infrastructure/logic-apps.json index add04c2..2fc92df 100644 --- a/news-infrastructure/logic-apps.json +++ b/news-infrastructure/logic-apps.json @@ -92,7 +92,7 @@ { "type": "Microsoft.Logic/workflows", "apiVersion": "2017-07-01", - "name": "[concat(parameters('logicAppName'),'-la-',padLeft(copyIndex(),3,'0'))]", + "name": "[concat(parameters('logicAppName'),'-',padLeft(copyIndex(),3,'0'))]", "location": "[resourceGroup().location]", "dependsOn": [ "[resourceId('Microsoft.Web/connections', parameters('rssApiConnectionName'))]",