Fix 201-vmss-jumpbox (#275)

* Fix 201-vmss-jumpbox
This commit is contained in:
Neil Ye 2023-11-17 17:39:39 +08:00 committed by GitHub
parent a09e5f225b
commit 256f1edff2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 160 additions and 154 deletions

View File

@ -10,7 +10,11 @@ terraform {
} }
provider "azurerm" { provider "azurerm" {
features {} features {
resource_group {
prevent_deletion_if_contains_resources = false
}
}
} }
resource "azurerm_resource_group" "vmss" { resource "azurerm_resource_group" "vmss" {
@ -82,7 +86,7 @@ resource "azurerm_lb_rule" "lbnatrule" {
protocol = "Tcp" protocol = "Tcp"
frontend_port = var.application_port frontend_port = var.application_port
backend_port = var.application_port backend_port = var.application_port
backend_address_pool_id = azurerm_lb_backend_address_pool.bpepool.id backend_address_pool_ids = [azurerm_lb_backend_address_pool.bpepool.id]
frontend_ip_configuration_name = "PublicIPAddress" frontend_ip_configuration_name = "PublicIPAddress"
probe_id = azurerm_lb_probe.vmss.id probe_id = azurerm_lb_probe.vmss.id
} }
@ -163,7 +167,7 @@ resource "azurerm_network_interface" "jumpbox" {
ip_configuration { ip_configuration {
name = "IPConfiguration" name = "IPConfiguration"
subnet_id = azurerm_subnet.vmss.id subnet_id = azurerm_subnet.vmss.id
private_ip_address_allocation = "dynamic" private_ip_address_allocation = "Dynamic"
public_ip_address_id = azurerm_public_ip.jumpbox.id public_ip_address_id = azurerm_public_ip.jumpbox.id
} }

View File

@ -27,7 +27,7 @@ This template deploys an Azure virtual machine scale set with a jumpbox.
| `tags` | Map of the tags to use for the resources that are deployed | | `tags` | Map of the tags to use for the resources that are deployed |
| `application_port` | Port that you want to expose to the external load balancer | | `application_port` | Port that you want to expose to the external load balancer |
| `admin_user` | User name to use as the admin account on the VMs that will be part of the VM scale set | | `admin_user` | User name to use as the admin account on the VMs that will be part of the VM scale set |
| `admin_password` | Default password for admin account (NOTE: For security reasons, this value is not set in the plaintext variables.tf file.) | | `admin_password` | Default password for admin account |
## Example ## Example

View File

@ -28,4 +28,6 @@ variable "admin_user" {
variable "admin_password" { variable "admin_password" {
description = "Default password for admin account" description = "Default password for admin account"
default = "ChangeMe123!"
sensitive = true
} }