Skip to content

Commit

Permalink
vm updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tamirkamara committed Oct 7, 2023
1 parent 348b48d commit 4dce05f
Show file tree
Hide file tree
Showing 8 changed files with 53 additions and 44 deletions.
44 changes: 19 additions & 25 deletions templates/workspace_services/guacamole/porter.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-service-guacamole
version: 0.11.0
version: 0.11.1

description: "An Azure TRE service for Guacamole"
dockerfile: Dockerfile.tmpl
Expand Down Expand Up @@ -109,22 +109,17 @@ parameters:
type: string

outputs:
# - name: authentication_callback_uri
# type: string
# applyTo:
# - install
# - upgrade
# - name: connection_uri
# type: string
# applyTo:
# - install
# - upgrade
# - name: web_apps_addresses
# type: string
# applyTo:
# - install
# - upgrade
- name: internals
- name: authentication_callback_uri
type: string
applyTo:
- install
- upgrade
- name: web_apps_addresses
type: string
applyTo:
- install
- upgrade
- name: routing_fqdn
type: string
applyTo:
- install
Expand Down Expand Up @@ -167,11 +162,10 @@ install:
container_name: ${ bundle.parameters.tfstate_container_name }
key: tre-service-guacamole-${ bundle.parameters.id }
outputs:
# - name: authentication_callback_uri
# - name: web_apps_addresses
- name: authentication_callback_uri
- name: web_apps_addresses
- name: admin_connection_uri
# - name: connection_uri
- name: internals
- name: routing_fqdn

upgrade:
- terraform:
Expand Down Expand Up @@ -201,11 +195,11 @@ upgrade:
container_name: ${ bundle.parameters.tfstate_container_name }
key: tre-service-guacamole-${ bundle.parameters.id }
outputs:
# - name: authentication_callback_uri
# - name: web_apps_addresses
- name: authentication_callback_uri
- name: web_apps_addresses
- name: admin_connection_uri
# - name: connection_uri
- name: internals
- name: routing_fqdn


