Skip to content

Commit 48e8faf

Browse files
fix: remove endpoint variables, hardcode module to private
1 parent 7dd82d2 commit 48e8faf

File tree

2 files changed

+4
-34
lines changed

2 files changed

+4
-34
lines changed

solutions/standard/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ module "kms" {
6868
create_key_protect_instance = false
6969
region = local.kms_region
7070
existing_kms_instance_crn = var.existing_kms_instance_crn
71-
key_ring_endpoint_type = var.kms_endpoint_type
72-
key_endpoint_type = var.kms_endpoint_type
71+
key_ring_endpoint_type = "private"
72+
key_endpoint_type = "private"
7373
keys = [
7474
{
7575
key_ring_name = local.kms_key_ring_name
@@ -96,7 +96,7 @@ locals {
9696
secrets_manager_guid = var.existing_secrets_manager_crn != null ? (length(local.parsed_existing_secrets_manager_crn) > 0 ? local.parsed_existing_secrets_manager_crn[7] : null) : module.secrets_manager.secrets_manager_guid
9797
secrets_manager_crn = var.existing_secrets_manager_crn != null ? var.existing_secrets_manager_crn : module.secrets_manager.secrets_manager_crn
9898
secrets_manager_region = var.existing_secrets_manager_crn != null ? (length(local.parsed_existing_secrets_manager_crn) > 0 ? local.parsed_existing_secrets_manager_crn[5] : null) : module.secrets_manager.secrets_manager_region
99-
sm_endpoint_type = var.existing_secrets_manager_crn != null ? var.existing_secrets_endpoint_type : var.allowed_network == "private-only" ? "private" : "public"
99+
sm_endpoint_type = "private"
100100
}
101101

102102
module "secrets_manager" {
@@ -107,7 +107,7 @@ module "secrets_manager" {
107107
region = var.region
108108
secrets_manager_name = var.prefix != null ? "${var.prefix}-${var.secrets_manager_instance_name}" : var.secrets_manager_instance_name
109109
sm_service_plan = var.service_plan
110-
allowed_network = var.allowed_network
110+
allowed_network = "private-only"
111111
sm_tags = var.secret_manager_tags
112112
# kms dependency
113113
kms_encryption_enabled = true

solutions/standard/variables.tf

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -48,16 +48,6 @@ variable "existing_secrets_manager_crn" {
4848
default = null
4949
}
5050

51-
variable "existing_secrets_endpoint_type" {
52-
type = string
53-
description = "The endpoint type to use if existing_secrets_manager_crn is specified. Possible values: public, private."
54-
default = "private"
55-
validation {
56-
condition = contains(["public", "private"], var.existing_secrets_endpoint_type)
57-
error_message = "Only \"public\" and \"private\" are allowed values for 'existing_secrets_endpoint_type'."
58-
}
59-
}
60-
6151
variable "service_plan" {
6252
type = string
6353
description = "The pricing plan to use when provisioning a Secrets Manager instance. Possible values: `standard`, `trial`. Applies only if `provision_sm_instance` is set to `true`."
@@ -68,16 +58,6 @@ variable "service_plan" {
6858
}
6959
}
7060

71-
variable "allowed_network" {
72-
type = string
73-
description = "The types of service endpoints to set on the Secrets Manager instance. Possible values: `private-only`, `public-and-private`."
74-
default = "private-only"
75-
validation {
76-
condition = contains(["private-only", "public-and-private"], var.allowed_network)
77-
error_message = "The specified allowed_network is not a valid selection."
78-
}
79-
}
80-
8161
variable "secret_manager_tags" {
8262
type = list(any)
8363
description = "The list of resource tags you want to associate with your Secrets Manager instance."
@@ -213,16 +193,6 @@ variable "existing_kms_instance_crn" {
213193
description = "The CRN of the KMS instance (Hyper Protect Crypto Services or Key Protect). Required only if `existing_secrets_manager_crn` or `existing_secrets_manager_kms_key_crn` is not specified. If the KMS instance is in different account you must also provide a value for `ibmcloud_kms_api_key`."
214194
}
215195

216-
variable "kms_endpoint_type" {
217-
type = string
218-
description = "The type of endpoint to use for communicating with the Key Protect or Hyper Protect Crypto Services instance. Possible values: `public`, `private`. Applies only if `existing_secrets_manager_kms_key_crn` is not specified."
219-
default = "private"
220-
validation {
221-
condition = can(regex("public|private", var.kms_endpoint_type))
222-
error_message = "The kms_endpoint_type value must be 'public' or 'private'."
223-
}
224-
}
225-
226196
variable "kms_key_ring_name" {
227197
type = string
228198
default = "sm-cos-key-ring"

0 commit comments

Comments
 (0)