Skip to content

Commit 0073b9b

Browse files
feat: support for deploying in existing resource group (#8)
1 parent b2a2bea commit 0073b9b

14 files changed

+80
-188
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
apiVersion: v1
3+
offerings:
4+
- name: deploy-arch-ibm-watsonx-ai-saas
5+
kind: solution
6+
catalog_id: b5c105a0-04ac-4418-ab2a-3696f7f1d96d
7+
offering_id: 268199b0-46f8-4717-83ce-600e292c5361
8+
variations:
9+
- name: standard
10+
mark_ready: true
11+
install_type: fullstack

.releaserc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
}],
1111
["@semantic-release/exec", {
1212
"successCmd": "echo \"SEMVER_VERSION=${nextRelease.version}\" >> $GITHUB_ENV"
13+
}],
14+
["@semantic-release/exec",{
15+
"publishCmd": "./ci/trigger-catalog-onboarding-pipeline.sh --version=v${nextRelease.version}"
1316
}]
1417
]
1518
}

CHANGELOG.md

Lines changed: 0 additions & 134 deletions
This file was deleted.

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ statement instead the previous block.
113113
|------|---------|
114114
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.0, <1.7.0 |
115115
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.62.0 |
116-
| <a name="requirement_random"></a> [random](#requirement\_random) | 3.6.0 |
117116
| <a name="requirement_restapi"></a> [restapi](#requirement\_restapi) | >= 1.19.1 |
118117

119118
### Modules
@@ -134,7 +133,6 @@ statement instead the previous block.
134133
| [ibm_resource_instance.governance_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
135134
| [ibm_resource_instance.machine_learning_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
136135
| [ibm_resource_instance.studio_instance](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_instance) | resource |
137-
| [random_string.unique_identifier](https://registry.terraform.io/providers/hashicorp/random/3.6.0/docs/resources/string) | resource |
138136
| [ibm_iam_auth_token.tokendata](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/data-sources/iam_auth_token) | data source |
139137

140138
### Inputs
@@ -147,8 +145,9 @@ statement instead the previous block.
147145
| <a name="input_project_description"></a> [project\_description](#input\_project\_description) | Description of the watson project to create. | `string` | `"Watson Project created via watsonx-ai SaaS DA"` | no |
148146
| <a name="input_project_name"></a> [project\_name](#input\_project\_name) | Name of the watson project to create. | `string` | `"demo"` | no |
149147
| <a name="input_project_tags"></a> [project\_tags](#input\_project\_tags) | Tags to attach to the watson project to create. | `list(string)` | <pre>[<br> "watsonx-ai-SaaS"<br>]</pre> | no |
150-
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | Name of the IBM Cloud resource group in which resources should be created | `string` | `null` | no |
148+
| <a name="input_resource_group_name"></a> [resource\_group\_name](#input\_resource\_group\_name) | The name of a new or an existing resource group in which to provision resources to. | `string` | n/a | yes |
151149
| <a name="input_resource_prefix"></a> [resource\_prefix](#input\_resource\_prefix) | Name to be used on all Watson resource as prefix | `string` | `"watsonx-poc"` | no |
150+
| <a name="input_use_existing_resource_group"></a> [use\_existing\_resource\_group](#input\_use\_existing\_resource\_group) | Whether to use an existing resource group. | `bool` | `false` | no |
152151
| <a name="input_watson_assistant_plan"></a> [watson\_assistant\_plan](#input\_watson\_assistant\_plan) | Resource plan used to provision the watsonx Assistance instance. | `string` | `"do not install"` | no |
153152
| <a name="input_watson_discovery_plan"></a> [watson\_discovery\_plan](#input\_watson\_discovery\_plan) | Resource plan used to provision the Watson Discovery instance. | `string` | `"do not install"` | no |
154153
| <a name="input_watson_governance_plan"></a> [watson\_governance\_plan](#input\_watson\_governance\_plan) | Resource plan used to provision the watsonx Governance instance. | `string` | `"do not install"` | no |
@@ -161,6 +160,7 @@ statement instead the previous block.
161160
|------|-------------|
162161
| <a name="output_project_id"></a> [project\_id](#output\_project\_id) | ID of the created project |
163162
| <a name="output_project_url"></a> [project\_url](#output\_project\_url) | URL of the created project |
163+
| <a name="output_resource_group_id"></a> [resource\_group\_id](#output\_resource\_group\_id) | ID of the resource group used to provision the resources |
164164
| <a name="output_watson_governance_crn"></a> [watson\_governance\_crn](#output\_watson\_governance\_crn) | CRN of the Watson Governance instance |
165165
| <a name="output_watson_governance_dashboard_url"></a> [watson\_governance\_dashboard\_url](#output\_watson\_governance\_dashboard\_url) | Dashboard URL of the Watson Governance instance |
166166
| <a name="output_watson_governance_guid"></a> [watson\_governance\_guid](#output\_watson\_governance\_guid) | GUID of the Watson Governance instance |

catalogValidationValues.json.template

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"ibmcloud_api_key": $VALIDATION_APIKEY,
3+
}

examples/basic/main.tf

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
locals {
2+
unique_identifier = random_string.unique_identifier.result
3+
}
4+
5+
# Access random string generated with random_string.unique_identifier.result
6+
resource "random_string" "unique_identifier" {
7+
length = 6
8+
special = false
9+
upper = false
10+
}
11+
12+
113
module "watson_saas" {
2-
source = "../.."
3-
ibmcloud_api_key = var.ibmcloud_api_key
4-
resource_prefix = "example-basic-test"
5-
project_name = "project-basic-test"
14+
source = "../.."
15+
ibmcloud_api_key = var.ibmcloud_api_key
16+
resource_prefix = "example-basic-test"
17+
resource_group_name = local.unique_identifier
18+
project_name = "project-basic-test"
619
}

examples/basic/version.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ terraform {
55
source = "IBM-Cloud/ibm"
66
version = ">= 1.62.0"
77
}
8+
random = {
9+
source = "hashicorp/random"
10+
version = "3.6.0"
11+
}
812
}
913
}

examples/complete/main.tf

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,19 @@
1+
locals {
2+
unique_identifier = random_string.unique_identifier.result
3+
}
4+
5+
# Access random string generated with random_string.unique_identifier.result
6+
resource "random_string" "unique_identifier" {
7+
length = 6
8+
special = false
9+
upper = false
10+
}
11+
12+
113
module "watson_saas" {
214
source = "../.."
315
ibmcloud_api_key = var.ibmcloud_api_key
16+
resource_group_name = local.unique_identifier
417
resource_prefix = "example-complete-test"
518
project_name = "project-complete-test"
619
watson_discovery_plan = "plus"

examples/complete/version.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,9 @@ terraform {
55
source = "IBM-Cloud/ibm"
66
version = ">= 1.62.0"
77
}
8+
random = {
9+
source = "hashicorp/random"
10+
version = "3.6.0"
11+
}
812
}
913
}

ibm_catalog.json

Lines changed: 6 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22
"products": [
33
{
44
"label": "watsonx SaaS",
5-
"name": "watsonx-ai-SaaS",
6-
"version": "0.3.0",
5+
"name": "deploy-arch-ibm-watsonx-ai-saas",
76
"product_kind": "solution",
87
"tags": [
98
"watson",
@@ -58,9 +57,7 @@
5857
"diagrams": [
5958
{
6059
"diagram": {
61-
"url_proxy": {
62-
"url": "https://github.com/terraform-ibm-modules/terraform-ibm-watsonx-saas-da/blob/main/assets/architecture.svg"
63-
},
60+
"url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-watsonx-saas-da/main/assets/architecture.svg",
6461
"caption": "WatsonX.ai SaaS instances",
6562
"type": "image/svg+xml"
6663
},
@@ -121,14 +118,6 @@
121118

122119
}
123120
},
124-
{
125-
"key": "resource_group_name",
126-
"type": "string"
127-
},
128-
{
129-
"key": "resource_prefix",
130-
"type": "string"
131-
},
132121
{
133122
"key": "cos_plan",
134123
"type": "string",
@@ -280,18 +269,6 @@
280269
"custom_config": {
281270

282271
}
283-
},
284-
{
285-
"key": "project_name",
286-
"type": "string"
287-
},
288-
{
289-
"key": "project_description",
290-
"type": "string"
291-
},
292-
{
293-
"key": "project_tags",
294-
"type": "string"
295272
}
296273
],
297274
"outputs": [
@@ -406,6 +383,10 @@
406383
{
407384
"key": "project_url",
408385
"description": "URL of the Watson project to create"
386+
},
387+
{
388+
"key": "resource_group_id",
389+
"description": "ID of the resource group used to provision the resources"
409390
}
410391
]
411392
}

0 commit comments

Comments
 (0)