Skip to content

Commit 3c13926

Browse files
feat: Graduated the module to Stable<br>- added support for bx2.1x4 node type.<br>- added validation to the region input.<br>- The Standard DA variation has been deprecated in favour of a new Fully configurable variation. (#37)
BREAKING CHANGE: There is no upgrade path from the `Standard` DA variation to the new `Fully configurable` variation
1 parent 7a42450 commit 3c13926

20 files changed

+270
-111
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,10 @@ offerings:
66
catalog_id: 7df1e4ca-d54c-4fd0-82ce-3d13247308cd
77
offering_id: 90a14f92-4b86-4b27-acc1-dd6eefe0bfe9
88
variations:
9-
- name: standard
9+
- name: fully-configurable
1010
mark_ready: true
1111
install_type: fullstack
1212
scc:
1313
instance_id: 1c7d5f78-9262-44c3-b779-b28fe4d88c37
1414
region: us-south
15+
scope_resource_group_var_name: existing_resource_group_name

README.md

Lines changed: 17 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Update status and "latest release" badges:
66
1. For the status options, see https://terraform-ibm-modules.github.io/documentation/#/badge-status
77
2. Update the "latest release" badge to point to the correct module's repo. Replace "terraform-ibm-module-template" in two places.
88
-->
9-
[![Incubating (Not yet consumable)](https://img.shields.io/badge/status-Incubating%20(Not%20yet%20consumable)-red)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
9+
[![Stable (With quality checks)](https://img.shields.io/badge/Status-Stable%20(With%20quality%20checks)-green)](https://terraform-ibm-modules.github.io/documentation/#/badge-status)
1010
[![latest release](https://img.shields.io/github/v/release/terraform-ibm-modules/terraform-ibm-db2-cloud?logo=GitHub&sort=semver)](https://github.com/terraform-ibm-modules/terraform-ibm-db2-cloud/releases/latest)
1111
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
1212
[![Renovate enabled](https://img.shields.io/badge/renovate-enabled-brightgreen.svg)](https://renovatebot.com/)
@@ -39,8 +39,8 @@ If this repo contains any reference architectures, uncomment the heading below a
3939
See "Reference architecture" in the public documentation at
4040
https://terraform-ibm-modules.github.io/documentation/#/implementation-guidelines?id=reference-architecture
4141
-->
42-
<!-- ## Reference architectures -->
43-
42+
## Reference architectures
43+
![db2-cloud](https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-db2-cloud/000066a70c717a4e443d8508ca723b73c0c5361f/reference-architectures/deployable-architecture-db2cloud.svg)
4444

4545
<!-- Replace this heading with the name of the root level module (the repo name) -->
4646
## terraform-ibm-db2-cloud
@@ -55,7 +55,17 @@ unless real values don't help users know what to change.
5555
-->
5656

5757
```hcl
58-
58+
module "db2" {
59+
source = "terraform-ibm-modules/db2-cloud/ibm"
60+
version = "X.Y.Z" # Replace "X.Y.Z" with a release version to lock into a specific release
61+
db2_instance_name = "my-db2-instance"
62+
resource_group_id = "asdf1234"
63+
service_endpoints = "public-and-private"
64+
enable_high_availability = true
65+
enable_oracle_compatibility = false
66+
node_type = "bx2.4x16"
67+
tags = ["tag1", "tag2"]
68+
}
5969
```
6070

6171
### Required access policies
@@ -71,24 +81,12 @@ console at Manage > Access (IAM) > Access groups and click into an existing grou
7181
(or create a new one) and in the 'Access' tab click 'Assign access'.
7282
-->
7383

74-
<!--
7584
You need the following permissions to run this module:
7685

7786
- Service
78-
- **Resource group only**
79-
- `Viewer` access on the specific resource group
80-
- **Sample IBM Cloud** service
87+
- **dashdb-for-transactions** service
8188
- `Editor` platform access
8289
- `Manager` service access
83-
-->
84-
85-
<!-- NO PERMISSIONS FOR MODULE
86-
If no permissions are required for the module, uncomment the following
87-
statement instead the previous block.
88-
-->
89-
90-
<!-- No permissions are needed to run this module.-->
91-
9290

9391
<!-- The following content is automatically populated by the pre-commit hook -->
9492
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
@@ -97,7 +95,7 @@ statement instead the previous block.
9795
| Name | Version |
9896
|------|---------|
9997
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
100-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.72.1, < 2.0.0 |
98+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.73.0, < 2.0.0 |
10199

102100
### Modules
103101

@@ -108,7 +106,6 @@ No modules.
108106
| Name | Type |
109107
|------|------|
110108
| [ibm_db2.db2](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/db2) | resource |
111-
| [ibm_resource_tag.tags](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/resources/resource_tag) | resource |
112109

113110
### Inputs
114111

@@ -117,7 +114,7 @@ No modules.
117114
| <a name="input_db2_instance_name"></a> [db2\_instance\_name](#input\_db2\_instance\_name) | Name to give to the DB2 instance being provisioned | `string` | n/a | yes |
118115
| <a name="input_enable_high_availability"></a> [enable\_high\_availability](#input\_enable\_high\_availability) | Whether to enable high availability on the DB2 instance | `bool` | `false` | no |
119116
| <a name="input_enable_oracle_compatibility"></a> [enable\_oracle\_compatibility](#input\_enable\_oracle\_compatibility) | Whether to enable Oracle compatibility on the DB2 instance | `bool` | `false` | no |
120-
| <a name="input_node_type"></a> [node\_type](#input\_node\_type) | The node type of the DB2 instance, supported values are `bx2.4x16`, `bx2.8x32`, `bx2.16x64`, `bx2.32.128`, `bx2.48x192`, `mx2.4x32`, `mx2.16x128`, or `mx2.128x1024` | `string` | `"bx2.4x16"` | no |
117+
| <a name="input_node_type"></a> [node\_type](#input\_node\_type) | The node type of the DB2 instance, supported values are `bx2.1x4`, `bx2.4x16`, `bx2.8x32`, `bx2.16x64`, `bx2.32.128`, `bx2.48x192`, `mx2.4x32`, `mx2.16x128`, or `mx2.128x1024` | `string` | `"bx2.4x16"` | no |
121118
| <a name="input_region"></a> [region](#input\_region) | Region to provision the DB2 instance | `string` | `"us-south"` | no |
122119
| <a name="input_resource_group_id"></a> [resource\_group\_id](#input\_resource\_group\_id) | ID of resource group to provision DB2 instance in | `string` | n/a | yes |
123120
| <a name="input_service_endpoints"></a> [service\_endpoints](#input\_service\_endpoints) | Service endpoints for the DB2 instance, valid values are `public`, `private`, or `public-and-private` | `string` | `"public"` | no |

cra-config.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# More info about this file at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml
22
version: "v1"
33
CRA_TARGETS:
4-
- CRA_TARGET: "solutions/standard" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
4+
- CRA_TARGET: "solutions/fully-configurable" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
55
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" # CRA Ignore file to use. If not provided, it checks the repo root directory for `cra-tf-validate-ignore-rules.json`
66
PROFILE_ID: "fe96bd4d-9b37-40f2-b39f-a62760e326a3" # SCC profile ID (currently set to 'IBM Cloud Framework for Financial Services' '1.7.0' profile).
77
CRA_ENVIRONMENT_VARIABLES: # An optional map of environment variables for CRA, where the key is the variable name and value is the value. Useful for providing TF_VARs.
8+
TF_VAR_prefix: "prefix"
89
TF_VAR_db2_instance_name: "db2-da"
9-
TF_VAR_resource_group_name: "db2-rg"
10+
TF_VAR_existing_resource_group_name: "geretain-test-resources"
1011
TF_VAR_provider_visibility: "public"

examples/advanced/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ module "db2_instance" {
2121
service_endpoints = var.service_endpoints
2222
enable_high_availability = true
2323
enable_oracle_compatibility = var.oracle_compatibility
24-
node_type = "nil"
24+
node_type = "bx2.1x4"
2525
tags = var.resource_tags
2626
}

examples/advanced/variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ variable "region" {
1717
variable "prefix" {
1818
type = string
1919
description = "Prefix to append to all resources created by this example"
20-
default = "basic"
20+
default = "advanced"
2121
}
2222

2323
variable "resource_group" {

examples/basic/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,6 @@ module "db2_instance" {
2121
service_endpoints = "public-and-private"
2222
enable_high_availability = false
2323
enable_oracle_compatibility = false
24-
node_type = "nil"
24+
node_type = "bx2.1x4"
2525
tags = var.resource_tags
2626
}

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ terraform {
66
required_providers {
77
ibm = {
88
source = "IBM-Cloud/ibm"
9-
version = "1.72.1"
9+
version = "1.73.0"
1010
}
1111
}
1212
}

ibm_catalog.json

Lines changed: 111 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
],
2222
"short_description": "Creates and configures IBM Cloud DB2 on Cloud resources",
2323
"long_description": "This architecture supports creating and configuring an IBM DB2 on Cloud service instance.",
24-
"offering_docs_url": "https://github.com/terraform-ibm-modules/terraform-ibm-db2-cloud/blob/main/solutions/standard/README.md",
24+
"offering_docs_url": "https://github.com/terraform-ibm-modules/terraform-ibm-db2-cloud/blob/main/solutions/fully-configurable/README.md",
2525
"offering_icon_url": "https://raw.githubusercontent.com/terraform-ibm-modules/terraform-ibm-db2-cloud/main/images/DB2.svg",
2626
"provider_name": "IBM",
2727
"features": [
@@ -33,10 +33,10 @@
3333
"support_details": "This product is in the community registry, as such support is handled through the originated repo. If you experience issues please open an issue in that repository [https://github.com/terraform-ibm-modules/terraform-ibm-db2-cloud/issues](https://github.com/terraform-ibm-modules/terraform-ibm-db2-cloud/issues). Please note this product is not supported via the IBM Cloud Support Center.",
3434
"flavors": [
3535
{
36-
"label": "Standard",
37-
"name": "standard",
36+
"label": "Fully configurable",
37+
"name": "fully-configurable",
3838
"install_type": "fullstack",
39-
"working_directory": "solutions/standard",
39+
"working_directory": "solutions/fully-configurable",
4040
"iam_permissions": [
4141
{
4242
"role_crns": [
@@ -69,17 +69,58 @@
6969
]
7070
},
7171
{
72-
"key": "resource_group_name",
73-
"required": true
74-
},
75-
{
76-
"key": "use_existing_resource_group",
77-
"required": true
72+
"key": "existing_resource_group_name",
73+
"required": true,
74+
"custom_config": {
75+
"type": "resource_group",
76+
"grouping": "deployment",
77+
"original_grouping": "deployment",
78+
"config_constraints": {
79+
"identifier": "rg_name"
80+
}
81+
}
7882
},
7983
{
8084
"key": "region",
8185
"required": true,
82-
"default_value": "us-east"
86+
"options": [
87+
{
88+
"displayname": "Sydney (au-syd)",
89+
"value": "au-syd"
90+
},
91+
{
92+
"displayname": "Tokyo (jp-tok)",
93+
"value": "jp-tok"
94+
},
95+
{
96+
"displayname": "Frankfurt (eu-de)",
97+
"value": "eu-de"
98+
},
99+
{
100+
"displayname": "London (eu-gb)",
101+
"value": "eu-gb"
102+
},
103+
{
104+
"displayname": "Madrid (eu-es)",
105+
"value": "eu-es"
106+
},
107+
{
108+
"displayname": "Dallas (us-south)",
109+
"value": "us-south"
110+
},
111+
{
112+
"displayname": "Toronto (ca-tor)",
113+
"value": "ca-tor"
114+
},
115+
{
116+
"displayname": "Washington DC (us-east)",
117+
"value": "us-east"
118+
},
119+
{
120+
"displayname": "Sao Paolo (br-sao)",
121+
"value": "br-sao"
122+
}
123+
]
83124
},
84125
{
85126
"key": "prefix",
@@ -97,7 +138,65 @@
97138
"key": "subscription_id_secret_crn"
98139
},
99140
{
100-
"key": "node_type"
141+
"key": "node_type",
142+
"options": [
143+
{
144+
"displayname": "bx2.1x4",
145+
"value": "bx2.1x4"
146+
},
147+
{
148+
"displayname": "bx2.4x16",
149+
"value": "bx2.4x16"
150+
},
151+
{
152+
"displayname": "bx2.8x32",
153+
"value": "bx2.8x32"
154+
},
155+
{
156+
"displayname": "bx2.16x64",
157+
"value": "bx2.16x64"
158+
},
159+
{
160+
"displayname": "bx2.32x128",
161+
"value": "bx2.32x128"
162+
},
163+
{
164+
"displayname": "bx2.48x192",
165+
"value": "bx2.48x192"
166+
},
167+
{
168+
"displayname": "mx2.4x32",
169+
"value": "mx2.4x32"
170+
},
171+
{
172+
"displayname": "mx2.16x128",
173+
"value": "mx2.16x128"
174+
},
175+
{
176+
"displayname": "mx2.128x1024",
177+
"value": "mx2.128x1024"
178+
}
179+
]
180+
},
181+
{
182+
"key": "service_endpoints",
183+
"options": [
184+
{
185+
"displayname": "Public",
186+
"value": "public"
187+
},
188+
{
189+
"displayname": "Private",
190+
"value": "private"
191+
},
192+
{
193+
"displayname": "Public and Private",
194+
"value": "public-and-private"
195+
}
196+
]
197+
},
198+
{
199+
"key": "enable_high_availability"
101200
},
102201
{
103202
"key": "enable_oracle_compatibility"

main.tf

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,29 +3,21 @@ This file is used to implement the ROOT module.
33
*********************************************************************/
44

55
resource "ibm_db2" "db2" {
6-
name = var.db2_instance_name
7-
resource_group_id = var.resource_group_id
8-
location = var.region
9-
plan = var.subscription_id == null ? "performance" : "PerformanceSubscription"
10-
service = "dashdb-for-transactions"
11-
high_availability = var.enable_high_availability ? "yes" : "no"
12-
service_endpoints = var.service_endpoints
13-
14-
parameters = {
15-
"oracle_compatibility" : var.enable_oracle_compatibility ? "yes" : "no",
16-
"version" : "12",
17-
"node_type" : var.node_type,
18-
"subscription_id" : var.subscription_id == null ? "" : var.subscription_id
19-
}
6+
name = var.db2_instance_name
7+
service = "dashdb-for-transactions"
8+
plan = var.subscription_id == null ? "performance" : "PerformanceSubscription"
9+
location = var.region
10+
resource_group_id = var.resource_group_id
11+
service_endpoints = var.service_endpoints
12+
instance_type = var.node_type == "bx2.1x4" ? null : var.node_type
13+
high_availability = var.enable_high_availability ? "yes" : "no"
14+
oracle_compatibility = var.enable_oracle_compatibility ? "yes" : "no"
15+
subscription_id = var.subscription_id
16+
tags = var.tags
2017

2118
timeouts {
2219
create = "720m"
2320
update = "60m"
2421
delete = "30m"
2522
}
2623
}
27-
28-
resource "ibm_resource_tag" "tags" {
29-
resource_id = ibm_db2.db2.crn
30-
tags = var.tags
31-
}

0 commit comments

Comments
 (0)