Skip to content

Commit d85b328

Browse files
authored
feat: new optional attribute account_id added to the kms_config input variable providing the ability to attach a KMS instance to a cluster from a different account. As this feature only became available in IBM provider version 1.60.0, the modules version constraints have been updated to >= 1.60.0, <2.0.0. See [Cross account KMS encryption example](https://github.com/terraform-ibm-modules/terraform-ibm-base-ocp-vpc/tree/kms-acc/examples/cross_kms_support) for more information.(#301)
1 parent c26e55e commit d85b328

30 files changed

+337
-34
lines changed

.catalog-onboard-pipeline.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,5 @@ offerings:
1616
mark_ready: true
1717
- name: add_rules_to_sg
1818
mark_ready: true
19+
- name: cross_kms_support
20+
mark_ready: true

.secrets.baseline

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@
8282
"hashed_secret": "dce1f02ca7cc4b63ac43008b7a3ce96e702a0c24",
8383
"is_secret": false,
8484
"is_verified": false,
85-
"line_number": 40,
85+
"line_number": 41,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
}

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ Use this module to provision an [IBM Cloud Red Hat OpenShift cluster](https://cl
1111

1212
### Before you begin
1313

14-
- Make sure that you have a recent version of the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started)
15-
- Make sure that you have a recent version of the [IBM Cloud Kubernetes service CLI](https://cloud.ibm.com/docs/containers?topic=containers-kubernetes-service-cli)
14+
- Make sure that you have a recent version of the [IBM Cloud CLI](https://cloud.ibm.com/docs/cli?topic=cli-getting-started).
15+
- Make sure that you have a recent version of the [IBM Cloud Kubernetes service CLI](https://cloud.ibm.com/docs/containers?topic=containers-kubernetes-service-cli).
1616

1717
<!-- Below content is automatically populated via pre-commit hook -->
1818
<!-- BEGIN OVERVIEW HOOK -->
@@ -25,6 +25,7 @@ Use this module to provision an [IBM Cloud Red Hat OpenShift cluster](https://cl
2525
* [Advanced example (mzr, auto-scale, kms, taints)](./examples/advanced)
2626
* [Basic single zone example](./examples/basic)
2727
* [Cluster security group rules example](./examples/add_rules_to_sg)
28+
* [Cross account KMS encryption example](./examples/cross_kms_support)
2829
* [Financial Services compliant example](./examples/fscloud)
2930
* [Contributing](#contributing)
3031
<!-- END OVERVIEW HOOK -->
@@ -150,7 +151,7 @@ Optionally, you need the following permissions to attach Access Management tags
150151
| Name | Version |
151152
|------|---------|
152153
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0, < 1.6.0 |
153-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.59.0, < 2.0.0 |
154+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.60.0, < 2.0.0 |
154155
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.16.1 |
155156
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2.1 |
156157
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |
@@ -195,7 +196,7 @@ Optionally, you need the following permissions to attach Access Management tags
195196
| <a name="input_force_delete_storage"></a> [force\_delete\_storage](#input\_force\_delete\_storage) | Flag indicating whether or not to delete attached storage when destroying the cluster - Default: false | `bool` | `false` | no |
196197
| <a name="input_ibmcloud_api_key"></a> [ibmcloud\_api\_key](#input\_ibmcloud\_api\_key) | APIkey that's associated with the account to use, set via environment variable TF\_VAR\_ibmcloud\_api\_key | `string` | n/a | yes |
197198
| <a name="input_ignore_worker_pool_size_changes"></a> [ignore\_worker\_pool\_size\_changes](#input\_ignore\_worker\_pool\_size\_changes) | Enable if using worker autoscaling. Stops Terraform managing worker count | `bool` | `false` | no |
198-
| <a name="input_kms_config"></a> [kms\_config](#input\_kms\_config) | Use to attach a Key Protect instance to the cluster | <pre>object({<br> crk_id = string<br> instance_id = string<br> private_endpoint = optional(bool, true) # defaults to true<br> })</pre> | `null` | no |
199+
| <a name="input_kms_config"></a> [kms\_config](#input\_kms\_config) | Use to attach a KMS instance to the cluster. If account\_id is not provided, defaults to the account in use. | <pre>object({<br> crk_id = string<br> instance_id = string<br> private_endpoint = optional(bool, true) # defaults to true<br> account_id = optional(string) # To attach KMS instance from another account<br> })</pre> | `null` | no |
199200
| <a name="input_manage_all_addons"></a> [manage\_all\_addons](#input\_manage\_all\_addons) | Instructs Terraform to manage all cluster addons, even if addons were installed outside of the module. If set to 'true' this module will destroy any addons that were installed by other sources. | `bool` | `false` | no |
200201
| <a name="input_ocp_entitlement"></a> [ocp\_entitlement](#input\_ocp\_entitlement) | Value that is applied to the entitlements for OCP cluster provisioning | `string` | `"cloud_pak"` | no |
201202
| <a name="input_ocp_version"></a> [ocp\_version](#input\_ocp\_version) | The version of the OpenShift cluster that should be provisioned (format 4.x). This is only used during initial cluster provisioning, but ignored for future updates. Supports passing the string 'latest' (current latest available version) or 'default' (current IKS default recommended version). If no value is passed, it will default to 'default'. | `string` | `null` | no |
@@ -218,6 +219,7 @@ Optionally, you need the following permissions to attach Access Management tags
218219
| <a name="output_cluster_name"></a> [cluster\_name](#output\_cluster\_name) | Name of the created cluster |
219220
| <a name="output_cos_crn"></a> [cos\_crn](#output\_cos\_crn) | CRN of the COS instance |
220221
| <a name="output_ingress_hostname"></a> [ingress\_hostname](#output\_ingress\_hostname) | Ingress hostname |
222+
| <a name="output_kms_config"></a> [kms\_config](#output\_kms\_config) | KMS configuration details |
221223
| <a name="output_ocp_version"></a> [ocp\_version](#output\_ocp\_version) | Openshift Version of the cluster |
222224
| <a name="output_private_service_endpoint_url"></a> [private\_service\_endpoint\_url](#output\_private\_service\_endpoint\_url) | Private service endpoint URL |
223225
| <a name="output_public_service_endpoint_url"></a> [public\_service\_endpoint\_url](#output\_public\_service\_endpoint\_url) | Public service endpoint URL |

examples/add_rules_to_sg/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ This example will add security rules to the `kube-<vpcid>` and `kube-<clusterId>
44

55
The following resources are provisioned by this example:
66
- A new resource group, if an existing one is not passed in.
7-
- A VPC with subnets in a single zone and public gw attached
8-
- Security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups
9-
- A basic single zone OCP VPC cluster
7+
- A VPC with subnets in a single zone and public gw attached.
8+
- Security rules to the `kube-<vpcid>` and `kube-<clusterId>` security groups.
9+
- A basic single zone OCP VPC cluster.

examples/add_rules_to_sg/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.59.0"
9+
version = "1.60.0"
1010
}
1111
}
1212
}

examples/advanced/README.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
# Advanced example (mzr, auto-scale, kms, taints)
22

3-
An advanced example which shows how to create a multi-zone KMS encrypted OCP VPC cluster with custom worker node taints
3+
An advanced example which shows how to create a multi-zone KMS encrypted OCP VPC cluster with custom worker node taints.
44

55
The following resources are provisioned by this example:
66
- A new resource group, if an existing one is not passed in.
7-
- A Key Protect instance with 2 root keys, one for cluster encryption, and one for worker block storage encryption
8-
- A VPC with subnets across 3 zones
9-
- A public gateway only in zone-1
10-
- A multi-zone (3 zone) KMS encrypted OCP VPC cluster, with worker pools in each zone
11-
- Auto scaling enabled for the default worker pool
12-
- Taints against the workers in zone-2 and zone-3
7+
- A Key Protect instance with 2 root keys, one for cluster encryption, and one for worker block storage encryption.
8+
- A VPC with subnets across 3 zones.
9+
- A public gateway only in zone-1.
10+
- A multi-zone (3 zone) KMS encrypted OCP VPC cluster, with worker pools in each zone.
11+
- Auto scaling enabled for the default worker pool.
12+
- Taints against the workers in zone-2 and zone-3.

examples/advanced/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.59.0"
9+
version = ">= 1.60.0"
1010
}
1111
kubernetes = {
1212
source = "hashicorp/kubernetes"

examples/basic/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@ A simple example that shows how to provision a basic single zone OCP VPC cluster
44

55
The following resources are provisioned by this example:
66
- A new resource group, if an existing one is not passed in.
7-
- A basic VPC and subnet with public gateway enabled
8-
- A single zone OCP VPC cluster
7+
- A basic VPC and subnet with public gateway enabled.
8+
- A single zone OCP VPC cluster.

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.59.0"
9+
version = "1.60.0"
1010
}
1111
}
1212
}

0 commit comments

Comments
 (0)