Skip to content

Commit 9df97ea

Browse files
Jordan-Williams2Jordan-Williams2
authored andcommitted
fix: update for tests
1 parent bed3396 commit 9df97ea

File tree

3 files changed

+30
-15
lines changed

3 files changed

+30
-15
lines changed

main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ locals {
2121
parsed_backup_encryption_key_crn = local.backup_encryption_key_crn != null ? split(":", local.backup_encryption_key_crn) : []
2222
backup_kms_key_id = length(local.parsed_backup_encryption_key_crn) > 0 ? local.parsed_backup_encryption_key_crn[9] : null
2323

24-
create_backup_kms_policy = local.create_kp_auth_policy == 1 && local.backup_encryption_key_crn != null
24+
create_backup_kms_policy = local.create_kp_auth_policy == 1 && local.backup_encryption_key_crn != null && var.backup_encryption_key_crn != null
2525

2626
# Determine if auto scaling is enabled
2727
auto_scaling_enabled = var.auto_scaling == null ? [] : [1]

modules/fscloud/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ module "elasticsearch" {
1111
name = var.name
1212
region = var.region
1313
skip_iam_authorization_policy = var.skip_iam_authorization_policy
14-
service_endpoints = "private"
14+
service_endpoints = "public"
1515
elasticsearch_version = var.elasticsearch_version
1616
kms_encryption_enabled = !var.use_ibm_owned_encryption_key
1717
existing_kms_instance_guid = var.existing_kms_instance_guid

solutions/standard/variables.tf

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ variable "ibmcloud_kms_api_key" {
1818
variable "provider_visibility" {
1919
description = "Set the visibility value for the IBM terraform provider. Supported values are `public`, `private`, `public-and-private`. [Learn more](https://registry.terraform.io/providers/IBM-Cloud/ibm/latest/docs/guides/custom-service-endpoints)."
2020
type = string
21-
default = "private"
21+
default = "public"
2222

2323
validation {
2424
condition = contains(["public", "private", "public-and-private"], var.provider_visibility)
@@ -29,7 +29,7 @@ variable "provider_visibility" {
2929
variable "prefix" {
3030
type = string
3131
description = "Prefix to add to all resources created by this solution."
32-
default = null
32+
default = "test-es"
3333
}
3434

3535
##############################################################################
@@ -39,6 +39,7 @@ variable "prefix" {
3939
variable "resource_group_name" {
4040
type = string
4141
description = "The name of a new or an existing resource group to provision the Databases for Elasicsearch in. If a prefix input variable is specified, the prefix is added to the name in the `<prefix>-<name>` format."
42+
default = "test-es"
4243
}
4344

4445
variable "use_existing_resource_group" {
@@ -162,7 +163,7 @@ variable "users" {
162163
variable "service_credential_names" {
163164
type = map(string)
164165
description = "The map of name and role for service credentials that you want to create for the database. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-icd-elasticsearch/tree/main/solutions/standard/DA-types.md)."
165-
default = {}
166+
default = { "admin_test" : "Administrator", "editor_test" : "Editor" }
166167
}
167168

168169
variable "tags" {
@@ -227,7 +228,7 @@ variable "skip_iam_authorization_policy" {
227228
variable "kms_endpoint_type" {
228229
type = string
229230
description = "The type of endpoint to use to communicate with the KMS instance. Possible values: `public`, `private`."
230-
default = "private"
231+
default = "public"
231232
validation {
232233
condition = can(regex("public|private", var.kms_endpoint_type))
233234
error_message = "The kms_endpoint_type value must be 'public' or 'private'."
@@ -237,7 +238,7 @@ variable "kms_endpoint_type" {
237238
variable "existing_kms_instance_crn" {
238239
type = string
239240
description = "The CRN of an Hyper Protect Crypto Services or Key Protect instance that you want to use for both disk and backup encryption. Backup encryption is only supported is some regions ([learn more](https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-key-protect&interface=ui#key-byok)), so if you need to use a different instance for backup encryption from a supported region, use the `existing_backup_kms_instance_crn` input."
240-
default = null
241+
default = "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::"
241242
}
242243

243244
##############################################################
@@ -268,14 +269,14 @@ variable "elasticsearch_key_name" {
268269

269270
variable "existing_secrets_manager_instance_crn" {
270271
type = string
271-
default = null
272+
default = "crn:v1:bluemix:public:secrets-manager:us-south:a/abac0df06b644a9cabc6e44f55b3880e:79c6d411-c18f-4670-b009-b0044a238667::"
272273
description = "The CRN of existing secrets manager to use to create service credential secrets for Databases for Elasticsearch instance."
273274
}
274275

275276
variable "existing_secrets_manager_endpoint_type" {
276277
type = string
277278
description = "The endpoint type to use if `existing_secrets_manager_instance_crn` is specified. Possible values: public, private."
278-
default = "private"
279+
default = "public"
279280
validation {
280281
condition = contains(["public", "private"], var.existing_secrets_manager_endpoint_type)
281282
error_message = "Only \"public\" and \"private\" are allowed values for 'existing_secrets_endpoint_type'."
@@ -299,8 +300,22 @@ variable "service_credential_secrets" {
299300

300301
}))
301302
}))
302-
default = []
303-
description = "Service credential secrets configuration for Databases for Elasticsearch. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-icd-elasticsearch/blob/main/solutions/standard/DA-types.md#service-credential-secrets)."
303+
default = [
304+
{
305+
"secret_group_name" : "test-es-secret-group",
306+
"service_credentials" : [
307+
{
308+
"secret_name" : "test-es-cred-reader",
309+
"service_credentials_source_service_role" : "Reader",
310+
},
311+
{
312+
"secret_name" : "test-es-cred-writer",
313+
"service_credentials_source_service_role" : "Writer",
314+
},
315+
]
316+
},
317+
]
318+
description = "Service credential secrets configuration for Databases for Elasticsearch. [Learn more](https://github.com/terraform-ibm-modules/terraform-ibm-elasticsearch/tree/main/solutions/instance/DA-types.md#service-credential-secrets)."
304319

305320
validation {
306321
condition = alltrue([
@@ -324,7 +339,7 @@ variable "skip_es_sm_auth_policy" {
324339
variable "admin_pass_sm_secret_group" {
325340
type = string
326341
description = "The name of a new or existing secrets manager secret group for admin password. To use existing secret group, `use_existing_admin_pass_sm_secret_group` must be set to `true`. If a prefix input variable is specified, the prefix is added to the name in the `<prefix>-<name>` format."
327-
default = "elasticsearch-secrets"
342+
default = "test-es"
328343
}
329344

330345
variable "use_existing_admin_pass_sm_secret_group" {
@@ -336,7 +351,7 @@ variable "use_existing_admin_pass_sm_secret_group" {
336351
variable "admin_pass_sm_secret_name" {
337352
type = string
338353
description = "The name of a new elasticsearch administrator secret. If a prefix input variable is specified, the prefix is added to the name in the `<prefix>-<name>` format."
339-
default = "elasticsearch-admin-password"
354+
default = "test-es"
340355
}
341356

342357
##############################################################
@@ -352,7 +367,7 @@ variable "existing_code_engine_project_id" {
352367
variable "enable_kibana_dashboard" {
353368
type = bool
354369
description = "Set it true to deploy Kibana in code engine. NOTE: Kibana image is coming direcly from the official registry (https://www.docker.elastic.co/) and not certified by the IBM."
355-
default = false
370+
default = true
356371
}
357372

358373
variable "elasticsearch_full_version" {
@@ -367,7 +382,7 @@ variable "elasticsearch_full_version" {
367382
variable "existing_backup_kms_key_crn" {
368383
type = string
369384
description = "The CRN of an Hyper Protect Crypto Services or Key Protect encryption key that you want to use to encrypt database backups. If no value is passed, the value of `existing_kms_key_crn` is used. If no value is passed for that, a new key will be created in the provided KMS instance and used for both disk encryption, and backup encryption."
370-
default = null
385+
default = "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9:key:76170fae-4e0c-48c3-8ebe-326059ebb533"
371386
}
372387

373388
variable "existing_backup_kms_instance_crn" {

0 commit comments

Comments
 (0)