Infrastructure-as-Code (IaC) for provisioning and configuring Azure resources using Terraform and Ansible — including automation scripts for Splunk, Crowdstrike, and Sapphire.
This repository is modularized by Azure resource types and includes both Terraform infrastructure provisioning and Ansible-based VM configuration.
| Folder | Description |
|---|---|
Terraform AKS/ |
Deploys Azure Kubernetes Service |
Terraform Application Gateway/ |
Creates a WAF-enabled Application Gateway |
Terraform CosmosDB/ |
Globally distributed Cosmos DB setup |
Terraform Load Balancer/ |
Deploys internal/external load balancers |
Terraform MySQL and Private end-point/ |
Provisions MySQL DB with private access |
Terraform Postgre DB and Private end-point/ |
PostgreSQL DB with secure private endpoint |
Terraform Storage Account Scripts/ |
Storage account provisioning scripts |
Terraform VM Scripts/ |
VM provisioning and Ansible bootstrap |
Terraform Vnet Scripts/ |
Virtual Network, subnets, NSGs configuration |
| Folder / File | Description |
|---|---|
automation_scripts.zip |
Contains Ansible automation playbooks for: • Splunk • Crowdstrike • Sapphire |
- Terraform v1.x
- Ansible v2.15+
- Azure CLI authenticated to your subscription
- SSH key pair for VM access (required by Ansible)
cd "<Terraform module>"
terraform init
terraform plan -out=tfplan
terraform apply tfplanOnce the VMs are provisioned:
cd "Terraform VM Scripts"
ansible-playbook -i hosts.ini install_chrome.yml --private-key /path/to/private_key.pem🔄 Customize your playbooks as per application setup (e.g., Splunk, Crowdstrike, Sapphire).
- Terraform provisions infrastructure — networks, databases, VMs, etc.
- Ansible configures the VMs by connecting over SSH.
- Scripts can install software (e.g., Splunk, Crowdstrike agents) and configure services.
# Deploy AKS Cluster
cd "Terraform AKS"
terraform init && terraform apply -auto-approve
# Provision VMs and configure with Ansible
cd "Terraform VM Scripts"
terraform init && terraform apply -auto-approve
ansible-playbook -i hosts.ini install_splunk.yml- Format code:
terraform fmt - Validate configurations:
terraform validate - Use
.gitignoreto exclude sensitive files (e.g.,*.tfvars, private keys) - Implement remote state backend for team environments (e.g., Azure Storage)
- Follow modular code structure via
modules/directory (recommended)
- Store sensitive credentials in Azure Key Vault
- Avoid hardcoding secrets in
.tfvarsor Ansible playbooks - Use Ansible Vault for encrypting sensitive config files
- Modularize Terraform scripts under a
modules/folder - Add CI/CD integration (GitHub Actions or Azure DevOps)
- Auto-document input/output variables per module
- Expand Ansible roles and reusable templates
If you're using the automation playbooks in the .zip file:
- Extract the archive.
- Navigate to each script (e.g.,
install_splunk.yml,install_crowdstrike.yml) - Review variables and inventory in
hosts.ini - Ensure proper permissions on SSH keys
This project is licensed under the MIT License — you are free to use, modify, and distribute this software with proper attribution.
For bugs or feature requests:
- Open a GitHub Issue with logs and context
- Mention the module or script being used
Pull Requests are welcome!
- Fork this repository
- Create a feature branch
- Commit and push your changes
- Open a pull request for review
Happy Automating! 🚀