From 6e63d0386bbae4e460ec8fc619d34947bd41d0a9 Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Fri, 29 Sep 2023 09:47:26 -0700 Subject: [PATCH 1/9] initial pass for azure vm --- modules/azure_vm/main.tf | 125 ++++++++++++++++++++++++++++++++++ modules/azure_vm/outputs.tf | 4 ++ modules/azure_vm/variables.tf | 100 +++++++++++++++++++++++++++ 3 files changed, 229 insertions(+) create mode 100644 modules/azure_vm/main.tf create mode 100644 modules/azure_vm/outputs.tf create mode 100644 modules/azure_vm/variables.tf diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf new file mode 100644 index 0000000..80ee881 --- /dev/null +++ b/modules/azure_vm/main.tf @@ -0,0 +1,125 @@ +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.74" + } + } +} + +locals { + flat_security_rules = { + for rule in var.security_rules : + rule.name => rule + } +} + +data "azurerm_resource_group" "selected" { + name = var.resource_group_name +} + +data "azurerm_virtual_network" "selected" { + name = var.virtual_network_name + resource_group_name = data.azurerm_resource_group.selected.name +} + +data "azurerm_subnet" "selected" { + name = var.subnet_name + resource_group_name = data.azurerm_resource_group.selected.name + virtual_network_name = data.azurerm_virtual_network.selected.name +} + +resource "azurerm_public_ip" "this" { + name = "retool_public_ip" + resource_group_name = data.azurerm_resource_group.selected.name + location = data.azurerm_resource_group.selected.location + allocation_method = "Dynamic" + lifecycle { + create_before_destroy = true + } +} + +resource "azurerm_network_interface" "this" { + name = "retoolni" + location = data.azurerm_resource_group.selected.location + resource_group_name = data.azurerm_resource_group.selected.name + + ip_configuration { + name = "retool-ni-config" + subnet_id = data.azurerm_subnet.selected.id + private_ip_address_allocation = "Dynamic" + public_ip_address_id = azurerm_public_ip.this.id + } +} + +resource "azurerm_network_security_group" "this" { + name = "retool-sg" + location = data.azurerm_resource_group.selected.location + resource_group_name = data.azurerm_resource_group.selected.name +} + +resource "azurerm_network_security_rule" "this" { + for_each = local.flat_security_rules + name = each.value.name + priority = each.value.priority + direction = each.value.direction + access = each.value.access + protocol = each.value.protocol + source_port_range = each.value.source_port_range + destination_port_range = each.value.destination_port_range + source_address_prefix = each.value.source_address_prefix + destination_address_prefix = each.value.destination_address_prefix + resource_group_name = data.azurerm_resource_group.selected.name + network_security_group_name = azurerm_network_security_group.this.name + + +} + +resource "azurerm_network_interface_security_group_association" "this" { + network_interface_id = azurerm_network_interface.this.id + network_security_group_id = azurerm_network_security_group.this.id +} + +resource "azurerm_linux_virtual_machine" "this" { + name = "retool" + resource_group_name = data.azurerm_resource_group.selected.name + location = data.azurerm_resource_group.selected.location + size = var.instance_size + admin_username = "retooladmin" + network_interface_ids = [ + azurerm_network_interface.this.id, + ] + + admin_ssh_key { + username = "retooladmin" + public_key = file(var.ssh_key_path) + } + + os_disk { + caching = "ReadWrite" + storage_account_type = "Standard_LRS" + } + + source_image_reference { + publisher = "Canonical" + offer = "0001-com-ubuntu-server-jammy" + sku = "22_04-lts-gen2" + version = "latest" + } +} + + +resource "azurerm_virtual_machine_extension" "this" { + name = "retool" + virtual_machine_id = azurerm_linux_virtual_machine.this.id + publisher = "Microsoft.Azure.Extensions" + type = "CustomScript" + type_handler_version = "2.0" + + settings = < Dockerfile && echo CMD ./docker-scripts/start_api.sh >> Dockerfile && ./install.sh && docker-compose up -d && exit 0" + } + SETTINGS + +} \ No newline at end of file diff --git a/modules/azure_vm/outputs.tf b/modules/azure_vm/outputs.tf new file mode 100644 index 0000000..cbf6f76 --- /dev/null +++ b/modules/azure_vm/outputs.tf @@ -0,0 +1,4 @@ +output "vm_public_ip" { + value = azurerm_public_ip.this.ip_address + description = "Public IP of VM Instance" +} \ No newline at end of file diff --git a/modules/azure_vm/variables.tf b/modules/azure_vm/variables.tf new file mode 100644 index 0000000..5b85350 --- /dev/null +++ b/modules/azure_vm/variables.tf @@ -0,0 +1,100 @@ +variable "commandtoexecute" { + type = string + description = "Commands to run at vm startup" + default = "" +} + +variable "security_rules" { + type = list( + object({ + name = string + priority = number + direction = string + access = string + protocol = string + source_port_range = string + destination_port_range = string + source_address_prefix = string + destination_address_prefix = string + }) + ) + default = [ + { + name = "GlobalHTTP" + priority = 300 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "80" + source_address_prefix = "*" + destination_address_prefix = "*" + }, + { + name = "GlobalHTTPS" + priority = 310 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "443" + source_address_prefix = "*" + destination_address_prefix = "*" + }, + { + name = "SSH" + priority = 320 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "22" + source_address_prefix = "*" + destination_address_prefix = "*" + }, + { + name = "ApplicationPort" + priority = 330 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "3000" + source_address_prefix = "*" + destination_address_prefix = "*" + } + ] + description = "Ingress rules for EC2 security group" +} + +variable "instance_size" { + type = string + description = "Retool instance size" + default = "Standard_D4_v4" +} + +variable "resource_group_name" { + type = string + description = "Existing resource group to create resources in" +} + +variable "ssh_key_path" { + type = string + description = "Path to SSH key for connection to VM" + default = "~/.ssh/id_rsa.pub" +} + +variable "subnet_name" { + type = string + description = "Existing subnet to create resources in" +} + +variable "version_number" { + type = string + description = "Retool version" +} + +variable "virtual_network_name" { + type = string + description = "Existing vnet to create resources in" +} \ No newline at end of file From 658f62f0a6a53f38bcdf605e3fb648d6f170ce7a Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Mon, 2 Oct 2023 10:36:18 -0700 Subject: [PATCH 2/9] updated script, readme --- modules/azure_vm/README.md | 130 ++++++++++++++++++++++++++++++++++ modules/azure_vm/main.tf | 6 +- modules/azure_vm/vm_script.sh | 22 ++++++ 3 files changed, 156 insertions(+), 2 deletions(-) create mode 100644 modules/azure_vm/README.md create mode 100644 modules/azure_vm/vm_script.sh diff --git a/modules/azure_vm/README.md b/modules/azure_vm/README.md new file mode 100644 index 0000000..2351934 --- /dev/null +++ b/modules/azure_vm/README.md @@ -0,0 +1,130 @@ +# AWS EC2 Standalone Deployment + +## Requirements + +- RDS instance with port, host, username, and password +- VPC with desired subnets + +## Usage + +1. Directly use our module in your existing Terraform configuration and provide the required variables + +``` +terraform { + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = "~> 3.74" + } + } +} + +provider "azurerm" { + features {} +} + + +module "retool" { + source = "git@github.com:tryretool/retool-terraform.git//modules/azure_vm" + resource_group_name = "" + subnet_name = "" + version_number = "" + virtual_network_name = "" +} + +output "vm_public_ip" { + value = module.retool.vm_public_ip + description = "Public IP of VM Instance" +} +``` +2. Copy `vm_script.sh` to your local Terraform directory. + +3. Run `terraform plan` to confirm that the changes look good + +4. Run `terraform apply` to apply the configuration changes + +5. After a few minutes, SSH into your newly created EC2 instance using the Key Pair passed into `ssh_key_path`, defaults to `~/.ssh/id_rsa.pub` + +6. Verify that the GitHub repository exists + +``` +sudo su - +cd /retool/retool-onpremise +``` + +7. Verify that the Dockerfile contains the correct Retool version number + +``` +# you should see the X.Y.Z version number specified +vim Dockerfile +``` + +8. Verify that all of the Docker containers are up and running. If one of them is not running or restarting, try re-creating the containers with (`docker-compose up -d`) + +``` +docker-ps +``` + +9. Modify your environment variables. If you have an external RDS database (strongly recommended), replace the `POSTGRES_` environment variables with the new ones. + +- If testing out your instance for the first time without SSL/HTTPS, you should uncomment `# COOKIE_INSECURE = true` +- Replace your `LICENSE_KEY` with your provided Retool license key + +10. Add any additional configuration needed. You can refer to our documentation for [all additional environment variables](https://docs.retool.com/docs/environment-variables). + +11. Access your Retool instance on the public IP that is given via the resource creation outputs. If no SSL certificate has been configured you need to access the instance on port 3000 (append :3000 to the end of the URL) and via http. + +### Security Group + +You can configure the security group ingress and egress rules using input variables: + +``` + security_rules = [ + { + name = "GlobalHTTP" + priority = 300 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "80" + source_address_prefix = "*" + destination_address_prefix = "*" + }, + { + name = "GlobalHTTPS" + priority = 310 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "443" + source_address_prefix = "*" + destination_address_prefix = "*" + }, + { + name = "SSH" + priority = 320 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "22" + source_address_prefix = "*" + destination_address_prefix = "*" + }, + { + name = "ApplicationPort" + priority = 330 + direction = "Inbound" + access = "Allow" + protocol = "Tcp" + source_port_range = "*" + destination_port_range = "3000" + source_address_prefix = "*" + destination_address_prefix = "*" + } + ] +``` + +By default, this module creates a publicly-accessible security group that enables inbound traffic on ports (`30`, `443`, `22`, and `3000`) and all outbound traffic. diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index 80ee881..d06e270 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -48,7 +48,7 @@ resource "azurerm_network_interface" "this" { name = "retool-ni-config" subnet_id = data.azurerm_subnet.selected.id private_ip_address_allocation = "Dynamic" - public_ip_address_id = azurerm_public_ip.this.id + public_ip_address_id = azurerm_public_ip.this.id } } @@ -118,7 +118,9 @@ resource "azurerm_virtual_machine_extension" "this" { settings = < Dockerfile && echo CMD ./docker-scripts/start_api.sh >> Dockerfile && ./install.sh && docker-compose up -d && exit 0" + "script": "${base64encode(templatefile("vm_script.sh", { + version_number = "${var.version_number}" + }))}" } SETTINGS diff --git a/modules/azure_vm/vm_script.sh b/modules/azure_vm/vm_script.sh new file mode 100644 index 0000000..14285e2 --- /dev/null +++ b/modules/azure_vm/vm_script.sh @@ -0,0 +1,22 @@ +#!/bin/bash + +#make an easy to find directory +mkdir /retool +cd /retool + +# Clone Retool repository +git clone https://github.com/tryretool/retool-onpremise.git +cd retool-onpremise + +# Rewrite Dockerfile +echo FROM tryretool/backend:${version_number} > Dockerfile +echo CMD ./docker_scripts/start_api.sh >> Dockerfile + +# Initialize Docker and Retool Installation +./install.sh + +# Run services +docker-compose up -d + +# exit code for success in terraform +exit 0 \ No newline at end of file From 43beb8cced08fdb22c2d5142404aef9fd0dc0055 Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Mon, 2 Oct 2023 13:20:48 -0700 Subject: [PATCH 3/9] Updated readme --- modules/azure_vm/README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/azure_vm/README.md b/modules/azure_vm/README.md index 2351934..e2f4b4c 100644 --- a/modules/azure_vm/README.md +++ b/modules/azure_vm/README.md @@ -1,8 +1,7 @@ -# AWS EC2 Standalone Deployment +# Azure VM Standalone Deployment ## Requirements -- RDS instance with port, host, username, and password - VPC with desired subnets ## Usage @@ -74,10 +73,12 @@ docker-ps 11. Access your Retool instance on the public IP that is given via the resource creation outputs. If no SSL certificate has been configured you need to access the instance on port 3000 (append :3000 to the end of the URL) and via http. -### Security Group +### Security Rules You can configure the security group ingress and egress rules using input variables: +For example, to create a Retool instance accessible from anywhere, you can use the following value for `security_rules` which enables inbound traffic on ports (`30`, `443`, `22`, and `3000`) and all outbound traffic. Note that this is also the default behavior of this module. + ``` security_rules = [ { @@ -127,4 +128,3 @@ You can configure the security group ingress and egress rules using input variab ] ``` -By default, this module creates a publicly-accessible security group that enables inbound traffic on ports (`30`, `443`, `22`, and `3000`) and all outbound traffic. From 35d87635c64e6c7ca05773089792d037b1948846 Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Mon, 2 Oct 2023 16:50:33 -0700 Subject: [PATCH 4/9] adding psql flexible server creation --- modules/azure_vm/main.tf | 62 +++++++++++++++++++++++++++++++++-- modules/azure_vm/variables.tf | 30 +++++++++++++++++ 2 files changed, 90 insertions(+), 2 deletions(-) diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index d06e270..03f4375 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -119,9 +119,67 @@ resource "azurerm_virtual_machine_extension" "this" { settings = < Date: Mon, 2 Oct 2023 16:55:05 -0700 Subject: [PATCH 5/9] tf format --- modules/azure_vm/main.tf | 10 +++++----- modules/azure_vm/variables.tf | 22 +++++++++++----------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index 03f4375..287fd90 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -127,7 +127,7 @@ resource "azurerm_virtual_machine_extension" "this" { } resource "azurerm_subnet" "this" { - count = var.external_psql ? 1 : 0 + count = var.external_psql ? 1 : 0 name = "psql-flexible-sn" resource_group_name = data.azurerm_resource_group.selected.name virtual_network_name = data.azurerm_virtual_network.selected.name @@ -144,13 +144,13 @@ resource "azurerm_subnet" "this" { } } resource "azurerm_private_dns_zone" "this" { - count = var.external_psql ? 1 : 0 + count = var.external_psql ? 1 : 0 name = "retool.postgres.database.azure.com" resource_group_name = data.azurerm_resource_group.selected.name } resource "azurerm_private_dns_zone_virtual_network_link" "this" { - count = var.external_psql ? 1 : 0 + count = var.external_psql ? 1 : 0 name = "retool-internal.com" private_dns_zone_name = azurerm_private_dns_zone.this[0].name virtual_network_id = data.azurerm_virtual_network.selected.id @@ -158,7 +158,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "this" { } resource "azurerm_postgresql_flexible_server" "this" { - count = var.external_psql ? 1 : 0 + count = var.external_psql ? 1 : 0 name = "retool-psqlflexibleserver" resource_group_name = data.azurerm_resource_group.selected.name location = data.azurerm_resource_group.selected.location @@ -177,7 +177,7 @@ resource "azurerm_postgresql_flexible_server" "this" { } resource "azurerm_postgresql_flexible_server_database" "this" { - count = var.external_psql ? 1 : 0 + count = var.external_psql ? 1 : 0 name = "retool" server_id = azurerm_postgresql_flexible_server.this[0].id collation = "en_US.utf8" diff --git a/modules/azure_vm/variables.tf b/modules/azure_vm/variables.tf index 9e58742..612e4c6 100644 --- a/modules/azure_vm/variables.tf +++ b/modules/azure_vm/variables.tf @@ -5,15 +5,15 @@ variable "commandtoexecute" { } variable "db_instance_size" { - type = string + type = string description = "Instance size for external Azure Postgres server" - default = "GP_Standard_D4s_v3" + default = "GP_Standard_D4s_v3" } variable "external_psql" { - type = bool - description = "Option to create an Azure Postgres server for retool backend" - default = false + type = bool + description = "Option to create an Azure Postgres server for retool backend" + default = false } variable "security_rules" { @@ -86,21 +86,21 @@ variable "instance_size" { } variable "psql_password" { - type = string + type = string description = "Admin password sername for postgres database" - default = "mysupersecurepassword123" + default = "mysupersecurepassword123" } variable "psql_subnet_cidr" { - type = list(string) + type = list(string) description = "CIDR block for database subnet" - default = [ "10.0.2.0/24" ] + default = ["10.0.2.0/24"] } variable "psql_user" { - type = string + type = string description = "Admin username for postgres database" - default = "retool" + default = "retool" } variable "resource_group_name" { From d2e098176095018a59807ddc6f0b8f451e596d1e Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Mon, 9 Oct 2023 11:34:29 -0700 Subject: [PATCH 6/9] update extension, readme --- modules/azure_vm/README.md | 8 ++++++-- modules/azure_vm/main.tf | 7 +++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/azure_vm/README.md b/modules/azure_vm/README.md index e2f4b4c..725e6b5 100644 --- a/modules/azure_vm/README.md +++ b/modules/azure_vm/README.md @@ -7,6 +7,7 @@ ## Usage 1. Directly use our module in your existing Terraform configuration and provide the required variables + - If you want to use an external Postgres instance (Flexible Server), set external_psql to true. This is recommended for production deployments. ``` terraform { @@ -25,6 +26,8 @@ provider "azurerm" { module "retool" { source = "git@github.com:tryretool/retool-terraform.git//modules/azure_vm" + external_psql = "true" | "false" + psql_password = "" resource_group_name = "" subnet_name = "" version_number = "" @@ -64,12 +67,13 @@ vim Dockerfile docker-ps ``` -9. Modify your environment variables. If you have an external RDS database (strongly recommended), replace the `POSTGRES_` environment variables with the new ones. +9. Modify your environment variables in `docker.env`. If you have an external RDS database (strongly recommended), replace the `POSTGRES_` environment variables with the new ones. - If testing out your instance for the first time without SSL/HTTPS, you should uncomment `# COOKIE_INSECURE = true` - Replace your `LICENSE_KEY` with your provided Retool license key +- If using Postgres Flexible server, add `POSTGRES_SSL_ENABLED=true` -10. Add any additional configuration needed. You can refer to our documentation for [all additional environment variables](https://docs.retool.com/docs/environment-variables). +10. Add any additional configuration needed to the `docker.env` file. You can refer to our documentation for [all additional environment variables](https://docs.retool.com/docs/environment-variables). 11. Access your Retool instance on the public IP that is given via the resource creation outputs. If no SSL certificate has been configured you need to access the instance on port 3000 (append :3000 to the end of the URL) and via http. diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index 287fd90..a07a8cd 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -182,4 +182,11 @@ resource "azurerm_postgresql_flexible_server_database" "this" { server_id = azurerm_postgresql_flexible_server.this[0].id collation = "en_US.utf8" charset = "utf8" +} + +resource "azurerm_postgresql_flexible_server_configuration" "this" { + count = var.external_psql ? 1 : 0 + name = "azure.extensions" + server_id = azurerm_postgresql_flexible_server.this[0].id + value = "UUID-OSSP" } \ No newline at end of file From 0a68d590fc82be1fb9ed12a96406564cc4ce9109 Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Thu, 9 Nov 2023 12:24:40 -0800 Subject: [PATCH 7/9] naming fixes --- modules/azure_vm/main.tf | 6 +++--- modules/azure_vm/variables.tf | 11 +++++++++-- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index a07a8cd..3dac537 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -145,7 +145,7 @@ resource "azurerm_subnet" "this" { } resource "azurerm_private_dns_zone" "this" { count = var.external_psql ? 1 : 0 - name = "retool.postgres.database.azure.com" + name = "retool-dbs.postgres.database.azure.com" resource_group_name = data.azurerm_resource_group.selected.name } @@ -159,7 +159,7 @@ resource "azurerm_private_dns_zone_virtual_network_link" "this" { resource "azurerm_postgresql_flexible_server" "this" { count = var.external_psql ? 1 : 0 - name = "retool-psqlflexibleserver" + name = var.psql_flex_name resource_group_name = data.azurerm_resource_group.selected.name location = data.azurerm_resource_group.selected.location version = "12" @@ -189,4 +189,4 @@ resource "azurerm_postgresql_flexible_server_configuration" "this" { name = "azure.extensions" server_id = azurerm_postgresql_flexible_server.this[0].id value = "UUID-OSSP" -} \ No newline at end of file +} diff --git a/modules/azure_vm/variables.tf b/modules/azure_vm/variables.tf index 612e4c6..34445bc 100644 --- a/modules/azure_vm/variables.tf +++ b/modules/azure_vm/variables.tf @@ -76,7 +76,7 @@ variable "security_rules" { destination_address_prefix = "*" } ] - description = "Ingress rules for EC2 security group" + description = "Ingress rules for network security group" } variable "instance_size" { @@ -85,6 +85,13 @@ variable "instance_size" { default = "Standard_D4_v4" } +variable "psql_flex_name" { + type = string + description = "Name for psql flex server" + default = "retool" +} + + variable "psql_password" { type = string description = "Admin password sername for postgres database" @@ -127,4 +134,4 @@ variable "version_number" { variable "virtual_network_name" { type = string description = "Existing vnet to create resources in" -} \ No newline at end of file +} From 581d8c220e58a43020510e4ec1a0f64b18d89ad5 Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Wed, 22 Nov 2023 11:47:41 -0800 Subject: [PATCH 8/9] update naming, add outputs --- modules/azure_vm/main.tf | 4 ++-- modules/azure_vm/outputs.tf | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index 3dac537..b9d6316 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -33,7 +33,7 @@ resource "azurerm_public_ip" "this" { name = "retool_public_ip" resource_group_name = data.azurerm_resource_group.selected.name location = data.azurerm_resource_group.selected.location - allocation_method = "Dynamic" + allocation_method = "Static" lifecycle { create_before_destroy = true } @@ -128,7 +128,7 @@ resource "azurerm_virtual_machine_extension" "this" { resource "azurerm_subnet" "this" { count = var.external_psql ? 1 : 0 - name = "psql-flexible-sn" + name = "psql-flex-subnet" resource_group_name = data.azurerm_resource_group.selected.name virtual_network_name = data.azurerm_virtual_network.selected.name address_prefixes = var.psql_subnet_cidr diff --git a/modules/azure_vm/outputs.tf b/modules/azure_vm/outputs.tf index cbf6f76..3502f38 100644 --- a/modules/azure_vm/outputs.tf +++ b/modules/azure_vm/outputs.tf @@ -1,4 +1,14 @@ +output "flex_subnet" { + value = azurerm_subnet.this[0].id + description = "Subnet id of subnet for Azure Flexible servers" +} + +output "private_dns_zone_id" { + value = azurerm_private_dns_zone.this[0].id + description = "Id of private dns zone" +} + output "vm_public_ip" { value = azurerm_public_ip.this.ip_address description = "Public IP of VM Instance" -} \ No newline at end of file +} From 1cdd97d82e0952997ed9964d83ff5df57436daf5 Mon Sep 17 00:00:00 2001 From: michaelcramer Date: Thu, 8 Feb 2024 12:28:35 -0800 Subject: [PATCH 9/9] update vm disk size --- modules/azure_vm/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/modules/azure_vm/main.tf b/modules/azure_vm/main.tf index b9d6316..bbaf594 100644 --- a/modules/azure_vm/main.tf +++ b/modules/azure_vm/main.tf @@ -98,6 +98,7 @@ resource "azurerm_linux_virtual_machine" "this" { os_disk { caching = "ReadWrite" storage_account_type = "Standard_LRS" + disk_size_gb = "160" } source_image_reference {