Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
cbee87b
update supported versions
daniel-butler-irl Oct 25, 2024
3374898
change cra target to da
daniel-butler-irl Oct 25, 2024
096f849
update readme
daniel-butler-irl Oct 25, 2024
17f68b5
update catalog json
daniel-butler-irl Oct 25, 2024
b2d4391
add envar
daniel-butler-irl Oct 25, 2024
317cc41
update tests
daniel-butler-irl Oct 25, 2024
4175a53
modify cra envars
daniel-butler-irl Oct 25, 2024
860c2cb
Merge branch 'main' into update_cra
daniel-butler-irl Nov 4, 2024
dd6e797
Update CRA environment variables for resource group configuration
daniel-butler-irl Nov 4, 2024
cc47167
feat: added support to the DA to deploy and manage a Kibana instance …
Ak-sky Nov 7, 2024
f03612b
chore(deps): update ci dependencies (#310)
terraform-ibm-modules-ops Nov 7, 2024
52040ed
chore(deps): update ci dependencies (#327)
terraform-ibm-modules-ops Nov 10, 2024
0d58a53
chore(deps): update ci dependencies (#328)
terraform-ibm-modules-ops Nov 10, 2024
ecd103a
fix(deps): updated KMS module to `4.16.4` in the DA solution (#315)
shemau Nov 11, 2024
438cee5
docs: updated ref diagram with Kibana support (#331)
Ak-sky Nov 12, 2024
6c0fdd5
feat: added the ability to use the default IBM Cloud® Databases rando…
jor2 Nov 14, 2024
947f389
fix: bump CBR and IBM provider (#339)
shemau Nov 15, 2024
ec7cb99
fix(deps): update terraform-module (#306)
terraform-ibm-modules-ops Nov 16, 2024
b60b810
fix(deps): update terraform ibm to latest for the deployable architec…
terraform-ibm-modules-ops Nov 16, 2024
9304109
fix(deps): update terraform-module (#343)
terraform-ibm-modules-ops Nov 16, 2024
b72f449
Merge branch 'main' into update_cra
daniel-butler-irl Nov 18, 2024
4758c70
fix(tests): include fscloud module in Terraform file patterns
daniel-butler-irl Nov 18, 2024
66ebe31
fix(tests): include shell script patterns in Terraform test file paths
daniel-butler-irl Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ You need the following permissions to run this module.
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
| <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 |
Expand Down
7 changes: 4 additions & 3 deletions cra-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# 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
version: "v1"
CRA_TARGETS:
- CRA_TARGET: "examples/fscloud" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
- CRA_TARGET: "solutions/standard" # Target directory for CRA scan. If not provided, the CRA Scan will not be run.
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`
PROFILE_ID: "bfacb71d-4b84-41ac-9825-e8a3a3eb7405" # SCC profile ID (currently set to IBM Cloud Framework for Financial Services 1.6.0 profile).
CRA_ENVIRONMENT_VARIABLES:
TF_VAR_existing_at_instance_crn: "crn:v1:bluemix:public:logdnaat:eu-de:a/abac0df06b644a9cabc6e44f55b3880e:b1ef3365-dfbf-4d8f-8ac8-75f4f84d6f4a::"
TF_VAR_existing_kms_instance_guid: "e6dce284-e80f-46e1-a3c1-830f7adff7a9"
TF_VAR_existing_kms_instance_crn: "crn:v1:bluemix:public:hs-crypto:us-south:a/abac0df06b644a9cabc6e44f55b3880e:e6dce284-e80f-46e1-a3c1-830f7adff7a9::"
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"
TF_VAR_provider_visibility: "public"
TF_VAR_resource_group_name: "test-es-cra"
TF_VAR_use_existing_resource_group: false
4 changes: 4 additions & 0 deletions ibm_catalog.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@
"key": "elasticsearch_version",
"required": true,
"options": [
{
"displayname": "8.15",
"value": "8.15"
},
{
"displayname": "8.12",
"value": "8.12"
Expand Down
83 changes: 11 additions & 72 deletions tests/pr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,12 @@ package test

import (
"fmt"
"io/fs"
"log"
"os"
"path/filepath"
"strings"
"testing"

"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/cloudinfo"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/common"
"github.com/terraform-ibm-modules/ibmcloud-terratest-wrapper/testhelper"
Expand All @@ -22,6 +18,7 @@ import (
const completeExampleTerraformDir = "examples/complete"
const fscloudExampleTerraformDir = "examples/fscloud"
const standardSolutionTerraformDir = "solutions/standard"
const latestVersion = "8.15"

// Use existing resource group
const resourceGroup = "geretain-test-elasticsearch"
Expand Down Expand Up @@ -64,7 +61,7 @@ func TestRunFSCloudExample(t *testing.T) {
*/
//ResourceGroup: resourceGroup,
TerraformVars: map[string]interface{}{
"elasticsearch_version": "8.12", // Always lock this test into the latest supported elasticsearch version
"elasticsearch_version": latestVersion, // Always lock this test into the latest supported elasticsearch version
"access_tags": permanentResources["accessTags"],
"existing_kms_instance_guid": permanentResources["hpcs_south"],
"kms_key_crn": permanentResources["hpcs_south_root_key_crn"],
Expand All @@ -84,76 +81,18 @@ func TestRunFSCloudExample(t *testing.T) {
options.TestTearDown()
}

type tarIncludePatterns struct {
excludeDirs []string

includeFiletypes []string

includeDirs []string
}

func getTarIncludePatternsRecursively(dir string, dirsToExclude []string, fileTypesToInclude []string) ([]string, error) {
r := tarIncludePatterns{dirsToExclude, fileTypesToInclude, nil}
err := filepath.WalkDir(dir, func(path string, entry fs.DirEntry, err error) error {
return walk(&r, path, entry, err)
})
if err != nil {
fmt.Println("error")
return r.includeDirs, err
}
return r.includeDirs, nil
}

func walk(r *tarIncludePatterns, s string, d fs.DirEntry, err error) error {
if err != nil {
return err
}
if d.IsDir() {
for _, excludeDir := range r.excludeDirs {
if strings.Contains(s, excludeDir) {
return nil
}
}
if s == ".." {
r.includeDirs = append(r.includeDirs, "*.tf")
return nil
}
for _, includeFiletype := range r.includeFiletypes {
r.includeDirs = append(r.includeDirs, strings.ReplaceAll(s+"/*"+includeFiletype, "../", ""))
}
}
return nil
}

func TestRunStandardSolutionSchematics(t *testing.T) {
t.Parallel()

excludeDirs := []string{
".terraform",
".docs",
".github",
".git",
".idea",
"common-dev-assets",
"examples",
"tests",
"reference-architectures",
}
includeFiletypes := []string{
".tf",
".yaml",
".py",
".tpl",
".sh",
}

tarIncludePatterns, recurseErr := getTarIncludePatternsRecursively("..", excludeDirs, includeFiletypes)

// if error producing tar patterns (very unexpected) fail test immediately
require.NoError(t, recurseErr, "Schematic Test had unexpected error traversing directory tree")
options := testschematic.TestSchematicOptionsDefault(&testschematic.TestSchematicOptions{
Testing: t,
TarIncludePatterns: tarIncludePatterns,
Testing: t,
TarIncludePatterns: []string{
"*.tf",
fmt.Sprintf("%s/*.tf", standardSolutionTerraformDir),
fmt.Sprintf("%s/*.tf", fscloudExampleTerraformDir),
fmt.Sprintf("%s/*.tf", "modules/fscloud"),
fmt.Sprintf("%s/*.sh", "scripts"),
},
TemplateFolder: standardSolutionTerraformDir,
BestRegionYAMLPath: regionSelectionPath,
Prefix: "els-sr-da",
Expand Down Expand Up @@ -240,7 +179,7 @@ func TestRunBasicExample(t *testing.T) {
CloudInfoService: sharedInfoSvc,

TerraformVars: map[string]interface{}{
"elasticsearch_version": "8.12", // Always lock this test into the latest supported elasticsearch version
"elasticsearch_version": latestVersion, // Always lock this test into the latest supported elasticsearch version
},
})

Expand Down
5 changes: 3 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ variable "name" {

variable "elasticsearch_version" {
type = string
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."
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."
default = null

validation {
Expand All @@ -23,8 +23,9 @@ variable "elasticsearch_version" {
var.elasticsearch_version == "8.7",
var.elasticsearch_version == "8.10",
var.elasticsearch_version == "8.12",
var.elasticsearch_version == "8.15"
])
error_message = "Version must be 8.7, 8.10 or 8.12 (Enterprise or Platinum plan if 8.10 or later)."
error_message = "Version must be 8.7, 8.10, 8.12 or 8.15 (Enterprise or Platinum plan if 8.10 or later)."
}
}

Expand Down