diff --git a/.gitignore b/.gitignore index 15c10aa..06a9fa7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ storage -test +**/.terraform +**/.terraform.lock.hcl Caddyfile *.env diff --git a/test/backend.config b/test/backend.config new file mode 100644 index 0000000..91160d6 --- /dev/null +++ b/test/backend.config @@ -0,0 +1,4 @@ +storage_account_name = "terraform" +container_name = "tfstate" +key = "test.tfstate" +use_azuread_auth = true diff --git a/test/init.sh b/test/init.sh new file mode 100755 index 0000000..7130f57 --- /dev/null +++ b/test/init.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +terraform init -backend-config backend.config diff --git a/test/main.tf b/test/main.tf new file mode 100644 index 0000000..613d2bc --- /dev/null +++ b/test/main.tf @@ -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 +}