Skip to content

Commit 2fd750d

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
tests: update test code and small updates to variables.tf + main.tf
1 parent 5eb0682 commit 2fd750d

File tree

16 files changed

+325
-104
lines changed

16 files changed

+325
-104
lines changed

.secrets.baseline

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-01-24T16:49:18Z",
6+
"generated_at": "2025-02-11T22:49:03Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -76,18 +76,7 @@
7676
"name": "TwilioKeyDetector"
7777
}
7878
],
79-
"results": {
80-
"solutions/deploy/README.md": [
81-
{
82-
"hashed_secret": "2254481e1661d8f017a712b0d1ad9a14fd9460a3",
83-
"is_secret": false,
84-
"is_verified": false,
85-
"line_number": 134,
86-
"type": "Secret Keyword",
87-
"verified_result": null
88-
}
89-
]
90-
},
79+
"results": {},
9180
"version": "0.13.1+ibm.62.dss",
9281
"word_list": {
9382
"file": null,

examples/basic/variables.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
##############################################################################
44

55
variable "ibmcloud_api_key" {
6-
description = "The IBM Cloud platform API key needed to deploy IAM enabled resources."
6+
description = "The IBM Cloud API key to deploy resources."
77
type = string
88
sensitive = true
99
}
@@ -14,8 +14,8 @@ variable "prefix" {
1414
default = "lz-roks-cp4d"
1515

1616
validation {
17-
error_message = "Prefix must begin with a letter and contain only lowercase letters, numbers, and - characters. Prefixes must end with a lowercase letter or number and be 13 or fewer characters."
18-
condition = can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix)) && length(var.prefix) <= 13
17+
error_message = "Prefix must begin with a letter and contain only lowercase letters, numbers, and - characters. Prefixes must end with a lowercase letter or number and be 16 or fewer characters."
18+
condition = can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", var.prefix)) && length(var.prefix) <= 16
1919
}
2020
}
2121

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ terraform {
33
required_providers {
44
# renovate is set up to keep provider version at the latest for all DA solutions
55
ibm = {
6-
source = "IBM-Cloud/ibm"
6+
source = "ibm-cloud/ibm"
77
version = "1.71.3"
88
}
99
}

solutions/deploy/README.md

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,10 @@ You need the following permissions to run this module:
101101

102102
| Name | Version |
103103
|------|---------|
104-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2.0 |
104+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >=1.3.0 |
105105
| <a name="requirement_external"></a> [external](#requirement\_external) | >= 2.3.4 |
106106
| <a name="requirement_helm"></a> [helm](#requirement\_helm) | >= 2.8.0, <3.0.0 |
107-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.66.0, < 2.0.0 |
107+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | 1.71.3 |
108108

109109
### Modules
110110

@@ -120,32 +120,32 @@ You need the following permissions to run this module:
120120

121121
| Name | Type |
122122
|------|------|
123-
| [ibm_container_addons.odf_cluster_addon](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/container_addons) | resource |
123+
| [ibm_container_addons.odf_cluster_addon](https://registry.terraform.io/providers/ibm-cloud/ibm/1.71.3/docs/resources/container_addons) | resource |
124124
| [external_external.schematics](https://registry.terraform.io/providers/hashicorp/external/latest/docs/data-sources/external) | data source |
125-
| [ibm_container_cluster_config.cluster_config](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/container_cluster_config) | data source |
126-
| [ibm_container_vpc_cluster.cluster_info](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/container_vpc_cluster) | data source |
125+
| [ibm_container_cluster_config.cluster_config](https://registry.terraform.io/providers/ibm-cloud/ibm/1.71.3/docs/data-sources/container_cluster_config) | data source |
126+
| [ibm_container_vpc_cluster.cluster_info](https://registry.terraform.io/providers/ibm-cloud/ibm/1.71.3/docs/data-sources/container_vpc_cluster) | data source |
127127

128128
### Inputs
129129

130130
| Name | Description | Type | Default | Required |
131131
|------|-------------|------|---------|:--------:|
132-
| <a name="input_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#input\_cloud\_pak\_deployer\_image) | Cloud Pak Deployer image location. If not defined, it will build the image via code engine | `string` | `null` | no |
132+
| <a name="input_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#input\_cloud\_pak\_deployer\_image) | Cloud Pak Deployer image to use. If `null`, the image will be built using Code Engine. | `string` | `null` | no |
133133
| <a name="input_cloud_pak_deployer_release"></a> [cloud\_pak\_deployer\_release](#input\_cloud\_pak\_deployer\_release) | Release of Cloud Pak Deployer version to use. View releases at: https://github.com/IBM/cloud-pak-deployer/releases. | `string` | `"v3.1.2"` | no |
134-
| <a name="input_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#input\_cloud\_pak\_deployer\_secret) | Image pull secret for the cloud pak deployer image | <pre>object({<br/> username = string<br/> password = string<br/> server = string<br/> email = string<br/> })</pre> | `null` | no |
135-
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of Red Hat OpenShift cluster to install watsonx onto | `string` | n/a | yes |
136-
| <a name="input_code_engine_project_id"></a> [code\_engine\_project\_id](#input\_code\_engine\_project\_id) | If you want to use an existing project, you can pass the code engine project id and the cloud pak deployer build will be built within the existing project vs a new one being created. | `string` | `null` | no |
137-
| <a name="input_code_engine_project_name"></a> [code\_engine\_project\_name](#input\_code\_engine\_project\_name) | If the variable cloud\_pak\_deployer\_image is null, it will build the image with code engine and store it within a private icr registry. Provide a name if you want to set the name. If not defined, default will be {prefix}-cpd-{random-suffix} | `string` | `null` | no |
138-
| <a name="input_cpd_accept_license"></a> [cpd\_accept\_license](#input\_cpd\_accept\_license) | When set to 'true', it is understood that the user has read the terms of the Cloud Pak license(s) and agrees to the terms outlined | `bool` | `false` | no |
139-
| <a name="input_cpd_admin_password"></a> [cpd\_admin\_password](#input\_cpd\_admin\_password) | Password to be used by the admin user to access the Cloud Pak for Data UI. | `string` | n/a | yes |
134+
| <a name="input_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#input\_cloud\_pak\_deployer\_secret) | Secret for accessing the Cloud Pak Deployer image. If `null`, a default secret will be created. | `map(string)` | `null` | no |
135+
| <a name="input_cluster_name"></a> [cluster\_name](#input\_cluster\_name) | Name of the OpenShift cluster. | `string` | n/a | yes |
136+
| <a name="input_code_engine_project_id"></a> [code\_engine\_project\_id](#input\_code\_engine\_project\_id) | If you want to use an existing project, you can pass the code engine project ID and the Cloud Pak Deployer build will be built within the existing project instead of creating a new one. | `string` | `null` | no |
137+
| <a name="input_code_engine_project_name"></a> [code\_engine\_project\_name](#input\_code\_engine\_project\_name) | If the variable cloud\_pak\_deployer\_image is null, it will build the image with code engine and store it within a private ICR registry. Provide a name if you want to set the name. If not defined, default will be `{prefix}-cpd-{random-suffix}`. | `string` | `null` | no |
138+
| <a name="input_cpd_accept_license"></a> [cpd\_accept\_license](#input\_cpd\_accept\_license) | When set to 'true', it is understood that the user has read the terms of the Cloud Pak license(s) and agrees to the terms outlined. | `bool` | `false` | no |
139+
| <a name="input_cpd_admin_password"></a> [cpd\_admin\_password](#input\_cpd\_admin\_password) | Password for the Cloud Pak for Data admin user. | `string` | n/a | yes |
140140
| <a name="input_cpd_entitlement_key"></a> [cpd\_entitlement\_key](#input\_cpd\_entitlement\_key) | Cloud Pak for Data entitlement key for access to the IBM Entitled Registry. Can be fetched from https://myibm.ibm.com/products-services/containerlibrary. | `string` | n/a | yes |
141141
| <a name="input_cpd_version"></a> [cpd\_version](#input\_cpd\_version) | Cloud Pak for Data version to install. Only version 5.x.x is supported | `string` | `"5.0.3"` | no |
142-
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | APIkey that's associated with the account to use | `string` | n/a | yes |
143-
| <a name="input_install_odf_cluster_addon"></a> [install\_odf\_cluster\_addon](#input\_install\_odf\_cluster\_addon) | Install the odf cluster addon | `bool` | `true` | no |
144-
| <a name="input_odf_config"></a> [odf\_config](#input\_odf\_config) | Version of ODF to install | `map(string)` | <pre>{<br/> "addSingleReplicaPool": "false",<br/> "billingType": "essentials",<br/> "clusterEncryption": "false",<br/> "disableNoobaaLB": "false",<br/> "enableNFS": "false",<br/> "encryptionInTransit": "false",<br/> "hpcsBaseUrl": "",<br/> "hpcsEncryption": "false",<br/> "hpcsInstanceId": "",<br/> "hpcsSecretName": "",<br/> "hpcsServiceName": "",<br/> "hpcsTokenUrl": "",<br/> "ignoreNoobaa": "true",<br/> "numOfOsd": "1",<br/> "ocsUpgrade": "false",<br/> "odfDeploy": "true",<br/> "osdDevicePaths": "",<br/> "osdSize": "512Gi",<br/> "osdStorageClassName": "ibmc-vpc-block-metro-10iops-tier",<br/> "prepareForDisasterRecovery": "false",<br/> "resourceProfile": "balanced",<br/> "taintNodes": "false",<br/> "useCephRBDAsDefaultStorageClass": "false",<br/> "workerNodes": "all",<br/> "workerPool": ""<br/>}</pre> | no |
145-
| <a name="input_odf_version"></a> [odf\_version](#input\_odf\_version) | Version of ODF to install | `string` | `"4.16.0"` | no |
146-
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters. | `string` | n/a | yes |
147-
| <a name="input_region"></a> [region](#input\_region) | Region where resources wills be created. To find your VPC region, use `ibmcloud is regions` command to find available regions. | `string` | n/a | yes |
148-
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group to provision services within. If not defined, a resource group called {prefix}-cpd will be created | `string` | `null` | no |
142+
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | The IBM Cloud API key to deploy resources. | `string` | n/a | yes |
143+
| <a name="input_install_odf_cluster_addon"></a> [install\_odf\_cluster\_addon](#input\_install\_odf\_cluster\_addon) | Install the ODF cluster addon. | `bool` | `true` | no |
144+
| <a name="input_odf_config"></a> [odf\_config](#input\_odf\_config) | Configuration for the ODF addon. | `map(string)` | <pre>{<br/> "addSingleReplicaPool": "false",<br/> "billingType": "essentials",<br/> "clusterEncryption": "false",<br/> "disableNoobaaLB": "false",<br/> "enableNFS": "false",<br/> "encryptionInTransit": "false",<br/> "hpcsBaseUrl": "",<br/> "hpcsEncryption": "false",<br/> "hpcsInstanceId": "",<br/> "hpcsSecretName": "",<br/> "hpcsServiceName": "",<br/> "hpcsTokenUrl": "",<br/> "ignoreNoobaa": "true",<br/> "numOfOsd": "1",<br/> "ocsUpgrade": "false",<br/> "odfDeploy": "true",<br/> "osdDevicePaths": "",<br/> "osdSize": "512Gi",<br/> "osdStorageClassName": "ibmc-vpc-block-metro-10iops-tier",<br/> "prepareForDisasterRecovery": "false",<br/> "resourceProfile": "balanced",<br/> "taintNodes": "false",<br/> "useCephRBDAsDefaultStorageClass": "false",<br/> "workerNodes": "all",<br/> "workerPool": ""<br/>}</pre> | no |
145+
| <a name="input_odf_version"></a> [odf\_version](#input\_odf\_version) | Version of ODF to install. | `string` | `"4.16.0"` | no |
146+
| <a name="input_prefix"></a> [prefix](#input\_prefix) | A unique identifier for resources that is prepended to resources that are provisioned. Must begin with a lowercase letter and end with a lowercase letter or number. Must be 16 or fewer characters. | `string` | `null` | no |
147+
| <a name="input_region"></a> [region](#input\_region) | Region where resources will be created. To find your VPC region, use `ibmcloud is regions` command to find available regions. | `string` | n/a | yes |
148+
| <a name="input_resource_group"></a> [resource\_group](#input\_resource\_group) | Resource group to provision services within. If not defined, a resource group called `{prefix}-cpd` will be created. | `string` | `null` | no |
149149
| <a name="input_resource_group_exists"></a> [resource\_group\_exists](#input\_resource\_group\_exists) | Resource group exists or not within the account. | `bool` | `false` | no |
150150
| <a name="input_watson_assistant_install"></a> [watson\_assistant\_install](#input\_watson\_assistant\_install) | If watsonx.ai is being installed, also install watson assistant | `bool` | `false` | no |
151151
| <a name="input_watson_discovery_install"></a> [watson\_discovery\_install](#input\_watson\_discovery\_install) | If watsonx.ai is being installed, also install watson discovery | `bool` | `false` | no |
@@ -155,7 +155,12 @@ You need the following permissions to run this module:
155155

156156
### Outputs
157157

158-
No outputs.
158+
| Name | Description |
159+
|------|-------------|
160+
| <a name="output_cloud_pak_deployer_image"></a> [cloud\_pak\_deployer\_image](#output\_cloud\_pak\_deployer\_image) | The Cloud Pak Deployer image used. |
161+
| <a name="output_cloud_pak_deployer_secret"></a> [cloud\_pak\_deployer\_secret](#output\_cloud\_pak\_deployer\_secret) | The secret used for accessing the Cloud Pak Deployer image. |
162+
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | The name of the OpenShift cluster. |
163+
| <a name="output_code_engine_project_name"></a> [code\_engine\_project\_name](#output\_code\_engine\_project\_name) | The name of the code engine project that was created |
159164
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
160165

161166
<!-- Leave this section as is so that your module has a link to local development environment set-up steps for contributors to follow -->

solutions/deploy/cpd-image-build/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
variable "ibmcloud_api_key" {
2-
description = "APIkey that's associated with the account to use"
2+
description = "The IBM Cloud API key to deploy resources."
33
type = string
44
sensitive = true
55
}

solutions/deploy/cpd-image-build/version.tf

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
terraform {
2-
required_version = ">= 1.2.0"
2+
required_version = ">=1.3.0"
33
required_providers {
44
ibm = {
5-
source = "IBM-Cloud/ibm"
6-
version = ">= 1.68.1, < 2.0.0"
5+
source = "ibm-cloud/ibm"
6+
version = "1.71.3"
77
}
88
random = {
99
source = "hashicorp/random"

solutions/deploy/main.tf

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ locals {
1010
}
1111
}
1212

13-
# Retrieve the openshift cluster info
13+
# Retrieve the OpenShift cluster info
1414
data "ibm_container_vpc_cluster" "cluster_info" {
1515
name = var.cluster_name
1616
}
@@ -55,8 +55,12 @@ module "watsonx_data" {
5555
}
5656

5757
module "cloud_pak_deployer" {
58-
depends_on = [module.watsonx_ai, module.watsonx_data, module.build_cpd_image]
59-
source = "./cloud-pak-deployer"
58+
depends_on = [
59+
module.watsonx_ai,
60+
module.watsonx_data,
61+
module.build_cpd_image
62+
]
63+
source = "./cloud-pak-deployer"
6064
cloud_pak_deployer_config = merge(
6165
module.config.cloud_pak_deployer_config_base,
6266
{

solutions/deploy/outputs.tf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
output "cloud_pak_deployer_image" {
2+
description = "The Cloud Pak Deployer image used."
3+
value = var.cloud_pak_deployer_image != null ? var.cloud_pak_deployer_image : module.build_cpd_image[0].container_registry_output_image
4+
}
5+
6+
output "cloud_pak_deployer_secret" {
7+
description = "The secret used for accessing the Cloud Pak Deployer image."
8+
value = var.cloud_pak_deployer_secret != null ? var.cloud_pak_deployer_secret : (var.cloud_pak_deployer_image == null ? { username : "iamapikey", password : var.ibmcloud_api_key, server : module.build_cpd_image[0].container_registry_server, email : "none" } : null)
9+
sensitive = true
10+
}
11+
12+
output "cluster_name" {
13+
description = "The name of the OpenShift cluster."
14+
value = var.cluster_name
15+
}
16+
17+
output "code_engine_project_name" {
18+
description = "The name of the code engine project that was created"
19+
value = var.cloud_pak_deployer_image == null ? module.build_cpd_image.code_engine_project_name : null
20+
}

0 commit comments

Comments
 (0)