Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,10 @@ yarn-error.log*
# Dependency directories
package-lock.json
pnpm-lock.yaml
yarn.lock
yarn.lock

# Terraform
.terraform/
*.tfstate
*.tfstate.backup
.terraform.lock.hcl
File renamed without changes.
8 changes: 8 additions & 0 deletions iac/terraform/deployments/shared/backend.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
terraform {
backend "azurerm" {
resource_group_name = "rg-tfstate"
storage_account_name = "stscryingtfstate"
container_name = "shared"
key = "terraform.tfstate"
}
}
15 changes: 15 additions & 0 deletions iac/terraform/deployments/shared/providers.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
terraform {
required_version = ">= 1.0.0"

required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~>3.0.0"
}
}
}

provider "azurerm" {
features {}
subscription_id = "6f889e85-5bc7-4b1e-a897-17aa4d0794a1"
}
30 changes: 30 additions & 0 deletions iac/terraform/deployments/shared/tfstate.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
resource "azurerm_resource_group" "tfstate" {
name = "rg-tfstate"
location = "East US"
}

resource "azurerm_storage_account" "tfstate" {
name = "stscryingtfstate"
resource_group_name = azurerm_resource_group.tfstate.name
location = azurerm_resource_group.tfstate.location
account_tier = "Standard"
account_replication_type = "LRS"
}

resource "azurerm_storage_container" "tfstate" {
name = "shared"
storage_account_name = azurerm_storage_account.tfstate.name
}

# Admin-only access to shared state
# resource "azurerm_role_assignment" "tfstate_admins" {
# scope = azurerm_storage_account.tfstate.id
# role_definition_name = "Storage Blob Data Owner"
# principal_id = var.admin_group_id # Only Admins can modify
# }

# resource "azurerm_role_assignment" "tfstate_read_only" {
# scope = azurerm_storage_account.tfstate.id
# role_definition_name = "Storage Blob Data Reader"
# principal_id = var.developer_group_id # Devs can only read
# }
Empty file.