Skip to content

Commit

Permalink
Implement start and stop actions for vm user resources (#1473)
Browse files Browse the repository at this point in the history
* windowsvm start stop implemented

* Implemented linux start stop

* Change start stop to use resource id

* Updated descriptions
  • Loading branch information
jjgriff93 authored Mar 10, 2022
1 parent 5131e76 commit 4baed08
Show file tree
Hide file tree
Showing 2 changed files with 118 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: tre-service-guacamole-linuxvm
version: 0.1.4
version: 0.1.7
description: "An Azure TRE User Resource Template for Guacamole (Linux)"
registry: azuretre
dockerfile: Dockerfile.tmpl
Expand Down Expand Up @@ -67,11 +67,17 @@ outputs:
type: string
applyTo:
- install
- name: azure_resource_id
type: string
applyTo:
- start
- stop

mixins:
- exec
- terraform:
clientVersion: 1.0.4
- az

install:
- terraform:
Expand Down Expand Up @@ -132,17 +138,63 @@ uninstall:
key: "{{ bundle.parameters.id }}"

start:
- exec:
- terraform:
arguments:
- "output"
description: "Get resource ID from Terraform outputs"
backendConfig:
resource_group_name:
"{{ bundle.parameters.tfstate_resource_group_name }}"
storage_account_name:
"{{ bundle.parameters.tfstate_storage_account_name }}"
container_name: "{{ bundle.parameters.tfstate_container_name }}"
key: "{{ bundle.parameters.id }}"
outputs:
- name: azure_resource_id
- az:
description:
"Login to Azure"
arguments:
- login
flags:
identity:
username: "{{ bundle.credentials.azure_client_id }}"
- az:
description:
"Start the VM"
command: echo
arguments:
- "NotImplemented"
- vm
- start
flags:
ids: "{{ bundle.outputs.azure_resource_id }}"

stop:
- exec:
- terraform:
arguments:
- "output"
description: "Get VM hostname and rg from Terraform outputs"
backendConfig:
resource_group_name:
"{{ bundle.parameters.tfstate_resource_group_name }}"
storage_account_name:
"{{ bundle.parameters.tfstate_storage_account_name }}"
container_name: "{{ bundle.parameters.tfstate_container_name }}"
key: "{{ bundle.parameters.id }}"
outputs:
- name: azure_resource_id
- az:
description:
"Login to Azure"
arguments:
- login
flags:
identity:
username: "{{ bundle.credentials.azure_client_id }}"
- az:
description:
"Stop the VM"
command: echo
arguments:
- "NotImplemented"
- vm
- stop
flags:
ids: "{{ bundle.outputs.azure_resource_id }}"
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
name: tre-service-guacamole-windowsvm
version: 0.1.4
version: 0.1.5
description: "An Azure TRE User Resource Template for Guacamole (Windows 10)"
registry: azuretre
dockerfile: Dockerfile.tmpl
Expand Down Expand Up @@ -67,11 +67,17 @@ outputs:
type: string
applyTo:
- install
- name: azure_resource_id
type: string
applyTo:
- start
- stop

mixins:
- exec
- terraform:
clientVersion: 1.0.4
- az

install:
- terraform:
Expand Down Expand Up @@ -132,17 +138,63 @@ uninstall:
key: "{{ bundle.parameters.id }}"

start:
- exec:
- terraform:
arguments:
- "output"
description: "Get resource ID from Terraform outputs"
backendConfig:
resource_group_name:
"{{ bundle.parameters.tfstate_resource_group_name }}"
storage_account_name:
"{{ bundle.parameters.tfstate_storage_account_name }}"
container_name: "{{ bundle.parameters.tfstate_container_name }}"
key: "{{ bundle.parameters.id }}"
outputs:
- name: azure_resource_id
- az:
description:
"Login to Azure"
arguments:
- login
flags:
identity:
username: "{{ bundle.credentials.azure_client_id }}"
- az:
description:
"Start the VM"
command: echo
arguments:
- "NotImplemented"
- vm
- start
flags:
ids: "{{ bundle.outputs.azure_resource_id }}"

stop:
- exec:
- terraform:
arguments:
- "output"
description: "Get VM hostname and rg from Terraform outputs"
backendConfig:
resource_group_name:
"{{ bundle.parameters.tfstate_resource_group_name }}"
storage_account_name:
"{{ bundle.parameters.tfstate_storage_account_name }}"
container_name: "{{ bundle.parameters.tfstate_container_name }}"
key: "{{ bundle.parameters.id }}"
outputs:
- name: azure_resource_id
- az:
description:
"Login to Azure"
arguments:
- login
flags:
identity:
username: "{{ bundle.credentials.azure_client_id }}"
- az:
description:
"Stop the VM"
command: echo
arguments:
- "NotImplemented"
- vm
- stop
flags:
ids: "{{ bundle.outputs.azure_resource_id }}"

0 comments on commit 4baed08

Please sign in to comment.