π Collection of secure, well-designed, and reusable Terraform modules for Microsoft Azure π
Inspired by the excellent terraform-aws-modules organization, this project provides a comprehensive collection of community-maintained Terraform modules for Azure services. Each module follows security best practices, implements proper tagging, and includes comprehensive documentation.
- Security First: All modules implement Azure security best practices by default
- Production Ready: Modules are battle-tested and suitable for production environments
- Consistent Structure: Standardized module structure for easy adoption and maintenance
- Community Driven: Open-source project welcoming contributions from the community
- Comprehensive Documentation: Each module includes detailed documentation and examples
| Module | Description | Status |
|---|---|---|
| azure-resource-group | Create and manage Azure Resource Groups | β Available |
| azure-virtual-network | Create secure Virtual Networks with subnets | β Available |
| azure-network-security-group | Network Security Groups with predefined rules | β Available |
| azure-key-vault | Secure Key Vault with access policies | β Available |
| azure-storage-account | Secure Storage Account with encryption | β Available |
| Module | Description | Status |
|---|---|---|
| azure-virtual-machine | Virtual Machines with security hardening | π§ In Progress |
| azure-vmss | Virtual Machine Scale Sets | π Planned |
| azure-aks | Azure Kubernetes Service | π Planned |
| azure-container-instances | Container Instances | π Planned |
| Module | Description | Status |
|---|---|---|
| azure-sql-database | SQL Database with security features | π Planned |
| azure-postgresql | PostgreSQL Flexible Server | π Planned |
| azure-mysql | MySQL Flexible Server | π Planned |
| azure-cosmos-db | Cosmos DB with encryption | π Planned |
| Module | Description | Status |
|---|---|---|
| azure-rbac | Role-Based Access Control | π Planned |
| azure-managed-identity | Managed Identity assignments | π Planned |
| azure-private-endpoint | Private Endpoints for services | π Planned |
| Module | Description | Status |
|---|---|---|
| azure-log-analytics | Log Analytics Workspace | π Planned |
| azure-application-insights | Application Insights | π Planned |
# Example: Creating a Resource Group
module "resource_group" {
source = "github.com/Cloudgeni-ai/terraform-azure-modules//modules/azure-resource-group"
name = "my-rg"
location = "East US"
tags = {
Environment = "Production"
Project = "MyProject"
}
}
# Example: Creating a Virtual Network
module "virtual_network" {
source = "github.com/Cloudgeni-ai/terraform-azure-modules//modules/azure-virtual-network"
name = "my-vnet"
location = module.resource_group.location
resource_group_name = module.resource_group.name
address_space = ["10.0.0.0/16"]
subnets = [
{
name = "subnet1"
address_prefix = "10.0.1.0/24"
},
{
name = "subnet2"
address_prefix = "10.0.2.0/24"
}
]
tags = {
Environment = "Production"
Project = "MyProject"
}
}Each module follows this standardized structure:
modules/azure-service-name/
βββ main.tf # Main resource definitions
βββ variables.tf # Input variables
βββ outputs.tf # Output values
βββ versions.tf # Terraform and provider version constraints
βββ README.md # Module documentation
βββ examples/ # Usage examples
βββ basic/
βββ complete/
βββ advanced/
All modules implement Azure security best practices:
- Encryption: Data encryption at rest and in transit by default
- Network Security: Private endpoints and network restrictions
- Identity: Managed identities where applicable
- Monitoring: Diagnostic settings and logging enabled
- Access Control: Least privilege access patterns
- Compliance: Alignment with Azure Security Benchmark
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create a feature branch
- Make your changes following our module standards
- Add tests and documentation
- Submit a pull request
- π Report Issues
- π¬ Discussions
- π Documentation
This project is licensed under the Apache 2.0 License - see the LICENSE file for details.
- Inspired by the excellent terraform-aws-modules project
- Thanks to all contributors who help make this project better
- Special thanks to the Azure community for feedback and suggestions
Made with β€οΈ by the Cloudgeni team and open-source community