Skip to content

Commit a036083

Browse files
authored
Merge branch 'main' into backup-encryption
2 parents bed3396 + 437a468 commit a036083

File tree

5 files changed

+23
-78
lines changed

5 files changed

+23
-78
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ You need the following permissions to run this module.
9595
| <a name="input_backup_crn"></a> [backup\_crn](#input\_backup\_crn) | The CRN of a backup resource to restore from. The backup is created by a database deployment with the same service ID. The backup is loaded after both provisioning is complete and the new deployment that uses that data starts. Specify a backup CRN is in the format `crn:v1:<...>:backup:`. If not specified, the database is provisioned empty. | `string` | `null` | no |
9696
| <a name="input_backup_encryption_key_crn"></a> [backup\_encryption\_key\_crn](#input\_backup\_encryption\_key\_crn) | The CRN of a Hyper Protect Crypto Services use for encrypting the disk that holds deployment backups. There are limitation per region on the Hyper Protect Crypto Services and region for those services. See https://cloud.ibm.com/docs/cloud-databases?topic=cloud-databases-hpcs#use-hpcs-backups | `string` | `null` | no |
9797
| <a name="input_cbr_rules"></a> [cbr\_rules](#input\_cbr\_rules) | The list of context-based restriction rules to create. | <pre>list(object({<br/> description = string<br/> account_id = string<br/> rule_contexts = list(object({<br/> attributes = optional(list(object({<br/> name = string<br/> value = string<br/> }))) }))<br/> enforcement_mode = string<br/> }))</pre> | `[]` | no |
98-
| <a name="input_elasticsearch_version"></a> [elasticsearch\_version](#input\_elasticsearch\_version) | The version of Databases for Elasticsearch to deploy. Possible values: `8.7`, `8.10`, `8.12`, which requires an Enterprise Platinum pricing plan. If no value is specified, the current preferred version for IBM Cloud Databases is used. | `string` | `null` | no |
98+
| <a name="input_elasticsearch_version"></a> [elasticsearch\_version](#input\_elasticsearch\_version) | The version of Databases for Elasticsearch to deploy. Possible values: `8.7`, `8.10`, `8.12`, `8.15` which requires an Enterprise Platinum pricing plan. If no value is specified, the current preferred version for IBM Cloud Databases is used. | `string` | `null` | no |
9999
| <a name="input_elser_model_type"></a> [elser\_model\_type](#input\_elser\_model\_type) | Trained ELSER model to be used for Elastic's Natural Language Processing. Possible values: `.elser_model_1`, `.elser_model_2` and `.elser_model_2_linux-x86_64`. [Learn more](https://www.elastic.co/guide/en/machine-learning/current/ml-nlp-elser.html) | `string` | `".elser_model_2_linux-x86_64"` | no |
100100
| <a name="input_enable_elser_model"></a> [enable\_elser\_model](#input\_enable\_elser\_model) | Set it to true to install and start the Elastic's Natural Language Processing model. [Learn more](https://cloud.ibm.com/docs/databases-for-elasticsearch?topic=databases-for-elasticsearch-elser-embeddings-elasticsearch) | `bool` | `false` | no |
101101
| <a name="input_existing_kms_instance_guid"></a> [existing\_kms\_instance\_guid](#input\_existing\_kms\_instance\_guid) | The GUID of a Hyper Protect Crypto Services or Key Protect instance for the CRN specified in `kms_key_crn` and `backup_encryption_key_crn`. Applies only if `kms_encryption_enabled` is true, `skip_iam_authorization_policy` is false, and you specify values for `kms_key_crn` or `backup_encryption_key_crn`. | `string` | `null` | no |

cra-config.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
# More info about this file at https://github.com/terraform-ibm-modules/common-pipeline-assets/blob/main/.github/workflows/terraform-test-pipeline.md#cra-config-yaml
22
version: "v1"
33
CRA_TARGETS:
4-
- CRA_TARGET: "examples/fscloud" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
4+
- CRA_TARGET: "solutions/standard" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
55
CRA_IGNORE_RULES_FILE: "cra-tf-validate-ignore-rules.json" # CRA Ignore file to use. If not provided, it checks the repo root directory for `cra-tf-validate-ignore-rules.json`
66
PROFILE_ID: "bfacb71d-4b84-41ac-9825-e8a3a3eb7405" # SCC profile ID (currently set to IBM Cloud Framework for Financial Services 1.6.0 profile).
77
CRA_ENVIRONMENT_VARIABLES:
8-
TF_VAR_existing_at_instance_crn: "crn:v1:bluemix:public:logdnaat:eu-de:a/abac0df06b644a9cabc6e44f55b3880e:b1ef3365-dfbf-4d8f-8ac8-75f4f84d6f4a::"
9-
TF_VAR_existing_kms_instance_guid: "e6dce284-e80f-46e1-a3c1-830f7adff7a9"
8+
TF_VAR_existing_kms_instance_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::"
109
TF_VAR_kms_key_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9:key:76170fae-4e0c-48c3-8ebe-326059ebb533"
1110
TF_VAR_provider_visibility: "public"
11+
TF_VAR_resource_group_name: "test-es-cra"
12+
TF_VAR_use_existing_resource_group: false

ibm_catalog.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@
194194
"key": "elasticsearch_version",
195195
"required": true,
196196
"options": [
197+
{
198+
"displayname": "8.15",
199+
"value": "8.15"
200+
},
197201
{
198202
"displayname": "8.12",
199203
"value": "8.12"

tests/pr_test.go

Lines changed: 11 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,12 @@ package test
33

44
import (
55
"fmt"
6-
"io/fs"
76
"log"
87
"os"
9-
"path/filepath"
10-
"strings"
118
"testing"
129

1310
"github.com/gruntwork-io/terratest/modules/terraform"
1411
"github.com/stretchr/testify/assert"
15-
"github.com/stretchr/testify/require"
1612
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
1713
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
1814
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
@@ -22,6 +18,7 @@ import (
2218
const completeExampleTerraformDir = "examples/complete"
2319
const fscloudExampleTerraformDir = "examples/fscloud"
2420
const standardSolutionTerraformDir = "solutions/standard"
21+
const latestVersion = "8.15"
2522

2623
// Use existing resource group
2724
const resourceGroup = "geretain-test-elasticsearch"
@@ -64,7 +61,7 @@ func TestRunFSCloudExample(t *testing.T) {
6461
*/
6562
//ResourceGroup: resourceGroup,
6663
TerraformVars: map[string]interface{}{
67-
"elasticsearch_version": "8.12", // Always lock this test into the latest supported elasticsearch version
64+
"elasticsearch_version": latestVersion, // Always lock this test into the latest supported elasticsearch version
6865
"access_tags": permanentResources["accessTags"],
6966
"existing_kms_instance_guid": permanentResources["hpcs_south"],
7067
"kms_key_crn": permanentResources["hpcs_south_root_key_crn"],
@@ -84,76 +81,18 @@ func TestRunFSCloudExample(t *testing.T) {
8481
options.TestTearDown()
8582
}
8683

87-
type tarIncludePatterns struct {
88-
excludeDirs []string
89-
90-
includeFiletypes []string
91-
92-
includeDirs []string
93-
}
94-
95-
func getTarIncludePatternsRecursively(dir string, dirsToExclude []string, fileTypesToInclude []string) ([]string, error) {
96-
r := tarIncludePatterns{dirsToExclude, fileTypesToInclude, nil}
97-
err := filepath.WalkDir(dir, func(path string, entry fs.DirEntry, err error) error {
98-
return walk(&r, path, entry, err)
99-
})
100-
if err != nil {
101-
fmt.Println("error")
102-
return r.includeDirs, err
103-
}
104-
return r.includeDirs, nil
105-
}
106-
107-
func walk(r *tarIncludePatterns, s string, d fs.DirEntry, err error) error {
108-
if err != nil {
109-
return err
110-
}
111-
if d.IsDir() {
112-
for _, excludeDir := range r.excludeDirs {
113-
if strings.Contains(s, excludeDir) {
114-
return nil
115-
}
116-
}
117-
if s == ".." {
118-
r.includeDirs = append(r.includeDirs, "*.tf")
119-
return nil
120-
}
121-
for _, includeFiletype := range r.includeFiletypes {
122-
r.includeDirs = append(r.includeDirs, strings.ReplaceAll(s+"/*"+includeFiletype, "../", ""))
123-
}
124-
}
125-
return nil
126-
}
127-
12884
func TestRunStandardSolutionSchematics(t *testing.T) {
12985
t.Parallel()
13086

131-
excludeDirs := []string{
132-
".terraform",
133-
".docs",
134-
".github",
135-
".git",
136-
".idea",
137-
"common-dev-assets",
138-
"examples",
139-
"tests",
140-
"reference-architectures",
141-
}
142-
includeFiletypes := []string{
143-
".tf",
144-
".yaml",
145-
".py",
146-
".tpl",
147-
".sh",
148-
}
149-
150-
tarIncludePatterns, recurseErr := getTarIncludePatternsRecursively("..", excludeDirs, includeFiletypes)
151-
152-
// if error producing tar patterns (very unexpected) fail test immediately
153-
require.NoError(t, recurseErr, "Schematic Test had unexpected error traversing directory tree")
15487
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
155-
Testing: t,
156-
TarIncludePatterns: tarIncludePatterns,
88+
Testing: t,
89+
TarIncludePatterns: []string{
90+
"*.tf",
91+
fmt.Sprintf("%s/*.tf", standardSolutionTerraformDir),
92+
fmt.Sprintf("%s/*.tf", fscloudExampleTerraformDir),
93+
fmt.Sprintf("%s/*.tf", "modules/fscloud"),
94+
fmt.Sprintf("%s/*.sh", "scripts"),
95+
},
15796
TemplateFolder: standardSolutionTerraformDir,
15897
BestRegionYAMLPath: regionSelectionPath,
15998
Prefix: "els-sr-da",
@@ -241,7 +180,7 @@ func TestRunBasicExample(t *testing.T) {
241180
CloudInfoService: sharedInfoSvc,
242181

243182
TerraformVars: map[string]interface{}{
244-
"elasticsearch_version": "8.12", // Always lock this test into the latest supported elasticsearch version
183+
"elasticsearch_version": latestVersion, // Always lock this test into the latest supported elasticsearch version
245184
},
246185
})
247186

variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ variable "name" {
1414

1515
variable "elasticsearch_version" {
1616
type = string
17-
description = "The version of Databases for Elasticsearch to deploy. Possible values: `8.7`, `8.10`, `8.12`, which requires an Enterprise Platinum pricing plan. If no value is specified, the current preferred version for IBM Cloud Databases is used."
17+
description = "The version of Databases for Elasticsearch to deploy. Possible values: `8.7`, `8.10`, `8.12`, `8.15` which requires an Enterprise Platinum pricing plan. If no value is specified, the current preferred version for IBM Cloud Databases is used."
1818
default = null
1919

2020
validation {
@@ -23,8 +23,9 @@ variable "elasticsearch_version" {
2323
var.elasticsearch_version == "8.7",
2424
var.elasticsearch_version == "8.10",
2525
var.elasticsearch_version == "8.12",
26+
var.elasticsearch_version == "8.15"
2627
])
27-
error_message = "Version must be 8.7, 8.10 or 8.12 (Enterprise or Platinum plan if 8.10 or later)."
28+
error_message = "Version must be 8.7, 8.10, 8.12 or 8.15 (Enterprise or Platinum plan if 8.10 or later)."
2829
}
2930
}
3031

0 commit comments

Comments
 (0)