@@ -4,189 +4,10 @@ Azure virtual machine scale sets let you create and manage a group of identical,
44
55This module deploys Windows or Linux virtual machine scale sets with Public / Private Load Balancer support and many other features.
66
7- ## Module Usage
7+ ## Module Usage for
88
9- ### Linux Virtual Machines Scale Sets
10-
11- Following example creates Linux virtual machine scale sets with load balancer and auto scaling features.
12-
13- ``` hcl
14- # Azurerm provider configuration
15- provider "azurerm" {
16- features {}
17- }
18-
19- module "vmscaleset" {
20- source = "kumarvna/vm-scale-sets/azurerm"
21- version = "2.2.0"
22-
23- # Resource Group and location, VNet and Subnet detials (Required)
24- resource_group_name = "rg-shared-westeurope-01"
25- virtual_network_name = "vnet-shared-hub-westeurope-001"
26- subnet_name = "snet-management"
27- vmscaleset_name = "testvmss"
28-
29- # (Optional) To enable Azure Monitoring and install log analytics agents
30- # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
31- log_analytics_workspace_name = var.log_analytics_workspace_name
32-
33- # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
34- # Defaults to `false`
35- deploy_log_analytics_agent = false
36-
37- # This module support multiple Pre-Defined Linux and Windows Distributions.
38- # These distributions support the Automatic OS image upgrades in virtual machine scale sets
39- # Linux images: ubuntu1804, ubuntu1604, centos75, coreos
40- # Windows Images: windows2012r2dc, windows2016dc, windows2019dc, windows2016dccore
41- # Specify the RSA key for production workloads and set generate_admin_ssh_key argument to false
42- # When you use Autoscaling feature, instances_count will become default and minimum instance count.
43- os_flavor = "linux"
44- linux_distribution_name = "ubuntu1804"
45- generate_admin_ssh_key = false
46- admin_ssh_key_data = "~/.ssh/id_rsa.pub"
47- instances_count = 2
48-
49- # Public and private load balancer support for VM scale sets
50- # Specify health probe port to allow LB to detect the backend endpoint status
51- # Standard Load Balancer helps load-balance TCP and UDP flows on all ports simultaneously
52- # Specify the list of ports based on your requirement for Load balanced ports
53- # for additional data disks, provide the list for required size for the disk.
54- load_balancer_type = "public"
55- load_balancer_health_probe_port = 80
56- load_balanced_port_list = [80, 443]
57- additional_data_disks = [100, 200]
58-
59- # Enable Auto scaling feature for VM scaleset by set argument to true.
60- # Instances_count in VMSS will become default and minimum instance count.
61- # Automatically scale out the number of VM instances based on CPU Average only.
62- enable_autoscale_for_vmss = true
63- minimum_instances_count = 2
64- maximum_instances_count = 5
65- scale_out_cpu_percentage_threshold = 80
66- scale_in_cpu_percentage_threshold = 20
67-
68- # Network Seurity group port allow definitions for each Virtual Machine
69- # NSG association to be added automatically for all network interfaces.
70- # SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
71- # For production environments, we recommend using a VPN or private connection
72- nsg_inbound_rules = [
73- {
74- name = "http"
75- destination_port_range = "80"
76- source_address_prefix = "*"
77- },
78-
79- {
80- name = "https"
81- destination_port_range = "443"
82- source_address_prefix = "*"
83- },
84- ]
85-
86- # Adding TAG's to your Azure resources (Required)
87- # ProjectName and Env are already declared above, to use them here, create a varible.
88- tags = {
89- ProjectName = "demo-internal"
90- Env = "dev"
91- 92- BusinessUnit = "CORP"
93- ServiceClass = "Gold"
94- }
95- }
96- ```
97-
98- ### Windows Virtual Machines Scale Sets
99-
100- Following example creates Windows virtual machine scale sets with load balancer and auto scaling features.
101-
102- ``` hcl
103- # Azurerm provider configuration
104- provider "azurerm" {
105- features {}
106- }
107-
108- module "vmscaleset" {
109- source = "kumarvna/vm-scale-sets/azurerm"
110- version = "2.2.0"
111-
112- # Resource Group and location, VNet and Subnet detials (Required)
113- resource_group_name = "rg-shared-westeurope-01"
114- virtual_network_name = "vnet-shared-hub-westeurope-001"
115- subnet_name = "snet-appgateway"
116- vmscaleset_name = "testvmss"
117- vm_computer_name = "websrv1"
118-
119- # (Optional) To enable Azure Monitoring and install log analytics agents
120- # (Optional) Specify `storage_account_name` to save monitoring logs to storage.
121- log_analytics_workspace_name = var.log_analytics_workspace_name
122-
123- # Deploy log analytics agents to virtual machine. Log analytics workspace name required.
124- # Defaults to `false`
125- deploy_log_analytics_agent = false
126-
127- # This module support multiple Pre-Defined Linux and Windows Distributions.
128- # These distributions support the Automatic OS image upgrades in virtual machine scale sets
129- # Linux images: ubuntu1804, ubuntu1604, centos75, coreos
130- # Windows Images: windows2012r2dc, windows2016dc, windows2019dc, windows2016dccore
131- # Specify the RSA key for production workloads and set generate_admin_ssh_key argument to false
132- # When you use Autoscaling feature, instances_count will become default and minimum instance count.
133- os_flavor = "windows"
134- windows_distribution_name = "windows2019dc"
135- instances_count = 2
136- admin_username = "azureadmin"
137- admin_password = "P@$$w0rd1234!"
138-
139- # Public and private load balancer support for VM scale sets
140- # Specify health probe port to allow LB to detect the backend endpoint status
141- # Standard Load Balancer helps load-balance TCP and UDP flows on all ports simultaneously
142- # Specify the list of ports based on your requirement for Load balanced ports
143- # for additional data disks, provide the list for required size for the disk.
144- load_balancer_type = "public"
145- load_balancer_health_probe_port = 80
146- load_balanced_port_list = [80, 443]
147- additional_data_disks = [100, 200]
148-
149- # Enable Auto scaling feature for VM scaleset by set argument to true.
150- # Instances_count in VMSS will become default and minimum instance count.
151- # Automatically scale out the number of VM instances based on CPU Average only.
152- enable_autoscale_for_vmss = true
153- minimum_instances_count = 2
154- maximum_instances_count = 5
155- scale_out_cpu_percentage_threshold = 80
156- scale_in_cpu_percentage_threshold = 20
157-
158- # Deploy IIS server minimal installation on VMMS instances
159- intall_iis_server_on_instances = false
160-
161- # Network Seurity group port allow definitions for each Virtual Machine
162- # NSG association to be added automatically for all network interfaces.
163- # SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
164- # For production environments, we recommend using a VPN or private connection
165- nsg_inbound_rules = [
166- {
167- name = "http"
168- destination_port_range = "80"
169- source_address_prefix = "*"
170- },
171-
172- {
173- name = "https"
174- destination_port_range = "443"
175- source_address_prefix = "*"
176- },
177- ]
178-
179- # Adding TAG's to your Azure resources (Required)
180- # ProjectName and Env are already declared above, to use them here, create a varible.
181- tags = {
182- ProjectName = "demo-internal"
183- Env = "dev"
184- 185- BusinessUnit = "CORP"
186- ServiceClass = "Gold"
187- }
188- }
189- ```
9+ * [ Linux Virtual Machine Scale Set] ( linux_vm_scale_sets/ )
10+ * [ Windows Virtual Machine Scale Set] ( windows_vm_scale_sets/ )
19011
19112## Terraform Usage
19213
0 commit comments