From 6d631b1140f63692a126b8978aff5f8ccfdbb44b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20Torma?= Date: Mon, 1 Aug 2022 22:09:46 +0200 Subject: [PATCH] add cosmos memes --- azure-cosmosdb.tf | 19 +++++++++++++++++++ azure-resourcegroups.tf | 5 +++++ azure-staticwebapps.tf | 12 ++++++++++++ 3 files changed, 36 insertions(+) create mode 100644 azure-cosmosdb.tf diff --git a/azure-cosmosdb.tf b/azure-cosmosdb.tf new file mode 100644 index 0000000..e3de741 --- /dev/null +++ b/azure-cosmosdb.tf @@ -0,0 +1,19 @@ +resource "azurerm_cosmosdb_account" "cosmodb" { + name = "cosmosdb" + location = azurerm_resource_group.rg-cosmostest-staticwebapp-cosmosdb.location + resource_group_name = azurerm_resource_group.rg-cosmostest-staticwebapp.name + offer_type = "Standard" + kind = "GlobalDocumentDB" + enable_free_tier = true + + consistency_policy { + consistency_level = "BoundedStaleness" + max_interval_in_seconds = 300 + max_staleness_prefix = 100000 + } + + geo_location { + location = azurerm_resource_group.rg-cosmostest-staticwebapp-cosmosdb.location + failover_priority = 0 + } +} \ No newline at end of file diff --git a/azure-resourcegroups.tf b/azure-resourcegroups.tf index 4c6ec8e..9f08e16 100644 --- a/azure-resourcegroups.tf +++ b/azure-resourcegroups.tf @@ -32,3 +32,8 @@ resource "azurerm_resource_group" "rg-hhv-staticwebapp" { name = "rg-hhv-staticwebapp" location = "westeurope" } + +resource "azurerm_resource_group" "rg-cosmostest-staticwebapp-cosmosdb" { + name = "rg-cosmostest-staticwebapp-cosmosdb" + location = "westeurope" +} diff --git a/azure-staticwebapps.tf b/azure-staticwebapps.tf index 69ac9bf..c4c1397 100644 --- a/azure-staticwebapps.tf +++ b/azure-staticwebapps.tf @@ -69,3 +69,15 @@ resource "azurerm_static_site_custom_domain" "hhvtormakristofeu" { domain_name = "hhv.tormakristof.eu" validation_type = "cname-delegation" } + +resource "azurerm_static_site" "cosmostest" { + name = "cosmostest" + resource_group_name = azurerm_resource_group.rg-cosmostest-staticwebapp.name + location = azurerm_resource_group.rg-cosmostest-staticwebapp-cosmosdb.location +} + +resource "azurerm_static_site_custom_domain" "cosmostesttormakristofeu" { + static_site_id = azurerm_static_site.cosmostest.id + domain_name = "cosmostest.tormakristof.eu" + validation_type = "cname-delegation" +} \ No newline at end of file