Skip to content

Commit 461cce1

Browse files
committed
added condition and updated provider version
1 parent f677083 commit 461cce1

File tree

8 files changed

+41
-18
lines changed

8 files changed

+41
-18
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ You need the following permissions to run this module.
6060
| Name | Version |
6161
|------|---------|
6262
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.9.0 |
63-
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.70.0, <2.0.0 |
63+
| <a name="requirement_ibm"></a> [ibm](#requirement\_ibm) | >= 1.79.0, <2.0.0 |
6464
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2.1, < 4.0.0 |
6565
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.9.1 |
6666

examples/backup-restore/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ terraform {
55
# module's version.tf (basic example), and 1 example that will always use the latest provider version (complete example).
66
ibm = {
77
source = "IBM-Cloud/ibm"
8-
version = ">=1.70.0, <2.0.0"
8+
version = ">=1.79.0, <2.0.0"
99
}
1010
}
1111
}

examples/basic/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
# Pin to the lowest provider version of the range defined in the main module's version.tf to ensure lowest version still works
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = "1.70.0"
7+
version = "1.79.0"
88
}
99
# The elasticsearch provider is not actually required by the module itself, just this example, so OK to use ">=" here instead of locking into a version
1010
elasticsearch = {

examples/complete/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
ibm = {
66
source = "IBM-Cloud/ibm"
7-
version = ">=1.70.0, <2.0.0"
7+
version = ">=1.79.0, <2.0.0"
88
}
99
}
1010
}

solutions/standard/variables.tf

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -475,10 +475,6 @@ variable "kibana_image_secret" {
475475
description = "The name of the image registry access secret."
476476
type = string
477477
default = null
478-
# validation {
479-
# condition = !var.enable_kibana_dashboard || var.use_existing_registry_secret || (var.kibana_image_secret != null && length(var.kibana_image_secret)>0 )
480-
# error_message = "You must provide a valid secret name for Kibana image registry access."
481-
# }
482478
}
483479

484480
variable "kibana_visibility" {

solutions/standard/version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ terraform {
55
required_providers {
66
ibm = {
77
source = "IBM-Cloud/ibm"
8-
version = "1.78.3"
8+
version = "1.79.0"
99
}
1010
time = {
1111
source = "hashicorp/time"

tests/pr_test.go

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,38 @@ func TestPlanValidation(t *testing.T) {
313313
}
314314

315315
// Test the DA when using Kibana dashboard and existing KMS instance
316-
var standardSolutionWithKibanaDashboardVars = map[string]interface{}{
317-
"enable_kibana_dashboard": false,
318-
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
319-
"plan": "enterprise",
316+
317+
tfVarsMap := map[string]map[string]interface{}{}
318+
319+
if os.Getenv("ENABLE_KIBANA_DASHBOARD") == "true" {
320+
tfVarsMap["standardSolutionWithKibanaDashboardVars"] = map[string]interface{}{
321+
"existing_kms_instance_crn": permanentResources["hpcs_south_crn"],
322+
"kibana_image_secret": os.Getenv("KIBANA_IMAGE_SECRET"),
323+
"kibana_registry_username": os.Getenv("KIBANA_REGISTRY_USERNAME"),
324+
"kibana_registry_personal_access_token": os.Getenv("KIBANA_REGISTRY_PERSONAL_ACCESS_TOKEN"),
325+
"kibana_registry_server": os.Getenv("KIBANA_REGISTRY_SERVER"),
326+
"existingProjectID": os.Getenv("EXISTING_CODE_ENGINE_PROJECT_ID"),
327+
"plan": "enterprise",
328+
}
329+
}
330+
331+
for name, tfVars := range tfVarsMap {
332+
t.Run(name, func(t *testing.T) {
333+
for key, value := range tfVars {
334+
options.TerraformOptions.Vars[key] = value
335+
}
336+
337+
_, err := terraform.InitE(t, options.TerraformOptions)
338+
require.NoError(t, err)
339+
340+
output, err := terraform.PlanE(t, options.TerraformOptions)
341+
assert.Nil(t, err)
342+
assert.NotNil(t, output)
343+
344+
for key := range tfVars {
345+
delete(options.TerraformOptions.Vars, key)
346+
}
347+
})
320348
}
321349

322350
// Test the DA when using IBM owned encryption key
@@ -325,10 +353,9 @@ func TestPlanValidation(t *testing.T) {
325353
}
326354

327355
// Create a map of the variables
328-
tfVarsMap := map[string]map[string]interface{}{
329-
"standardSolutionWithElserModelVars": standardSolutionWithElserModelVars,
330-
"standardSolutionWithKibanaDashboardVars": standardSolutionWithKibanaDashboardVars,
331-
"standardSolutionWithUseIbmOwnedEncKey": standardSolutionWithUseIbmOwnedEncKey,
356+
tfVarsMap = map[string]map[string]interface{}{
357+
"standardSolutionWithElserModelVars": standardSolutionWithElserModelVars,
358+
"standardSolutionWithUseIbmOwnedEncKey": standardSolutionWithUseIbmOwnedEncKey,
332359
}
333360

334361
_, initErr := terraform.InitE(t, options.TerraformOptions)

version.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
ibm = {
66
source = "ibm-cloud/ibm"
7-
version = ">= 1.70.0, <2.0.0"
7+
version = ">= 1.79.0, <2.0.0"
88
}
99
null = {
1010
source = "hashicorp/null"

0 commit comments

Comments
 (0)