This project uses Terraform to manage and provision infrastructure on Azure. It includes the configuration of resources such as resource groups, virtual networks, subnets, network interfaces, and virtual machines.
- Overview
- Project Structure
- Prerequisites
- Setup
- Provisioned Resources
- Outputs
- Cleanup
- Security Best Practices
- Contribution
- License
terraform/
├── main.tf
├── variables.tf
├── outputs.tf
├── providers.tf
├── modules/
│ ├── network/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
│ ├── vm/
│ │ ├── main.tf
│ │ ├── variables.tf
│ │ └── outputs.tf
└── README.md
- Terraform v1.0+
- Azure CLI v2.30.0+
- An Azure account
az login
terraform init
Edit the terraform.tfvars
file with appropriate values:
resource_group_name = "rg-olimpiadas"
location = "eastus"
vnet_name = "vnet-olimpiadas"
address_space = ["10.0.0.0/16"]
subnet01_name = "sub-olimpiadas01"
subnet01_prefix = "10.0.1.0/24"
subnet02_name = "sub-olimpiadas02"
subnet02_prefix = "10.0.2.0/24"
nsg_name = "nsg-olimpiadas"
tags = {
Environment = "Test"
Project = "Olimpiadas"
}
vm_windows_name = "vm-windows"
vm_windows_username = "your_user"
vm_windows_password = "your_password"
vm_linux_name = "vm-linux"
vm_linux_username = "your_user"
vm_linux_ssh_key = "your_ssh_public_key"
terraform apply
- Resource Group:
rg-olimpiadas
- Virtual Network:
vnet-olimpiadas
- Subnets:
sub-olimpiadas01
sub-olimpiadas02
- Network Security Group:
nsg-olimpiadas
- Virtual Machines:
- Windows VM:
vm-windows
- Linux VM:
vm-linux
- Windows VM:
Key outputs of this project include:
- Resource Group ID
- Virtual Network Name
- Subnet IDs
- Public IP Addresses of VMs
To destroy the provisioned infrastructure, run:
terraform destroy
- Use Azure Key Vault: Store sensitive information such as passwords and SSH keys in Azure Key Vault to enhance security.
- Environment Variables: Avoid hardcoding sensitive information in the codebase. Use environment variables instead.
- Access Controls: Implement strict access controls and role-based access (RBAC) to limit access to sensitive resources.
We welcome contributions! Please follow these guidelines:
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Make your changes.
- Commit your changes (
git commit -m 'Add new feature'
). - Push to the branch (
git push origin feature-branch
). - Open a pull request.
Please ensure your code adheres to the project's coding standards and includes appropriate tests.
This project is licensed under the MIT License. See the LICENSE file for more details.
This `README.md` should now be more comprehensive, consistent, and easier to navigate, while also encouraging better security practices and community contributions.