feat: add Terraform configuration and initialization scripts for Azure backend

This commit is contained in:
2026-02-27 22:48:31 +01:00
parent 8be0eb7d90
commit c65c347ca5
4 changed files with 44 additions and 1 deletions

3
.gitignore vendored
View File

@@ -1,4 +1,5 @@
storage
test
**/.terraform
**/.terraform.lock.hcl
Caddyfile
*.env

4
test/backend.config Normal file
View File

@@ -0,0 +1,4 @@
storage_account_name = "terraform"
container_name = "tfstate"
key = "test.tfstate"
use_azuread_auth = true

3
test/init.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/usr/bin/env bash
terraform init -backend-config backend.config

35
test/main.tf Normal file
View File

@@ -0,0 +1,35 @@
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
}
random = {
source = "hashicorp/random"
}
}
backend "azurerm" {}
}
provider "azurerm" {
features {}
}
resource "random_password" "user1" {
length = 12
min_lower = 1
min_upper = 1
min_numeric = 1
min_special = 1
special = true
override_special = "!@#$"
}
resource "terraform_data" "password" {
input = random_password.user1.result
}
output "user1" {
value = terraform_data.password.output
}