Skip to content

Commit 9434927

Browse files
authored
Merge pull request #6 from kumarvna/develop
adding terraform v0.15 support
2 parents a8f0c73 + 4c79ce2 commit 9434927

File tree

16 files changed

+2230
-168
lines changed

16 files changed

+2230
-168
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
# .tfstate files
55
*.tfstate
66
*.tfstate.*
7+
*.terraform.lock.hcl
78

89
# Crash log files
910
crash.log

README.md

Lines changed: 30 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,24 +20,28 @@ These types of resources supported:
2020
```hcl
2121
module "vmscaleset" {
2222
source = "kumarvna/vm-scale-sets/azurerm"
23-
version = "2.0.0"
23+
version = "2.1.0"
2424
2525
# Resource Group and location, VNet and Subnet detials (Required)
26-
resource_group_name = "rg-hub-demo-internal-shared-westeurope-001"
27-
virtual_network_name = "vnet-default-hub-westeurope"
28-
subnet_name = "snet-management-default-hub-westeurope"
26+
resource_group_name = "rg-shared-westeurope-01"
27+
virtual_network_name = "vnet-shared-hub-westeurope-001"
28+
subnet_name = "snet-management"
2929
vmscaleset_name = "testvmss"
3030
3131
# (Optional) To enable Azure Monitoring and install log analytics agents
32-
log_analytics_workspace_name = var.log_analytics_workspace_id
33-
hub_storage_account_name = var.hub_storage_account_id
32+
log_analytics_workspace_name = var.log_analytics_workspace_name
33+
storage_account_name = var. storage_account_name
34+
35+
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
36+
# Defaults to `false`
37+
deploy_log_analytics_agent = false
3438
3539
# This module support multiple Pre-Defined Linux and Windows Distributions.
3640
# These distributions support the Automatic OS image upgrades in virtual machine scale sets
3741
# Linux images: ubuntu1804, ubuntu1604, centos75, coreos
3842
# Windows Images: windows2012r2dc, windows2016dc, windows2019dc, windows2016dccore
3943
# Specify the RSA key for production workloads and set generate_admin_ssh_key argument to false
40-
# When you use Autoscaling feature, instances_count will become default and minimum instance count.
44+
# When you use Autoscaling feature, instances_count will become default and minimum instance count.
4145
os_flavor = "linux"
4246
linux_distribution_name = "ubuntu1804"
4347
generate_admin_ssh_key = false
@@ -48,15 +52,15 @@ module "vmscaleset" {
4852
# Specify health probe port to allow LB to detect the backend endpoint status
4953
# Standard Load Balancer helps load-balance TCP and UDP flows on all ports simultaneously
5054
# Specify the list of ports based on your requirement for Load balanced ports
51-
# for additional data disks, provide the list for required size for the disk.
55+
# for additional data disks, provide the list for required size for the disk.
5256
load_balancer_type = "public"
5357
load_balancer_health_probe_port = 80
5458
load_balanced_port_list = [80, 443]
5559
additional_data_disks = [100, 200]
5660
57-
# Enable Auto scaling feature for VM scaleset by set argument to true.
61+
# Enable Auto scaling feature for VM scaleset by set argument to true.
5862
# Instances_count in VMSS will become default and minimum instance count.
59-
# Automatically scale out the number of VM instances based on CPU Average only.
63+
# Automatically scale out the number of VM instances based on CPU Average only.
6064
enable_autoscale_for_vmss = true
6165
minimum_instances_count = 2
6266
maximum_instances_count = 5
@@ -65,7 +69,7 @@ module "vmscaleset" {
6569
6670
# Network Seurity group port allow definitions for each Virtual Machine
6771
# NSG association to be added automatically for all network interfaces.
68-
# SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
72+
# SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
6973
# For production environments, we recommend using a VPN or private connection
7074
nsg_inbound_rules = [
7175
{
@@ -82,7 +86,7 @@ module "vmscaleset" {
8286
]
8387
8488
# Adding TAG's to your Azure resources (Required)
85-
# ProjectName and Env are already declared above, to use them here, create a varible.
89+
# ProjectName and Env are already declared above, to use them here, create a varible.
8690
tags = {
8791
ProjectName = "demo-internal"
8892
Env = "dev"
@@ -119,7 +123,7 @@ If the pre-defined Windows or Linux variants are not sufficient then, you can sp
119123
```hcl
120124
module "vmscaleset" {
121125
source = "kumarvna/vm-scale-sets/azurerm"
122-
version = "2.0.0"
126+
version = "2.1.0"
123127
124128
# .... omitted
125129
@@ -232,7 +236,7 @@ In the Source and Destination columns, `VirtualNetwork`, `AzureLoadBalancer`, an
232236
```hcl
233237
module "vmscaleset" {
234238
source = "kumarvna/vm-scale-sets/azurerm"
235-
version = "2.0.0"
239+
version = "2.1.0"
236240
237241
# .... omitted
238242
@@ -292,7 +296,7 @@ End Date of the Project|Date when this application, workload, or service is plan
292296
```hcl
293297
module "vmscaleset" {
294298
source = "kumarvna/vm-scale-sets/azurerm"
295-
version = "2.0.0"
299+
version = "2.1.0"
296300
297301
# Resource Group, location, VNet and Subnet details
298302
resource_group_name = "rg-hub-tieto-internal-shared-westeurope-001"
@@ -314,13 +318,13 @@ module "vmscaleset" {
314318
Name | Version
315319
-----|--------
316320
terraform | >= 0.13
317-
azurerm | ~> 2.27.0
321+
azurerm | >= 2.59.0
318322

319323
## Providers
320324

321325
| Name | Version |
322326
|------|---------|
323-
azurerm | 2.27.0
327+
azurerm | 2.59.0
324328
random | n/a
325329
tls | n/a
326330

@@ -334,9 +338,12 @@ Name | Description | Type | Default
334338
`subnet_name`|The name of the subnet to use in VM scale set|string |`""`
335339
`vmscaleset_name`|Specifies the name of the virtual machine scale set resource|string | `""`
336340
`log_analytics_workspace_name`|The name of log analytics workspace name|string | `""`
337-
`hub_storage_account_name`|The name of the hub storage account to store logs|string | `""`
341+
`storage_account_name`|The name of the hub storage account to store logs|string | `""`
342+
`enable_load_balancer`|Controls if public load balancer should be created|sting|`true`
338343
`load_balancer_sku`|The SKU of the Azure Load Balancer. Accepted values are `Basic` and `Standard`|string | `"Standard"`
339344
`load_balancer_type`|Controls the type of load balancer should be created. Possible values are `public` and `private`|string | `"private"`
345+
`public_ip_allocation_method`|Defines the allocation method for this IP address. Possible values are `Static` or `Dynamic`|string|`Static`
346+
`public_ip_sku`|The SKU of the Public IP. Accepted values are `Basic` and `Standard`|string|`Standard`
340347
`enable_lb_nat_pool`|If enabled load balancer NAT pool will be created for SSH if flavor is Linux and for RDP if flavor is windows|string|`false`
341348
`nat_pool_frontend_ports`|Optional override for default NAT ports|list(number)|`[50000, 50119]`
342349
`os_flavor`|Specify the flavor of the operating system image to deploy Virtual Machine. Possible values are `windows` and `linux`|string |`"windows"`
@@ -363,6 +370,7 @@ Name | Description | Type | Default
363370
`disable_password_authentication`|Should Password Authentication be disabled on this Virtual Machine. Applicable to Linux Virtual machine|string|`true`
364371
`admin_username`|The username of the local administrator used for the Virtual Machine|string|`"azureadmin"`
365372
`admin_password`|The Password which should be used for the local-administrator on the Virtual Machines|string|`null`
373+
`random_password_length`|The desired length of random password created by this module|number|`24`
366374
`private_ip_address_allocation_type`|The allocation method used for the Private IP Address. Possible values are Dynamic and Static.|string|`false`
367375
`lb_private_ip_address`|The Static Private IP Address to assign to the Load Balancer. This is valid only when `private_ip_address_allocation` is set to `Static`.|string|`null`
368376
`enable_ip_forwarding`|Should IP Forwarding be enabled?|string|`false`
@@ -376,6 +384,9 @@ Name | Description | Type | Default
376384
`scale_out_cpu_percentage_threshold`|Specifies the threshold % of the metric that triggers the scale out action.|number|80
377385
`scale_in_cpu_percentage_threshold`|Specifies the threshold % of the metric that triggers the scale in action.|number|20
378386
`scaling_action_instances_number`|The number of instances involved in the scaling action|number|`1`
387+
`intall_iis_server_on_instances`|Install ISS server on every Instance in the VM scale set|string|`false`
388+
`vm_time_zone`|Specifies the Time Zone which should be used by the Virtual Machine. Ex. `"UTC"` or `"W. Europe Standard Time"` [The possible values are defined here](https://jackstromberg.com/2017/01/list-of-time-zones-consumed-by-azure/) |string|`null`
389+
`deploy_log_analytics_agent`|Install log analytics agent to windows or linux VM scaleset instances|string|`false`
379390
`Tags`|A map of tags to add to all resources|map|`{}`
380391

381392
## Outputs
@@ -400,7 +411,7 @@ Name | Description | Type | Default
400411

401412
## Resource Graph
402413

403-
![Resource Graph](graph.png)
414+
![Resource Graph](graph.svg)
404415

405416
## Authors
406417

examples/README.md

Lines changed: 35 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -13,24 +13,28 @@ Following example creates Linux virtual machine scale sets with load balancer an
1313
```hcl
1414
module "vmscaleset" {
1515
source = "kumarvna/vm-scale-sets/azurerm"
16-
version = "2.0.0"
16+
version = "2.1.0"
1717
1818
# Resource Group and location, VNet and Subnet detials (Required)
19-
resource_group_name = "rg-hub-demo-internal-shared-westeurope-001"
20-
virtual_network_name = "vnet-default-hub-westeurope"
21-
subnet_name = "snet-management-default-hub-westeurope"
19+
resource_group_name = "rg-shared-westeurope-01"
20+
virtual_network_name = "vnet-shared-hub-westeurope-001"
21+
subnet_name = "snet-management"
2222
vmscaleset_name = "testvmss"
2323
2424
# (Optional) To enable Azure Monitoring and install log analytics agents
25-
log_analytics_workspace_name = var.log_analytics_workspace_id
26-
hub_storage_account_name = var.hub_storage_account_id
25+
log_analytics_workspace_name = var.log_analytics_workspace_name
26+
hub_storage_account_name = var.hub_storage_account_name
27+
28+
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
29+
# Defaults to `false`
30+
deploy_log_analytics_agent = false
2731
2832
# This module support multiple Pre-Defined Linux and Windows Distributions.
2933
# These distributions support the Automatic OS image upgrades in virtual machine scale sets
3034
# Linux images: ubuntu1804, ubuntu1604, centos75, coreos
3135
# Windows Images: windows2012r2dc, windows2016dc, windows2019dc, windows2016dccore
3236
# Specify the RSA key for production workloads and set generate_admin_ssh_key argument to false
33-
# When you use Autoscaling feature, instances_count will become default and minimum instance count.
37+
# When you use Autoscaling feature, instances_count will become default and minimum instance count.
3438
os_flavor = "linux"
3539
linux_distribution_name = "ubuntu1804"
3640
generate_admin_ssh_key = false
@@ -41,15 +45,15 @@ module "vmscaleset" {
4145
# Specify health probe port to allow LB to detect the backend endpoint status
4246
# Standard Load Balancer helps load-balance TCP and UDP flows on all ports simultaneously
4347
# Specify the list of ports based on your requirement for Load balanced ports
44-
# for additional data disks, provide the list for required size for the disk.
48+
# for additional data disks, provide the list for required size for the disk.
4549
load_balancer_type = "public"
4650
load_balancer_health_probe_port = 80
4751
load_balanced_port_list = [80, 443]
4852
additional_data_disks = [100, 200]
4953
50-
# Enable Auto scaling feature for VM scaleset by set argument to true.
54+
# Enable Auto scaling feature for VM scaleset by set argument to true.
5155
# Instances_count in VMSS will become default and minimum instance count.
52-
# Automatically scale out the number of VM instances based on CPU Average only.
56+
# Automatically scale out the number of VM instances based on CPU Average only.
5357
enable_autoscale_for_vmss = true
5458
minimum_instances_count = 2
5559
maximum_instances_count = 5
@@ -58,7 +62,7 @@ module "vmscaleset" {
5862
5963
# Network Seurity group port allow definitions for each Virtual Machine
6064
# NSG association to be added automatically for all network interfaces.
61-
# SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
65+
# SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
6266
# For production environments, we recommend using a VPN or private connection
6367
nsg_inbound_rules = [
6468
{
@@ -75,7 +79,7 @@ module "vmscaleset" {
7579
]
7680
7781
# Adding TAG's to your Azure resources (Required)
78-
# ProjectName and Env are already declared above, to use them here, create a varible.
82+
# ProjectName and Env are already declared above, to use them here, create a varible.
7983
tags = {
8084
ProjectName = "demo-internal"
8185
Env = "dev"
@@ -93,25 +97,29 @@ Following example creates Windows virtual machine scale sets with load balancer
9397
```hcl
9498
module "vmscaleset" {
9599
source = "kumarvna/vm-scale-sets/azurerm"
96-
version = "2.0.0"
100+
version = "2.1.0"
97101
98102
# Resource Group and location, VNet and Subnet detials (Required)
99-
resource_group_name = "rg-demo-westeurope-01" #"rg-hub-demo-internal-shared-westeurope-001"
100-
virtual_network_name = "vnet-demo-westeurope-001"
101-
subnet_name = "appgateway"
103+
resource_group_name = "rg-shared-westeurope-01"
104+
virtual_network_name = "vnet-shared-hub-westeurope-001"
105+
subnet_name = "snet-appgateway"
102106
vmscaleset_name = "testvmss"
103107
vm_computer_name = "websrv1"
104108
105109
# (Optional) To enable Azure Monitoring and install log analytics agents
106-
log_analytics_workspace_name = var.log_analytics_workspace_id
107-
hub_storage_account_name = var.hub_storage_account_id
110+
log_analytics_workspace_name = var.log_analytics_workspace_name
111+
hub_storage_account_name = var.hub_storage_account_name
112+
113+
# Deploy log analytics agents to virtual machine. Log analytics workspace name required.
114+
# Defaults to `false`
115+
deploy_log_analytics_agent = false
108116
109117
# This module support multiple Pre-Defined Linux and Windows Distributions.
110118
# These distributions support the Automatic OS image upgrades in virtual machine scale sets
111119
# Linux images: ubuntu1804, ubuntu1604, centos75, coreos
112120
# Windows Images: windows2012r2dc, windows2016dc, windows2019dc, windows2016dccore
113121
# Specify the RSA key for production workloads and set generate_admin_ssh_key argument to false
114-
# When you use Autoscaling feature, instances_count will become default and minimum instance count.
122+
# When you use Autoscaling feature, instances_count will become default and minimum instance count.
115123
os_flavor = "windows"
116124
windows_distribution_name = "windows2019dc"
117125
instances_count = 2
@@ -122,24 +130,27 @@ module "vmscaleset" {
122130
# Specify health probe port to allow LB to detect the backend endpoint status
123131
# Standard Load Balancer helps load-balance TCP and UDP flows on all ports simultaneously
124132
# Specify the list of ports based on your requirement for Load balanced ports
125-
# for additional data disks, provide the list for required size for the disk.
133+
# for additional data disks, provide the list for required size for the disk.
126134
load_balancer_type = "public"
127135
load_balancer_health_probe_port = 80
128136
load_balanced_port_list = [80, 443]
129137
additional_data_disks = [100, 200]
130138
131-
# Enable Auto scaling feature for VM scaleset by set argument to true.
139+
# Enable Auto scaling feature for VM scaleset by set argument to true.
132140
# Instances_count in VMSS will become default and minimum instance count.
133-
# Automatically scale out the number of VM instances based on CPU Average only.
141+
# Automatically scale out the number of VM instances based on CPU Average only.
134142
enable_autoscale_for_vmss = true
135143
minimum_instances_count = 2
136144
maximum_instances_count = 5
137145
scale_out_cpu_percentage_threshold = 80
138146
scale_in_cpu_percentage_threshold = 20
139147
148+
# Deploy IIS server minimal installation on VMMS instances
149+
intall_iis_server_on_instances = false
150+
140151
# Network Seurity group port allow definitions for each Virtual Machine
141152
# NSG association to be added automatically for all network interfaces.
142-
# SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
153+
# SSH port 22 and 3389 is exposed to the Internet recommended for only testing.
143154
# For production environments, we recommend using a VPN or private connection
144155
nsg_inbound_rules = [
145156
{
@@ -156,7 +167,7 @@ module "vmscaleset" {
156167
]
157168
158169
# Adding TAG's to your Azure resources (Required)
159-
# ProjectName and Env are already declared above, to use them here, create a varible.
170+
# ProjectName and Env are already declared above, to use them here, create a varible.
160171
tags = {
161172
ProjectName = "demo-internal"
162173
Env = "dev"

0 commit comments

Comments
 (0)