This repository contains Terraform code to manage DNS zones in Azure. The goal is to automate the creation, updating, and deletion of DNS records for specified domains using Infrastructure as Code (IaC) principles.
The following DNS zones are managed by this repository:
benchspace.co
benchspace.uk
mattandjen.co.uk
matthewjwhite.co.uk
objectatelier.co.uk
simonwhitedesign.co.uk
theweaversmiths.co.uk
tonyandlizwhite.co.uk
Before you begin, ensure you have the following installed:
- Terraform v1.0.0 or later
- Azure CLI v2.0 or later
- An Azure account with the necessary permissions to manage DNS zones
-
Clone the repository:
git clone https://github.com/MattWhite-personal/dns-iac.git cd dns-iac
-
Initialize Terraform:
terraform init
-
Configure your Azure credentials:
az login
-
Create a
terraform.tfvars
file:touch terraform.tfvars
-
Add your variables to
terraform.tfvars
:client_id = "your_azure_app_registration" client_secret = "your_azure_client_secret" tenant_id = "your_azure_tenant_id" subscription_id = "your_azure_subscription_id" permitted_ips = []
-
Plan the Terraform configuration:
terraform plan -var-file="terraform.tfvars"
-
Apply the Terraform configuration:
terraform apply -var-file="terraform.tfvars"
│ .gitignore
│ LICENSE
│
├───.github
│ │ dependabot.yml
│ │
│ └───workflows
│
└───terraform
│ main.tf
│ outputs.tf
│ remote_state.tf
│ terraform.tfstate
│ terraform.tfstate.backup
│ variables.tf
│ zone_<zonename>.tf
│
└───module
├───dnsrecords
│ main.tf
│ outputs.tf
│ variables.tf
│
└───mtasts
main.tf
variables.tf
Contributions are welcome! Please submit a pull request or open an issue to discuss any changes.
This project is licensed under the GPL License - see the LICENSE file for details.
For any questions or support, please open an issue.