Skip to content

Commit

Permalink
fix: fixed bug which was causing kms auth policy to be created even w…
Browse files Browse the repository at this point in the history
…hen kms encryption was not enabled (#489)
  • Loading branch information
ocofaigh committed Jul 20, 2023
1 parent 8abd7cf commit 6b037d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"files": "go.sum|^.secrets.baseline$",
"lines": null
},
"generated_at": "2023-06-10T00:32:33Z",
"generated_at": "2023-07-20T09:57:54Z",
"plugins_used": [
{
"name": "AWSKeyDetector"
Expand Down
1 change: 0 additions & 1 deletion catalogValidationValues.json.template

This file was deleted.

2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ locals {
##############################################################################

resource "ibm_iam_authorization_policy" "block_storage_policy" {
count = var.skip_iam_authorization_policy ? 0 : 1
count = var.kms_encryption_enabled == false || var.skip_iam_authorization_policy ? 0 : 1
source_service_name = "server-protect"
# commented the following as policy is not working as expected with this option. Related support case - https://cloud.ibm.com/unifiedsupport/cases?number=CS3419700
# source_resource_group_id = var.resource_group_id
Expand Down
8 changes: 4 additions & 4 deletions module-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@
"type": "bool",
"description": "Set this to true to control the encryption keys used to encrypt the data that for the block storage volumes for VPC. If set to false, the data is encrypted by using randomly generated keys. For more info on encrypting block storage volumes, see https://cloud.ibm.com/docs/vpc?topic=vpc-creating-instances-byok",
"default": false,
"source": [
"ibm_iam_authorization_policy.block_storage_policy.count"
],
"pos": {
"filename": "variables.tf",
"line": 194
Expand Down Expand Up @@ -254,9 +257,6 @@
"type": "bool",
"description": "Set to true to skip the creation of an IAM authorization policy that permits all Storage Blocks to read the encryption key from the KMS instance. If set to false, pass in a value for the KMS instance in the existing_kms_instance_guid variable. In addition, no policy is created if var.kms_encryption_enabled is set to false.",
"default": false,
"source": [
"ibm_iam_authorization_policy.block_storage_policy.count"
],
"pos": {
"filename": "variables.tf",
"line": 200
Expand Down Expand Up @@ -425,7 +425,7 @@
"type": "ibm_iam_authorization_policy",
"name": "block_storage_policy",
"attributes": {
"count": "skip_iam_authorization_policy",
"count": "kms_encryption_enabled",
"target_resource_instance_id": "existing_kms_instance_guid"
},
"provider": {
Expand Down

0 comments on commit 6b037d0

Please sign in to comment.