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

Add VM size configuration for Sonatype Nexus #4210

Merged
merged 2 commits into from
Dec 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
Add VM size configuration for Sonatype Nexus
Fixes #4209

Add VM size configurability for Sonatype Nexus VM.

* Add a new parameter "vm_size" in `templates/shared_services/sonatype-nexus-vm/parameters.json` and `templates/shared_services/sonatype-nexus-vm/porter.yaml`.
* Update `templates/shared_services/sonatype-nexus-vm/template_schema.json` to include an input field for "vm_size" with a dropdown list of recommended sizes.
* Modify `templates/shared_services/sonatype-nexus-vm/terraform/vm.tf` to use the "vm_size" parameter instead of the hardcoded value.
* Add a new variable "vm_size" in `templates/shared_services/sonatype-nexus-vm/terraform/variables.tf` with a default value of "Standard_B2ms".
* Update the bundle version to "3.2.3" in `templates/shared_services/sonatype-nexus-vm/porter.yaml`.

---

For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/microsoft/AzureTRE/issues/4209?shareId=XXXX-XXXX-XXXX-XXXX).
  • Loading branch information
marrobi authored and Tamir Kamara committed Dec 24, 2024
commit 6eca2cd95305c94cfab2cec762e971a0dcd930ba
6 changes: 6 additions & 0 deletions templates/shared_services/sonatype-nexus-vm/parameters.json
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
"source": {
"env": "KEY_STORE_ID"
}
},
{
"name": "vm_size",
"source": {
"env": "VM_SIZE"
}
}
]
}
7 changes: 7 additions & 0 deletions templates/shared_services/sonatype-nexus-vm/porter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ parameters:
- name: key_store_id
type: string
default: ""
- name: vm_size
type: string
default: "Standard_B2ms"
description: "The size of the VM to be deployed"
outputs:
- name: workspace_vm_allowed_fqdns_list
type: string
Expand Down Expand Up @@ -93,6 +97,7 @@ install:
ssl_cert_name: ${ bundle.parameters.ssl_cert_name }
enable_cmk_encryption: ${ bundle.parameters.enable_cmk_encryption }
key_store_id: ${ bundle.parameters.key_store_id }
vm_size: ${ bundle.parameters.vm_size }
backendConfig:
use_azuread_auth: "true"
use_oidc: "true"
Expand All @@ -116,6 +121,7 @@ upgrade:
ssl_cert_name: ${ bundle.parameters.ssl_cert_name }
enable_cmk_encryption: ${ bundle.parameters.enable_cmk_encryption }
key_store_id: ${ bundle.parameters.key_store_id }
vm_size: ${ bundle.parameters.vm_size }
backendConfig:
use_azuread_auth: "true"
use_oidc: "true"
Expand All @@ -139,6 +145,7 @@ uninstall:
ssl_cert_name: ${ bundle.parameters.ssl_cert_name }
enable_cmk_encryption: ${ bundle.parameters.enable_cmk_encryption }
key_store_id: ${ bundle.parameters.key_store_id }
vm_size: ${ bundle.parameters.vm_size }
backendConfig:
use_azuread_auth: "true"
use_oidc: "true"
Expand Down
12 changes: 12 additions & 0 deletions templates/shared_services/sonatype-nexus-vm/template_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,18 @@
"title": "Expose externally",
"description": "Is the Sonatype Nexus accessible from outside of the TRE network.",
"default": false
},
"vm_size": {
"type": "string",
"title": "VM Size",
"description": "The size of the VM to be deployed",
"default": "Standard_B2ms",
"enum": [
"Standard_B2ms",
"Standard_B4ms",
"Standard_D2s_v3",
"Standard_D4s_v3"
]
}
},
"uiSchema": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,9 @@ variable "enable_cmk_encryption" {
variable "key_store_id" {
type = string
}

variable "vm_size" {
type = string
description = "The size of the VM to be deployed"
default = "Standard_B2ms"
}
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ resource "azurerm_linux_virtual_machine" "nexus" {
resource_group_name = local.core_resource_group_name
location = data.azurerm_resource_group.rg.location
network_interface_ids = [azurerm_network_interface.nexus.id]
size = "Standard_D2s_v3"
size = var.vm_size
disable_password_authentication = false
admin_username = "adminuser"
admin_password = random_password.nexus_vm_password.result
Expand Down