Skip to content

Commit 57da789

Browse files
authored
Merge pull request #2 from data-platform-hq/fix_default_var_values
fix: updated default variables values
2 parents cb992e6 + ec1454d commit 57da789

File tree

2 files changed

+44
-34
lines changed

2 files changed

+44
-34
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -54,29 +54,29 @@ module "linux_virtual_machine" {
5454

5555
## Inputs
5656

57-
| Name | Description | Type | Default | Required |
58-
|------|-------------|------|---------|:--------:|
59-
| <a name="input_project"></a> [project](#input\_project)| Project name | `string` | n/a | yes |
60-
| <a name="input_env"></a> [env](#input\_env)| Environment name | `string` | n/a | yes |
61-
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group)| The name of the resource group | `string` | n/a | yes |
62-
| <a name="input_suffix"></a> [suffix](#input\_suffix)| Optional suffix that would be added to the end of resources names. It is recommended to use dash at the beginning of variable (e.x., '-example') | `string` | "" | no |
63-
| <a name="input_location"></a> [location](#input\_location)| Azure location | `string` | n/a | yes |
64-
| <a name="input_custom_virtual_machine_name"></a> [custom\_virtual\_machine\_name](#input\_custom\_virtual\_machine\_name)| Specifies the name of the virtual machine name resource | `string` | null | no |
65-
| <a name="input_custom_network_interface_name"></a> [custom\_network\_interface\_name](#input\_custom\_network\_interface\_name)| Specifies the name of the virtual machine interface name resource | `string` | null | no |
66-
| <a name="input_custom_public_ip_name"></a> [custom\_public\_ip\_name](#input\_custom\_public\_ip\_name)| Specifies the name of the public ip name name resource | `string` | null | no |
67-
| <a name="input_tags"></a> [tags](#input\_tags)| Resource tags | map(any) | {} | no |
68-
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id)| The ID of the Subnet where this Network Interface should be located in. | `string` | n/a | yes |
69-
| <a name="input_public_ip_enabled"></a> [public\_ip\_enabled](#input\_public\_ip\_enabled)| Boolean flag to enable Public Ip address creation and assignment to Virtual Machine | `bool` | true | no |
70-
| <a name="input_public_ip_allocation_method"></a> [public\_ip\_allocation\_method](#input\_public\_ip\_allocation_method)| Defines the allocation method for this IP address. Possible values are Static or Dynamic | `string` | Dynamic | no |
71-
| <a name="input_network_interface_private_ip_address_allocation"></a> [network\_interface\_private\_ip_address\_allocation](#input\_network\_interface\_private\_ip_address\_allocation)| The allocation method used for the Private IP Address. | `string` | Dynamic | no |
72-
| <a name="input_vm_size"></a> [vm\_size](#input\_vm\_size)| The SKU which should be used for this Virtual Machine. | `string` | Standard_F2 | no |
73-
| <a name="input_vm_admin_username"></a> [vm\_admin\_username](#input\_vm\_admin\_username)| The username of the local administrator used for the Virtual Machine. | `string` | adminuser | no |
74-
| <a name="input_vm_admin_password"></a> [vm\_admin\_password](#input\_vm\_admin\_password)| The password of the local administrator used for the Virtual Machine. | `string` | null | no |
75-
| <a name="input_admin_ssh_key"></a> [admin\_ssh\_key](#input\_admin\_ssh\_key)| Objects to configure ssh key reference for virtual machine | <pre>object({<br> username = string<br> public_key = string<br>})</pre> | n/a | yes |
76-
| <a name="input_os_disk"></a> [os\_disk](#input\_os\_disk)| Objects to configure os disk reference for virtual machine | <pre>object({<br> caching = string<br> storage_account_type = string<br>})</pre> | <pre>{<br> caching = "ReadWrite"<br> storage_account_type = "Standard_LRS"<br>}</pre> | no |
57+
| Name | Description | Type | Default | Required |
58+
|------|-------------|------|-------------------------------------------------------------------------------------------------------------------------------------------------------|:--------:|
59+
| <a name="input_project"></a> [project](#input\_project)| Project name | `string` | n/a | yes |
60+
| <a name="input_env"></a> [env](#input\_env)| Environment name | `string` | n/a | yes |
61+
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group)| The name of the resource group | `string` | n/a | yes |
62+
| <a name="input_suffix"></a> [suffix](#input\_suffix)| Optional suffix that would be added to the end of resources names. It is recommended to use dash at the beginning of variable (e.x., '-example') | `string` | "" | no |
63+
| <a name="input_location"></a> [location](#input\_location)| Azure location | `string` | n/a | yes |
64+
| <a name="input_custom_virtual_machine_name"></a> [custom\_virtual\_machine\_name](#input\_custom\_virtual\_machine\_name)| Specifies the name of the virtual machine name resource | `string` | null | no |
65+
| <a name="input_custom_network_interface_name"></a> [custom\_network\_interface\_name](#input\_custom\_network\_interface\_name)| Specifies the name of the virtual machine interface name resource | `string` | null | no |
66+
| <a name="input_custom_public_ip_name"></a> [custom\_public\_ip\_name](#input\_custom\_public\_ip\_name)| Specifies the name of the public ip name name resource | `string` | null | no |
67+
| <a name="input_tags"></a> [tags](#input\_tags)| Resource tags | map(any) | {} | no |
68+
| <a name="input_subnet_id"></a> [subnet\_id](#input\_subnet\_id)| The ID of the Subnet where this Network Interface should be located in. | `string` | n/a | yes |
69+
| <a name="input_public_ip_enabled"></a> [public\_ip\_enabled](#input\_public\_ip\_enabled)| Boolean flag to enable Public Ip address creation and assignment to Virtual Machine | `bool` | true | no |
70+
| <a name="input_public_ip_allocation_method"></a> [public\_ip\_allocation\_method](#input\_public\_ip\_allocation_method)| Defines the allocation method for this IP address. Possible values are Static or Dynamic | `string` | Static | no |
71+
| <a name="input_network_interface_private_ip_address_allocation"></a> [network\_interface\_private\_ip_address\_allocation](#input\_network\_interface\_private\_ip_address\_allocation)| The allocation method used for the Private IP Address. | `string` | Dynamic | no |
72+
| <a name="input_vm_size"></a> [vm\_size](#input\_vm\_size)| The SKU which should be used for this Virtual Machine. | `string` | Standard_F2 | no |
73+
| <a name="input_vm_admin_username"></a> [vm\_admin\_username](#input\_vm\_admin\_username)| The username of the local administrator used for the Virtual Machine. | `string` | adminuser | no |
74+
| <a name="input_vm_admin_password"></a> [vm\_admin\_password](#input\_vm\_admin\_password)| The password of the local administrator used for the Virtual Machine. | `string` | null | no |
75+
| <a name="input_admin_ssh_key"></a> [admin\_ssh\_key](#input\_admin\_ssh\_key)| Objects to configure ssh key reference for virtual machine | <pre>object({<br> username = string<br> public_key = string<br>})</pre> | n/a | yes |
76+
| <a name="input_os_disk"></a> [os\_disk](#input\_os\_disk)| Objects to configure os disk reference for virtual machine | <pre>object({<br> caching = string<br> storage_account_type = string<br>})</pre> | <pre>{<br> caching = "ReadWrite"<br> storage_account_type = "Standard_LRS"<br>}</pre> | no |
7777
| <a name="input_source_image_reference"></a> [source\_image\_reference](#input\_source\_image\_reference)| Objects to configure source image reference for virtual machine | <pre>object({<br> publisher = string<br> offer = string<br> sku = string<br> version = string<br>})</pre> | <pre>{<br> publisher = "Canonical"<br> offer = "0001-com-ubuntu-server-focal"<br> sku = "20_04-lts"<br> version = "latest"<br>}</pre> | no |
78-
| <a name="input_identity_enabled"></a> [identity\_enabled](#input\_identity\_enabled)| Boolean flag than enables creation of System Assigned identity to VM | `bool` | false | no |
79-
| <a name="input_password_access_enabled"></a> [password\_access\_enabled](#input\_password\_access\_enabled)| Boolean flag that enables access using password | `bool` | false | no |
78+
| <a name="input_identity_enabled"></a> [identity\_enabled](#input\_identity\_enabled)| Boolean flag than enables creation of System Assigned identity to VM | `bool` | false | no |
79+
| <a name="input_password_access_enabled"></a> [password\_access\_enabled](#input\_password\_access\_enabled)| Boolean flag that enables access using password | `bool` | false | no |
8080
8181
## Modules
8282

variables.tf

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ variable "env" {
88
description = "Environment name"
99
}
1010

11+
variable "location" {
12+
type = string
13+
description = "Azure location"
14+
}
15+
1116
variable "resource_group" {
1217
type = string
1318
description = "The name of the resource group"
@@ -19,11 +24,6 @@ variable "suffix" {
1924
default = ""
2025
}
2126

22-
variable "location" {
23-
type = string
24-
description = "Azure location"
25-
}
26-
2727
variable "custom_virtual_machine_name" {
2828
type = string
2929
description = "Specifies the name of the virtual machine name resource"
@@ -62,7 +62,7 @@ variable "public_ip_enabled" {
6262
variable "public_ip_allocation_method" {
6363
type = string
6464
description = "Defines the allocation method for this IP address. Possible values are Static or Dynamic"
65-
default = "Dynamic"
65+
default = "Static"
6666
}
6767

6868
variable "network_interface_private_ip_address_allocation" {
@@ -99,20 +99,30 @@ variable "admin_ssh_key" {
9999

100100
variable "os_disk" {
101101
type = object({
102-
caching = optional(string, "ReadWrite")
103-
storage_account_type = optional(string, "Standard_LRS")
102+
caching = string
103+
storage_account_type = string
104104
})
105105
description = "Objects to configure os disk reference for virtual machine"
106+
default = {
107+
caching = "ReadWrite"
108+
storage_account_type = "Standard_LRS"
109+
}
106110
}
107111

108112
variable "source_image_reference" {
109113
type = object({
110-
publisher = optional(string, "Canonical")
111-
offer = optional(string, "0001-com-ubuntu-server-focal")
112-
sku = optional(string, "20_04-lts")
113-
version = optional(string, "latest")
114+
publisher = string
115+
offer = string
116+
sku = string
117+
version = string
114118
})
115119
description = "Objects to configure source image reference for virtual machine"
120+
default = {
121+
publisher = "Canonical"
122+
offer = "0001-com-ubuntu-server-focal"
123+
sku = "20_04-lts"
124+
version = "latest"
125+
}
116126
}
117127

118128
variable "identity_enabled" {

0 commit comments

Comments
 (0)