You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: main.tf
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -6,15 +6,15 @@
6
6
locals {
7
7
# Validation (approach based on https://github.com/hashicorp/terraform/issues/25609#issuecomment-1057614400)
8
8
# tflint-ignore: terraform_unused_declarations
9
-
validate_kms_values=(!var.kms_encryption_enabled&& var.kms_key_crn!=null) ?tobool("When passing values for var.kms_key_crn, you must set var.kms_encryption_enabled to true. Otherwise unset them to use default encryption") : (!var.kms_encryption_enabled&& var.existing_kms_instance_guid!=null) ?tobool("When passing values for var.existing_kms_instance_guid, you must set var.kms_encryption_enabled to true. Otherwise unset them to use default encryption") :true
9
+
validate_kms_values=(!var.kms_encryption_enabled&& var.kms_key_crn!=null&& var.existing_sm_instance_crn==null) ?tobool("When passing values for var.kms_key_crn, you must set 'kms_encryption_enabled' to true. Otherwise set 'kms_encryption_enabled' to false to use default encryption") : (!var.kms_encryption_enabled&& var.existing_kms_instance_guid!=null) ?tobool("When passing values for var.existing_kms_instance_guid, you must set var.kms_encryption_enabled to true. Otherwise unset them to use default encryption") :true
10
10
# tflint-ignore: terraform_unused_declarations
11
-
validate_kms_vars=var.kms_encryption_enabled&& var.kms_key_crn==null?tobool("When setting var.kms_encryption_enabled to true, a value must be passed for var.kms_key_crn") :true
11
+
validate_kms_vars=var.kms_encryption_enabled&& var.kms_key_crn==null&& var.existing_sm_instance_crn==null?tobool("When setting var.kms_encryption_enabled to true, a value must be passed for var.kms_key_crn") :true
12
12
# tflint-ignore: terraform_unused_declarations
13
-
validate_auth_policy=var.kms_encryption_enabled&& var.skip_kms_iam_authorization_policy==false&& var.existing_kms_instance_guid==null?tobool("When var.skip_kms_iam_authorization_policy is set to false, and var.kms_encryption_enabled to true, a value must be passed for var.existing_kms_instance_guid in order to create the auth policy.") :true
13
+
validate_auth_policy=var.kms_encryption_enabled&& var.skip_kms_iam_authorization_policy==false&& var.existing_kms_instance_guid==null&& var.existing_sm_instance_crn==null?tobool("When var.skip_kms_iam_authorization_policy is set to false, and var.kms_encryption_enabled to true, a value must be passed for var.existing_kms_instance_guid in order to create the auth policy.") :true
14
14
# tflint-ignore: terraform_unused_declarations
15
15
validate_event_notification=var.enable_event_notification&& var.existing_en_instance_crn==null?tobool("When setting var.enable_event_notification to true, a value must be passed for var.existing_en_instance_crn") :true
16
16
# tflint-ignore: terraform_unused_declarations
17
-
validate_endpoint=var.enable_event_notification&& var.endpoint_type=="public"&& var.allowed_network=="private-only"?tobool("It is not allowed to have conflicting var.endpoint_type and var.allowed_network values.") :true
17
+
validate_endpoint=var.enable_event_notification&& var.endpoint_type=="public"&& var.allowed_network=="private-only"&& var.existing_sm_instance_crn==null?tobool("It is not allowed to have conflicting var.endpoint_type and var.allowed_network values.") :true
18
18
# tflint-ignore: terraform_unused_declarations
19
19
validate_region=var.existing_sm_instance_crn==null&& var.region==null?tobool("When existing_sm_instance_crn is null, a value must be passed for var.region") :true
0 commit comments