From e542faa604854440e570a8add732fe6ac1bbd7a2 Mon Sep 17 00:00:00 2001 From: surajsbharadwaj <101711050+surajsbharadwaj@users.noreply.github.com> Date: Fri, 27 Oct 2023 00:01:27 +0200 Subject: [PATCH] fix: remove count of images validation from pi_images (#14) --- README.md | 4 ++-- modules/pi-workspace/README.md | 2 +- modules/pi-workspace/variables.tf | 14 +++++--------- variables.tf | 10 ++++------ 4 files changed, 12 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 28ce5f8..0ea4d47 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,7 @@ module "power-workspace" { pi_resource_group_name = var.pi_resource_group_name pi_workspace_name = var.pi_workspace_name pi_ssh_public_key = var.pi_ssh_public_key + pi_image_names = var.pi_image_names pi_cloud_connection = var.pi_cloud_connection #(optional, default check vars) pi_private_subnet_1 = var.pi_private_subnet_1 #(optional, default []) pi_private_subnet_2 = var.pi_private_subnet_2 #(optional, default []) @@ -58,7 +59,6 @@ module "power-workspace" { pi_public_subnet_enable = var.pi_public_subnet_enable #(optional, default false) pi_transit_gateway_connection = var.pi_transit_gateway_connection #(optional, default check vars) pi_tags = var.pi_tags #(optional, default []) - pi_image_names = var.pi_image_names #(optional, default []) } ``` @@ -109,7 +109,7 @@ You need the following permissions to run this module. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [pi\_cloud\_connection](#input\_pi\_cloud\_connection) | Cloud connection configuration: speed (50, 100, 200, 500, 1000, 2000, 5000, 10000 Mb/s), count (1 or 2 connections), global\_routing (true or false), metered (true or false). Not applicable for PER enabled DC and CCs will not be created. |
object({
count = number
speed = number
global_routing = bool
metered = bool
})
|
{
"count": 2,
"global_routing": true,
"metered": true,
"speed": 5000
}
| no | -| [pi\_image\_names](#input\_pi\_image\_names) | List of images to be imported into cloud account from catalog images. Max number of images that can be imported is 6 images. Can be set to null and images will not be imported. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md) | `list(string)` | `null` | no | +| [pi\_image\_names](#input\_pi\_image\_names) | List of images to be imported into cloud account from catalog images. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md) | `list(string)` | n/a | yes | | [pi\_private\_subnet\_1](#input\_pi\_private\_subnet\_1) | IBM Cloud PowerVS first private subnet name and cidr which will be created. Set value to null to not create this subnet. |
object({
name = string
cidr = string
})
|
{
"cidr": "10.51.0.0/24",
"name": "sub_1"
}
| no | | [pi\_private\_subnet\_2](#input\_pi\_private\_subnet\_2) | IBM Cloud PowerVS second private subnet name and cidr which will be created. Set value to null to not create this subnet. |
object({
name = string
cidr = string
})
| `null` | no | | [pi\_private\_subnet\_3](#input\_pi\_private\_subnet\_3) | IBM Cloud PowerVS third private subnet name and cidr which will be created. Set value to null to not create this subnet. |
object({
name = string
cidr = string
})
| `null` | no | diff --git a/modules/pi-workspace/README.md b/modules/pi-workspace/README.md index 081b02a..16e800e 100644 --- a/modules/pi-workspace/README.md +++ b/modules/pi-workspace/README.md @@ -64,7 +64,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [pi\_image\_names](#input\_pi\_image\_names) | List of images to be imported into cloud account from catalog images. Max number of images that can be imported is 6 images. Can be set to null and images will not be imported. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md) | `list(string)` | n/a | yes | +| [pi\_image\_names](#input\_pi\_image\_names) | List of images to be imported into cloud account from catalog images. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md) | `list(string)` | n/a | yes | | [pi\_private\_subnet\_1](#input\_pi\_private\_subnet\_1) | IBM Cloud PowerVS first private subnet name and cidr which will be created. Set value to null to not create this subnet. |
object({
name = string
cidr = string
})
| n/a | yes | | [pi\_private\_subnet\_2](#input\_pi\_private\_subnet\_2) | IBM Cloud PowerVS second private subnet name and cidr which will be created. Set value to null to not create this subnet. |
object({
name = string
cidr = string
})
| n/a | yes | | [pi\_private\_subnet\_3](#input\_pi\_private\_subnet\_3) | IBM Cloud PowerVS third private subnet name and cidr which will be created. Set value to null to not create this subnet. |
object({
name = string
cidr = string
})
| n/a | yes | diff --git a/modules/pi-workspace/variables.tf b/modules/pi-workspace/variables.tf index b7b7200..3f7bc84 100644 --- a/modules/pi-workspace/variables.tf +++ b/modules/pi-workspace/variables.tf @@ -21,6 +21,11 @@ variable "pi_ssh_public_key" { }) } +variable "pi_image_names" { + description = "List of images to be imported into cloud account from catalog images. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md)" + type = list(string) +} + variable "pi_private_subnet_1" { description = "IBM Cloud PowerVS first private subnet name and cidr which will be created. Set value to null to not create this subnet." type = object({ @@ -71,12 +76,3 @@ variable "pi_tags" { description = "List of Tag names for IBM Cloud PowerVS workspace." type = list(string) } - -variable "pi_image_names" { - description = "List of images to be imported into cloud account from catalog images. Max number of images that can be imported is 6 images. Can be set to null and images will not be imported. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md)" - type = list(string) - validation { - error_message = "Exceeds the length of list of list by 6. Can support max 6 values only." - condition = var.pi_image_names != null ? length(var.pi_image_names) < 7 ? true : false : true - } -} diff --git a/variables.tf b/variables.tf index ffb2dc9..b1644c6 100644 --- a/variables.tf +++ b/variables.tf @@ -29,6 +29,10 @@ variable "pi_ssh_public_key" { }) } +variable "pi_image_names" { + description = "List of images to be imported into cloud account from catalog images. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md)" + type = list(string) +} ######################################################## #Optional Parameters @@ -104,9 +108,3 @@ variable "pi_tags" { type = list(string) default = null } - -variable "pi_image_names" { - description = "List of images to be imported into cloud account from catalog images. Max number of images that can be imported is 6 images. Can be set to null and images will not be imported. Supported values can be found [here](https://github.com/terraform-ibm-modules/terraform-ibm-powervs-workspace/blob/main/docs/catalog_images_list.md)" - type = list(string) - default = null -}