Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8.2.0 - September 21, 2023 #337

Merged
merged 1 commit into from
Sep 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docs/CONFIG-VARS.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ Ubuntu 20.04 LTS is the operating system used on the Jump/NFS servers. Ubuntu cr
| 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 |
| create_jump_vm | Create bastion host | bool | true | |
| create_jump_public_ip | Add public IP address to the jump VM | bool | true | |
| 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` |
| jump_vm_admin | Operating system Admin User for the jump VM | string | "jumpuser" | |
| 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`|
| 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. |
Expand Down Expand Up @@ -300,6 +301,7 @@ When `storage_type=standard`, a NFS Server VM is created, only when these variab
| Name | Description | Type | Default | Notes |
| :--- | ---: | ---: | ---: | ---: |
| create_nfs_public_ip | Add public ip to the NFS server VM | bool | false | |
| 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` |
| nfs_vm_admin | OS Admin User for the NFS server VM | string | "nfsuser" | |
| 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`|
| nfs_vm_zone | Zone in which NFS server VM should be created | string | null | |
Expand Down
8 changes: 4 additions & 4 deletions modules/azurerm_vm/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ resource "azurerm_public_ip" "vm_ip" {
name = "${var.name}-public_ip"
location = var.azure_rg_location
resource_group_name = var.azure_rg_name
allocation_method = "Static"
allocation_method = var.enable_public_static_ip ? "Static" : "Dynamic"
sku = var.vm_zone == null ? "Basic" : "Standard"
zones = var.vm_zone == null ? [] : [var.vm_zone]
tags = var.tags
Expand Down Expand Up @@ -93,9 +93,9 @@ resource "azurerm_linux_virtual_machine" "vm" {
dynamic "plan" {
for_each = var.fips_enabled ? [1] : []
content {
name = "pro-fips-20_04-gen2"
publisher = "canonical"
product = "0001-com-ubuntu-pro-focal-fips"
name = "pro-fips-20_04-gen2"
publisher = "canonical"
product = "0001-com-ubuntu-pro-focal-fips"
}
}

Expand Down
6 changes: 6 additions & 0 deletions modules/azurerm_vm/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ variable "create_public_ip" {
default = false
}

variable "enable_public_static_ip" {
description = "Enables `Static` allocation method for the public IP address. Setting false will enable `Dynamic` allocation method."
type = bool
default = true
}

variable "proximity_placement_group_id" {
description = "The ID of the Proximity Placement Group which the Virtual Machine should be assigned to."
type = string
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,12 @@ variable "create_jump_public_ip" {
default = true
}

variable "enable_jump_public_static_ip" {
description = "Enables `Static` allocation method for the public IP address of Jump Server. Setting false will enable `Dynamic` allocation method."
type = bool
default = true
}

variable "jump_vm_admin" {
description = "OS Admin User for Jump VM"
type = string
Expand Down Expand Up @@ -361,6 +367,12 @@ variable "create_nfs_public_ip" {
default = false
}

variable "enable_nfs_public_static_ip" {
description = "Enables `Static` allocation method for the public IP address of NFS Server. Setting false will enable `Dynamic` allocation method."
type = bool
default = true
}

variable "nfs_vm_machine_type" {
description = "SKU which should be used for this Virtual Machine"
type = string
Expand Down
30 changes: 16 additions & 14 deletions vms.tf
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,21 @@ data "cloudinit_config" "jump" {
module "jump" {
source = "./modules/azurerm_vm"

count = var.create_jump_vm ? 1 : 0
name = "${var.prefix}-jump"
azure_rg_name = local.aks_rg.name
azure_rg_location = var.location
vnet_subnet_id = module.vnet.subnets["misc"].id
machine_type = var.jump_vm_machine_type
azure_nsg_id = local.nsg.id
tags = var.tags
vm_admin = var.jump_vm_admin
vm_zone = var.jump_vm_zone
fips_enabled = var.fips_enabled
ssh_public_key = local.ssh_public_key
cloud_init = data.cloudinit_config.jump[0].rendered
create_public_ip = var.create_jump_public_ip
count = var.create_jump_vm ? 1 : 0
name = "${var.prefix}-jump"
azure_rg_name = local.aks_rg.name
azure_rg_location = var.location
vnet_subnet_id = module.vnet.subnets["misc"].id
machine_type = var.jump_vm_machine_type
azure_nsg_id = local.nsg.id
tags = var.tags
vm_admin = var.jump_vm_admin
vm_zone = var.jump_vm_zone
fips_enabled = var.fips_enabled
ssh_public_key = local.ssh_public_key
cloud_init = data.cloudinit_config.jump[0].rendered
create_public_ip = var.create_jump_public_ip
enable_public_static_ip = var.enable_jump_public_static_ip

# Jump VM mounts NFS path hence dependency on 'module.nfs'
depends_on = [module.vnet, module.nfs]
Expand Down Expand Up @@ -103,6 +104,7 @@ module "nfs" {
ssh_public_key = local.ssh_public_key
cloud_init = data.cloudinit_config.nfs[0].rendered
create_public_ip = var.create_nfs_public_ip
enable_public_static_ip = var.enable_nfs_public_static_ip
data_disk_count = 4
data_disk_size = var.nfs_raid_disk_size
data_disk_storage_account_type = var.nfs_raid_disk_type
Expand Down
Loading