Skip to content

Commit 2e38a04

Browse files
authored
Merge pull request #337 from sassoftware/staging
8.2.0 - September 21, 2023
2 parents c68e471 + e8efc3f commit 2e38a04

File tree

5 files changed

+40
-18
lines changed

5 files changed

+40
-18
lines changed

docs/CONFIG-VARS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,7 @@ Ubuntu 20.04 LTS is the operating system used on the Jump/NFS servers. Ubuntu cr
185185
| kubernetes_version | The AKS cluster Kubernetes version | string | "1.26" |Use of specific versions is still supported. If you need exact kubernetes version please use format `x.y.z`, where `x` is the major version, `y` is the minor version, and `z` is the patch version |
186186
| create_jump_vm | Create bastion host | bool | true | |
187187
| create_jump_public_ip | Add public IP address to the jump VM | bool | true | |
188+
| enable_jump_public_static_ip | Enables `Static` allocation method for the public IP address of Jump Server. Setting false will enable `Dynamic` allocation method. | bool | true | Only used with `create_jump_public_ip=true` |
188189
| jump_vm_admin | Operating system Admin User for the jump VM | string | "jumpuser" | |
189190
| jump_vm_machine_type | SKU to use for the jump VM | string | "Standard_B2s" | To check for valid types for your subscription, run: `az vm list-skus --resource-type virtualMachines --subscription $subscription --location $location -o table`|
190191
| jump_rwx_filestore_path | File store mount point on jump server | string | "/viya-share" | This location cannot include `/mnt` as its root location. This disk is ephemeral on Ubuntu, which is the operating system being used for the jump/NFS servers. |
@@ -300,6 +301,7 @@ When `storage_type=standard`, a NFS Server VM is created, only when these variab
300301
| Name | Description | Type | Default | Notes |
301302
| :--- | ---: | ---: | ---: | ---: |
302303
| create_nfs_public_ip | Add public ip to the NFS server VM | bool | false | |
304+
| enable_nfs_public_static_ip | Enables `Static` allocation method for the public IP address of NFS Server. Setting false will enable `Dynamic` allocation method | bool | true | Only used with `create_nfs_public_ip=true` |
303305
| nfs_vm_admin | OS Admin User for the NFS server VM | string | "nfsuser" | |
304306
| nfs_vm_machine_type | SKU to use for NFS server VM | string | "Standard_D8s_v4" | To check for valid types for your subscription, run: `az vm list-skus --resource-type virtualMachines --subscription $subscription --location $location -o table`|
305307
| nfs_vm_zone | Zone in which NFS server VM should be created | string | null | |

modules/azurerm_vm/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resource "azurerm_public_ip" "vm_ip" {
77
name = "${var.name}-public_ip"
88
location = var.azure_rg_location
99
resource_group_name = var.azure_rg_name
10-
allocation_method = "Static"
10+
allocation_method = var.enable_public_static_ip ? "Static" : "Dynamic"
1111
sku = var.vm_zone == null ? "Basic" : "Standard"
1212
zones = var.vm_zone == null ? [] : [var.vm_zone]
1313
tags = var.tags
@@ -93,9 +93,9 @@ resource "azurerm_linux_virtual_machine" "vm" {
9393
dynamic "plan" {
9494
for_each = var.fips_enabled ? [1] : []
9595
content {
96-
name = "pro-fips-20_04-gen2"
97-
publisher = "canonical"
98-
product = "0001-com-ubuntu-pro-focal-fips"
96+
name = "pro-fips-20_04-gen2"
97+
publisher = "canonical"
98+
product = "0001-com-ubuntu-pro-focal-fips"
9999
}
100100
}
101101

modules/azurerm_vm/variables.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ variable "create_public_ip" {
151151
default = false
152152
}
153153

154+
variable "enable_public_static_ip" {
155+
description = "Enables `Static` allocation method for the public IP address. Setting false will enable `Dynamic` allocation method."
156+
type = bool
157+
default = true
158+
}
159+
154160
variable "proximity_placement_group_id" {
155161
description = "The ID of the Proximity Placement Group which the Virtual Machine should be assigned to."
156162
type = string

variables.tf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,12 @@ variable "create_jump_public_ip" {
320320
default = true
321321
}
322322

323+
variable "enable_jump_public_static_ip" {
324+
description = "Enables `Static` allocation method for the public IP address of Jump Server. Setting false will enable `Dynamic` allocation method."
325+
type = bool
326+
default = true
327+
}
328+
323329
variable "jump_vm_admin" {
324330
description = "OS Admin User for Jump VM"
325331
type = string
@@ -361,6 +367,12 @@ variable "create_nfs_public_ip" {
361367
default = false
362368
}
363369

370+
variable "enable_nfs_public_static_ip" {
371+
description = "Enables `Static` allocation method for the public IP address of NFS Server. Setting false will enable `Dynamic` allocation method."
372+
type = bool
373+
default = true
374+
}
375+
364376
variable "nfs_vm_machine_type" {
365377
description = "SKU which should be used for this Virtual Machine"
366378
type = string

vms.tf

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,20 +54,21 @@ data "cloudinit_config" "jump" {
5454
module "jump" {
5555
source = "./modules/azurerm_vm"
5656

57-
count = var.create_jump_vm ? 1 : 0
58-
name = "${var.prefix}-jump"
59-
azure_rg_name = local.aks_rg.name
60-
azure_rg_location = var.location
61-
vnet_subnet_id = module.vnet.subnets["misc"].id
62-
machine_type = var.jump_vm_machine_type
63-
azure_nsg_id = local.nsg.id
64-
tags = var.tags
65-
vm_admin = var.jump_vm_admin
66-
vm_zone = var.jump_vm_zone
67-
fips_enabled = var.fips_enabled
68-
ssh_public_key = local.ssh_public_key
69-
cloud_init = data.cloudinit_config.jump[0].rendered
70-
create_public_ip = var.create_jump_public_ip
57+
count = var.create_jump_vm ? 1 : 0
58+
name = "${var.prefix}-jump"
59+
azure_rg_name = local.aks_rg.name
60+
azure_rg_location = var.location
61+
vnet_subnet_id = module.vnet.subnets["misc"].id
62+
machine_type = var.jump_vm_machine_type
63+
azure_nsg_id = local.nsg.id
64+
tags = var.tags
65+
vm_admin = var.jump_vm_admin
66+
vm_zone = var.jump_vm_zone
67+
fips_enabled = var.fips_enabled
68+
ssh_public_key = local.ssh_public_key
69+
cloud_init = data.cloudinit_config.jump[0].rendered
70+
create_public_ip = var.create_jump_public_ip
71+
enable_public_static_ip = var.enable_jump_public_static_ip
7172

7273
# Jump VM mounts NFS path hence dependency on 'module.nfs'
7374
depends_on = [module.vnet, module.nfs]
@@ -103,6 +104,7 @@ module "nfs" {
103104
ssh_public_key = local.ssh_public_key
104105
cloud_init = data.cloudinit_config.nfs[0].rendered
105106
create_public_ip = var.create_nfs_public_ip
107+
enable_public_static_ip = var.enable_nfs_public_static_ip
106108
data_disk_count = 4
107109
data_disk_size = var.nfs_raid_disk_size
108110
data_disk_storage_account_type = var.nfs_raid_disk_type

0 commit comments

Comments
 (0)