This Terraform project deploys an Azure Virtual Network with management, data, and server subnets, network security groups, network interfaces, and a Virtual Machine configured with specific user data.
This setup demonstrate the basic ,without HA, load balancing proxy setup with interface for the client side and another interface for servers side within the data plan, and management interface for the control plane.
- Terraform installed on your local machine.
- Azure CLI installed and configured with your credentials.
To install Azure CLI, follow these steps:
-
Download and Install Azure CLI
For Windows, download the installer from Azure CLI Windows Installer.
For macOS, you can use Homebrew:
brew install azure-cli
For Linux, you can use a package manager like
aptfor Debian-based distributions:curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bashOr
yumfor Red Hat-based distributions:sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc sudo sh -c 'echo -e "[azure-cli] name=Azure CLI baseurl=https://packages.microsoft.com/yumrepos/azure-cli enabled=1 gpgcheck=1 gpgkey=https://packages.microsoft.com/keys/microsoft.asc" > /etc/yum.repos.d/azure-cli.repo' sudo yum install azure-cli
-
Verify the Installation
After installation, verify that Azure CLI is installed correctly by running:
az --version
-
Configure Azure CLI
Sign in and configure your Azure CLI with your credentials by running:
az login
You will be prompted to open a browser and log in with your Azure account credentials.
By ensuring that Azure CLI is installed and configured, you will be able to interact with Azure services from your local machine.
Clone this git repository to your local pc:
git clone https://github.com/Radware/azure-alteon-provisioning.gitCopy the example terraform.tfvars.example file to terraform.tfvars:
cp terraform.tfvars.example terraform.tfvarsEdit the terraform.tfvars file to customize the values according to your environment:
#Azure location (region)
location = "West Europe"
#Name of the resource group
resource_group_name = "MyADCResourceGroup"
#VNET main Subnet
vnet_cidr = "10.1.0.0/16"
subnet_cidrs = ["10.1.1.0/24", "10.1.2.0/24", "10.1.3.0/24"]
admin_user = "radware"
admin_password = "Admin123!"
vm_size = "Standard_DS3_v2"
# GEL primary URL
gel_url_primary = "http://primary.gel.example.com"
# GEL secondary URL
gel_url_secondary = "http://secondary.gel.example.com"
# GEL enterprise ID
gel_ent_id = "12345"
# GEL throughput in MB
gel_throughput_mb = 100
# GEL primary DNS
gel_dns_pri = "8.8.8.8"
# NTP primary server IP Address only
ntp_primary_server = "132.163.97.8"
.
.
.
To avoid the error the error “ResourcePurchaseValidationFailed” ,We need to accept the legal terms for the image before deploying the virtual machine. This is common for third-party or marketplace images in Azure. you may do it using the GUI console 1. Go to the Azure Marketplace. 2. Search for the image (radware-alteon-va). 3. Navigate to the image details page. 4. Read and accept the legal terms.
or using the following command:
az vm image terms accept --publisher radware --offer radware-alteon-va --plan radware-alteon-ng-va-adeInitialize your Terraform working directory, which will download the necessary provider plugins and set up the backend.
terraform initBefore applying the changes, you can run the terraform plan command to see a preview of the actions that Terraform will take to deploy your infrastructure.
terraform planFinally, apply the configuration to deploy the resources. Terraform will prompt you for confirmation before proceeding.
terraform apply- Virtual Network (VNet): A virtual network with a specified address space.
- Subnets: Management, data, and server subnets.
- Network Security Groups (NSGs): Define security rules to allow traffic for specific ports and protocols.
- Network Interfaces (NICs): Attached to the subnets.
- Public IP Address: Allocated and associated with the management network interface.
- Virtual Machine (VM): Configured with user data from a template file.
The userdata.tpl file is used to configure the VM instance.
It includes variables for admin credentials, GEL URLs, VM name, and syslog configuration.
The template file is populated with values from terraform.tfvars during the deployment.
To destroy the resources created by this Terraform configuration, run:
terraform destroy- Ensure that your Azure credentials are configured correctly.
- Review the security group rules and adjust as needed to match your security requirements.# azure-alteon-provisioning