uninstall:
- terraform:
Expand Down
12 changes: 6 additions & 6 deletions templates/workspace_services/guacamole/template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
"arrayMatchField": "name",
"value": {
"name": "{{ resource.id }}",
"fqdn": "{{ resource.properties.internals.routing_fqdn }}"
"fqdn": "{{ resource.properties.routing_fqdn }}"
}
}
]
Expand All @@ -109,7 +109,7 @@
"arrayMatchField": "name",
"value": {
"name": "{{ resource.id }}",
"value": "{{ resource.properties.internals.authentication_callback_uri }}"
"value": "{{ resource.properties.authentication_callback_uri }}"
}
}
]
Expand All @@ -133,7 +133,7 @@
{
"name": "AzureAD",
"description": "AAD access for authNZ",
"source_addresses": "{{ resource.properties.internals.web_apps_addresses }}",
"source_addresses": "{{ resource.properties.web_apps_addresses }}",
"destination_addresses": [
"AzureActiveDirectory"
],
Expand Down Expand Up @@ -168,7 +168,7 @@
"arrayMatchField": "name",
"value": {
"name": "{{ resource.id }}",
"fqdn": "{{ resource.properties.internals.routing_fqdn }}"
"fqdn": "{{ resource.properties.routing_fqdn }}"
}
}
]
Expand All @@ -186,7 +186,7 @@
"arrayMatchField": "name",
"value": {
"name": "{{ resource.id }}",
"value": "{{ resource.properties.internals.authentication_callback_uri }}"
"value": "{{ resource.properties.authentication_callback_uri }}"
}
}
]
Expand All @@ -210,7 +210,7 @@
{
"name": "AzureAD",
"description": "AAD access for authNZ",
"source_addresses": "{{ resource.properties.internals.web_apps_addresses }}",
"source_addresses": "{{ resource.properties.web_apps_addresses }}",
"destination_addresses": [
"AzureActiveDirectory"
],
Expand Down
16 changes: 10 additions & 6 deletions templates/workspace_services/guacamole/terraform/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
output "internals" {
value = jsonencode({
authentication_callback_uri = local.webapp_auth_callback_url
routing_fqdn = var.is_exposed_externally ? azurerm_linux_web_app.guacamole.default_hostname : ""
web_apps_addresses = data.azurerm_subnet.web_apps.address_prefixes
})
output "authentication_callback_uri" {
value = local.webapp_auth_callback_url
}

output "routing_fqdn" {
value = var.is_exposed_externally ? azurerm_linux_web_app.guacamole.default_hostname : ""
}

output "web_apps_addresses" {
value = jsonencode(data.azurerm_subnet.web_apps.address_prefixes)
}

output "admin_connection_uri" {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
schemaVersion: 1.0.0
name: tre-service-guacamole-linuxvm
version: 0.6.9
version: 0.7.0
description: "An Azure TRE User Resource Template for Guacamole (Linux)"
dockerfile: Dockerfile.tmpl
registry: azuretre
Expand Down Expand Up @@ -101,6 +101,8 @@ parameters:
- name: shared_storage_name
type: string
default: "vm-shared-storage"
- name: tre_url
type: string

outputs:
- name: ip
Expand Down Expand Up @@ -146,6 +148,7 @@ install:
shared_storage_access: ${ bundle.parameters.shared_storage_access }
shared_storage_name: ${ bundle.parameters.shared_storage_name }
image_gallery_id: ${ bundle.parameters.image_gallery_id }
tre_url: ${ bundle.parameters.tre_url }
backendConfig:
resource_group_name: ${ bundle.parameters.tfstate_resource_group_name }
storage_account_name: ${ bundle.parameters.tfstate_storage_account_name }
Expand All @@ -170,6 +173,7 @@ upgrade:
shared_storage_access: ${ bundle.parameters.shared_storage_access }
shared_storage_name: ${ bundle.parameters.shared_storage_name }
image_gallery_id: ${ bundle.parameters.image_gallery_id }
tre_url: ${ bundle.parameters.tre_url }
backendConfig:
resource_group_name: ${ bundle.parameters.tfstate_resource_group_name }
storage_account_name: ${ bundle.parameters.tfstate_storage_account_name }
Expand Down Expand Up @@ -203,6 +207,7 @@ uninstall:
shared_storage_access: ${ bundle.parameters.shared_storage_access }
shared_storage_name: ${ bundle.parameters.shared_storage_name }
image_gallery_id: ${ bundle.parameters.image_gallery_id }
tre_url: ${ bundle.parameters.tre_url }
backendConfig:
resource_group_name: ${ bundle.parameters.tfstate_resource_group_name }
storage_account_name: ${ bundle.parameters.tfstate_storage_account_name }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,6 @@ data "azurerm_key_vault" "ws" {
resource_group_name = data.azurerm_resource_group.ws.name
}

data "azurerm_linux_web_app" "guacamole" {
name = "guacamole-${var.tre_id}-ws-${local.short_workspace_id}-svc-${local.short_parent_id}"
resource_group_name = data.azurerm_resource_group.ws.name
}

data "azurerm_public_ip" "app_gateway_ip" {
name = "pip-agw-${var.tre_id}"
resource_group_name = data.azurerm_resource_group.core.name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ output "azure_resource_id" {
}

output "connection_uri" {
value = "https://${data.azurerm_linux_web_app.guacamole.default_hostname}/?/client/${textencodebase64("${azurerm_linux_virtual_machine.linuxvm.name}\u0000c\u0000azuretre", "UTF-8")}"
value = "${var.tre_url}/${var.parent_service_id}/?/client/${textencodebase64("${azurerm_linux_virtual_machine.linuxvm.name}\u0000c\u0000azuretre", "UTF-8")}"
}

output "vm_username" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@ variable "image_gallery_id" {
type = string
default = ""
}
variable "tre_url" {
type = string
validation {
condition = startswith(var.tre_url, "http") && length(var.tre_url) > 10
error_message = "Invalid tre_url. Must start with http or https."
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,8 @@ variable "image_gallery_id" {
}
variable "tre_url" {
type = string
validation {
condition = startswith(var.tre_url, "http") && length(var.tre_url) > 10
error_message = "Invalid tre_url. Must start with http or https."
}
}

0 comments on commit 4dce05f

Please sign in to comment.