Skip to content

Commit 0b85e81

Browse files
aatreyee2506Aatreyee Mukherjee
andauthored
feat: *improved user experience for validating input variable values<br>* updated required terraform to be >= 1.9.0 (#675)
* used cross-object referencing for input variable validation * updated version --------- Co-authored-by: Aatreyee Mukherjee <[email protected]>
1 parent 73a3a03 commit 0b85e81

File tree

6 files changed

+9
-6
lines changed

6 files changed

+9
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ You need the following permissions to run this module.
6363

6464
| Name | Version |
6565
|------|---------|
66-
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.3.0 |
66+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
6767
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.69.0, < 2.0.0 |
6868

6969
### Modules

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.3.0"
2+
required_version = ">= 1.9.0"
33
required_providers {
44
# Ensure that there is always 1 example locked into the lowest provider version of the range defined in the main
55
# module's version.tf (basic example), and 1 example that will always use the latest provider version (complete example).

examples/complete/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.0.0"
2+
required_version = ">= 1.9.0"
33
required_providers {
44
# Ensure that there is always 1 example locked into the lowest provider version of the range defined in the main
55
# module's version.tf (basic example), and 1 example that will always use the latest provider version (complete example).

main.tf

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@ resource "ibm_kms_key_policies" "standard_key_policy" {
3535
}
3636

3737
locals {
38-
# tflint-ignore: terraform_unused_declarations
39-
kmip_root_key_validation = (length(var.kmip) > 0 && var.standard_key) ? tobool("When providing a value for `kmip`, the key being created must be a root key.") : true
4038

4139
# for-each for adapter resource
4240
adapter_map = {

variables.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,4 +93,9 @@ variable "kmip" {
9393
])
9494
error_message = "Each adapter can contain up to 200 certificates, current length exceeds this limit."
9595
}
96+
97+
validation {
98+
condition = length(var.kmip) == 0 || !var.standard_key
99+
error_message = "When providing a value for `kmip`, the key being created must be a root key."
100+
}
96101
}

version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
terraform {
2-
required_version = ">= 1.3.0"
2+
required_version = ">= 1.9.0"
33
required_providers {
44
ibm = {
55
source = "IBM-Cloud/ibm"

0 commit comments

Comments
 (0)