From c43ca920b2afad839b7cc8ac72949571827d5af1 Mon Sep 17 00:00:00 2001 From: Connor O'Kane Date: Thu, 4 Jul 2024 22:59:23 +0100 Subject: [PATCH] adding config + pipeline --- components/main.tf | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/components/main.tf b/components/main.tf index 497ea3b72..dfcd7074e 100644 --- a/components/main.tf +++ b/components/main.tf @@ -1,3 +1,32 @@ +module "tags" { + source = "git::https://github.com/hmcts/terraform-module-common-tags.git?ref=master" + environment = var.env + product = var.product + builtFrom = var.builtFrom +} + +resource "azurerm_resource_group" "rg" { + name = var.resource_group_name + location = var.location + tags = module.tags.common_tags +} + +resource "azurerm_storage_account" "sa" { + name = var.storage_account_name + resource_group_name = azurerm_resource_group.rg.name + location = azurerm_resource_group.rg.location + account_tier = "Standard" + account_replication_type = "LRS" + tags = module.tags.common_tags +} + +resource "azurerm_storage_container" "tfstate" { + name = "tfstate" + storage_account_name = azurerm_storage_account.sa.name + container_access_type = "private" + +} + # Output existing branches for debugging output "existing_branches" { value = data.github_branch.existing_branches @@ -40,7 +69,7 @@ resource "github_branch_protection_v3" "branch_protection" { lifecycle { ignore_changes = [ - # Allows the branch protection rules to reapply in the case of a rule being deleted. + # Ignore changes to the branch protection rules etag ] }