Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/genzo1977/avd-test-env
Terraform scripts to create a simple AVD environment.
https://github.com/genzo1977/avd-test-env
Last synced: about 9 hours ago
JSON representation
Terraform scripts to create a simple AVD environment.
- Host: GitHub
- URL: https://github.com/genzo1977/avd-test-env
- Owner: genzo1977
- Created: 2024-12-11T13:37:56.000Z (about 1 month ago)
- Default Branch: main
- Last Pushed: 2024-12-11T19:55:52.000Z (about 1 month ago)
- Last Synced: 2024-12-11T20:35:39.908Z (about 1 month ago)
- Language: HCL
- Size: 0 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
To create a remote backend for Terraform in Azure, you can use Azure Storage to store the Terraform state files and Azure Cosmos DB or Azure Blob's native locking mechanism to manage state locking. Here's how to configure it using Azure Storage.
### Prerequisites:
1. Install Terraform on the local machine`choco install -y terraform`
2. Install Azure CLI
https://learn.microsoft.com/en-us/cli/azure/install-azure-cli-windows?tabs=azure-cli
3. Authenticate via Azure CLI
4. Clone this repo:`git clone https://github.com/genzo1977/avd-test-env.git`
5. Change directory:
`cd .\avd-test-env\`
6. Log into Azure:
`az login`
### Steps to Initialize and Apply:
1. Run `terraform init` to initialize the backend.
2. Run `terraform plan` to see what you are about to apply
3. Run `terraform apply` to apply the infrastructure and store the state remotely.
4. Update Terraform provider block in your architecture directory with the below
```
backend "azurerm" {
resource_group_name = "your-resource-group"
storage_account_name = "yourstorageaccount"
container_name = "your-container"
key = "terraform.tfstate"
}
```