Skip to content

Commit 4593f02

Browse files
authored
feat: The following DA variables have been renamed:<br>- sm_key_name -> kms_key_name, sm_key_ring_name -> kms_key_ring_name (#93)
1 parent 4230dc2 commit 4593f02

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

solutions/standard/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ module "resource_group" {
1313
# KMS Key
1414
#######################################################################################################################
1515
locals {
16-
kms_key_crn = var.existing_sm_kms_key_crn != null ? var.existing_sm_kms_key_crn : module.kms[0].keys[format("%s.%s", var.sm_key_ring_name, var.sm_key_name)].crn
16+
kms_key_crn = var.existing_sm_kms_key_crn != null ? var.existing_sm_kms_key_crn : module.kms[0].keys[format("%s.%s", var.kms_key_ring_name, var.kms_key_name)].crn
1717
}
18-
# KMS root key for Secrets Manager COS bucket
18+
# KMS root key for Secrets Manager secret encryption
1919
module "kms" {
2020
providers = {
2121
ibm = ibm.kms
@@ -30,12 +30,12 @@ module "kms" {
3030
key_endpoint_type = var.kms_endpoint_type
3131
keys = [
3232
{
33-
key_ring_name = var.sm_key_ring_name
33+
key_ring_name = var.kms_key_ring_name
3434
existing_key_ring = false
3535
force_delete_key_ring = true
3636
keys = [
3737
{
38-
key_name = var.sm_key_name
38+
key_name = var.kms_key_name
3939
standard_key = false
4040
rotation_interval_month = 3
4141
dual_auth_delete_enabled = false

solutions/standard/variables.tf

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,38 +89,42 @@ variable "existing_sm_kms_key_crn" {
8989
default = null
9090
}
9191

92+
########################################################################################################################
93+
# KMS properties required when creating an encryption key, rather than passing an existing key CRN.
94+
########################################################################################################################
95+
9296
variable "kms_region" {
9397
type = string
9498
default = "us-south"
95-
description = "The region in which KMS instance exists."
99+
description = "The region in which KMS instance exists. Only required if not supplying an existing KMS root key CRN."
96100
}
97101

98102
variable "existing_kms_guid" {
99103
type = string
100104
default = null
101-
description = "The GUID of of the KMS instance used for the Secrets Manager root Key. Only required if not supplying an existing KMS root key and if 'skip_cos_kms_auth_policy' is true."
105+
description = "The GUID of of the KMS instance used for the Secrets Manager root Key. Only required if not supplying an existing KMS root key CRN and if 'skip_kms_iam_authorization_policy' is true."
102106
}
103107

104108
variable "kms_endpoint_type" {
105109
type = string
106-
description = "The type of endpoint to be used for communicating with the KMS instance. Allowed values are: 'public' or 'private' (default)"
110+
description = "The type of endpoint to be used for communicating with the KMS instance. Allowed values are: 'public' or 'private' (default). Only required if not supplying an existing KMS root key CRN."
107111
default = "private"
108112
validation {
109113
condition = can(regex("public|private", var.kms_endpoint_type))
110114
error_message = "The kms_endpoint_type value must be 'public' or 'private'."
111115
}
112116
}
113117

114-
variable "sm_key_ring_name" {
118+
variable "kms_key_ring_name" {
115119
type = string
116120
default = "sm-cos-key-ring"
117-
description = "The name to give the Key Ring which will be created for the Secrets Manager COS bucket Key. Not used if supplying an existing Key."
121+
description = "The name to give to the new KMS key ring that will be used to store the KMS key to enable advanced, customer-managed encryption for your Secrets Manager secrets. Only required if not supplying an existing KMS root key CRN."
118122
}
119123

120-
variable "sm_key_name" {
124+
variable "kms_key_name" {
121125
type = string
122126
default = "sm-cos-key"
123-
description = "The name to give the Key which will be created for the Secrets Manager COS bucket. Not used if supplying an existing Key."
127+
description = "The name to give to the new KMS root key that will be used to enable advanced, customer-managed encryption for your Secrets Manager secrets. Only required if not supplying an existing KMS root key CRN."
124128
}
125129

126130
########################################################################################################################

tests/pr_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ func TestFSCloudInSchematics(t *testing.T) {
9898
options.TerraformVars = []testschematic.TestSchematicTerraformVar{
9999
{Name: "ibmcloud_api_key", Value: options.RequiredEnvironmentVars["TF_VAR_ibmcloud_api_key"], DataType: "string", Secure: true},
100100
{Name: "region", Value: options.Region, DataType: "string"},
101-
{Name: "resource_group", Value: options.Prefix, DataType: "string"},
101+
{Name: "prefix", Value: options.Prefix, DataType: "string"},
102102
{Name: "existing_kms_instance_guid", Value: permanentResources["hpcs_south"], DataType: "string"},
103103
{Name: "kms_key_crn", Value: permanentResources["hpcs_south_root_key_crn"], DataType: "string"},
104104
{Name: "sm_service_plan", Value: "trial", DataType: "string"},

0 commit comments

Comments
 (0)