Skip to content

Commit acd4226

Browse files
Add Terraform test for backend resource setup
Introduces a test configuration and supporting Terraform code to provision Azure resources for backend state storage. This includes a resource group, storage account, and storage container, enabling automated validation of backend setup for GitHub runners.
1 parent 5e5cbb2 commit acd4226

2 files changed

Lines changed: 40 additions & 0 deletions

File tree

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
run "setup_backend_resources" {
2+
command = apply
3+
4+
module {
5+
source = "./tests/backend-setup"
6+
}
7+
}
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
terraform {
2+
required_version = ">= 1.0"
3+
4+
required_providers {
5+
azurerm = {
6+
source = "hashicorp/azurerm"
7+
version = "~> 3.0"
8+
}
9+
}
10+
}
11+
12+
provider "azurerm" {
13+
features {}
14+
}
15+
16+
resource "azurerm_resource_group" "tfstate" {
17+
name = "dbatools-ci-runners"
18+
location = "East US"
19+
}
20+
21+
resource "azurerm_storage_account" "tfstate" {
22+
name = "dbatoolstfstate"
23+
resource_group_name = azurerm_resource_group.tfstate.name
24+
location = azurerm_resource_group.tfstate.location
25+
account_tier = "Standard"
26+
account_replication_type = "LRS"
27+
}
28+
29+
resource "azurerm_storage_container" "tfstate" {
30+
name = "tfstate"
31+
storage_account_name = azurerm_storage_account.tfstate.name
32+
container_access_type = "private"
33+
}

0 commit comments

Comments
 (0)