Skip to content

Commit

Permalink
Merge pull request #12 from data-platform-hq/vmss_default_set_to_zero…
Browse files Browse the repository at this point in the history
…_instances

fix: vmss default instances set to 0
  • Loading branch information
owlleg6 authored May 20, 2024
2 parents bc409cd + 01670e1 commit ccaec2d
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,15 @@ module "ado_vmss_agent_pool" {
| <a name="input_drc_log_levels"></a> [drc\_log\_levels](#input\_drc\_log\_levels) | List of Log levels | `list(string)` | <pre>[<br> "Debug"<br>]</pre> | no |
| <a name="input_location"></a> [location](#input\_location) | The Azure Region in which all resources in this example should be created. | `string` | n/a | yes |
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | The name of the resource group. | `string` | n/a | yes |
| <a name="input_scale_set_configuration"></a> [scale\_set\_configuration](#input\_scale\_set\_configuration) | Configuration options for linux virtual machine scale set | <pre>object({<br> sku = optional(string)<br> instances = optional(string)<br> admin_username = optional(string)<br> admin_password = optional(string)<br> disable_password_authentication = optional(bool)<br> priority = optional(string)<br> overprovision = optional(bool)<br> single_placement_group = optional(bool)<br> upgrade_mode = optional(string)<br> enable_ip_forwarding_interface = optional(bool)<br> domain_name_label = optional(string)<br> lb_backend_address_pool_ids = optional(list(string))<br> })</pre> | <pre>{<br> "instances": "0"<br>}</pre> | no |
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id) | Subnet where VM Scale Sets would be provisioned | `string` | n/a | yes |
| <a name="input_vm_scale_set_name"></a> [vm\_scale\_set\_name](#input\_vm\_scale\_set\_name) | VM Scale Sets name | `string` | n/a | yes |

## Outputs

| Name | Description |
|------|-------------|
| <a name="output_ado_elastic_pool_name"></a> [ado\_elastic\_pool\_name](#output\_ado\_elastic\_pool\_name) | Azure DevOps VMSS pool name |
| <a name="output_public_ip_prefix"></a> [public\_ip\_prefix](#output\_public\_ip\_prefix) | Public IP Address Prefix CIDR |
| <a name="output_tls_key"></a> [tls\_key](#output\_tls\_key) | SSH Key for VMSS authorization |
| <a name="output_vmss_id"></a> [vmss\_id](#output\_vmss\_id) | VM Scale Sets id |
Expand Down
14 changes: 7 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ module "vmss" {
source = "data-platform-hq/vmss/azurerm"
version = "1.2.3"

scale_set_name = var.vm_scale_set_name
location = var.location
resource_group = var.resource_group
admin_ssh_key = { public_key = tls_private_key.this.public_key_openssh }
subnet_id = var.subnet_id
public_ip_prefix_enabled = var.ado_vmss_public_ip_prefix_enabled

scale_set_name = var.vm_scale_set_name
location = var.location
resource_group = var.resource_group
admin_ssh_key = { public_key = tls_private_key.this.public_key_openssh }
subnet_id = var.subnet_id
public_ip_prefix_enabled = var.ado_vmss_public_ip_prefix_enabled
scale_set_configuration = var.scale_set_configuration
enable_data_collection_rule = var.drc_enabled
analytics_workspace_id = var.analytics_workspace_id
facility_names = var.drc_facility_names
Expand Down
5 changes: 5 additions & 0 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ output "vmss_id" {
description = "VM Scale Sets id"
}

output "ado_elastic_pool_name" {
value = try(azuredevops_elastic_pool.this[0].name, null)
description = "Azure DevOps VMSS pool name"
}

output "public_ip_prefix" {
value = module.vmss.public_ips
description = "Public IP Address Prefix CIDR"
Expand Down
21 changes: 21 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,27 @@ variable "create_ado_resources" {
default = true
}

variable "scale_set_configuration" {
description = "Configuration options for linux virtual machine scale set"
type = object({
sku = optional(string)
instances = optional(string)
admin_username = optional(string)
admin_password = optional(string)
disable_password_authentication = optional(bool)
priority = optional(string)
overprovision = optional(bool)
single_placement_group = optional(bool)
upgrade_mode = optional(string)
enable_ip_forwarding_interface = optional(bool)
domain_name_label = optional(string)
lb_backend_address_pool_ids = optional(list(string))
})
default = {
instances = "0"
}
}

variable "analytics_workspace_id" {
type = string
description = "Resource ID of Log Analytics Workspace"
Expand Down

0 comments on commit ccaec2d

Please sign in to comment.