Skip to content

Commit 5179634

Browse files
fix
1 parent b9ea717 commit 5179634

File tree

6 files changed

+8
-62
lines changed

6 files changed

+8
-62
lines changed

.secrets.baseline

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"files": "go.sum|^.secrets.baseline$",
44
"lines": null
55
},
6-
"generated_at": "2025-01-27T09:12:20Z",
6+
"generated_at": "2025-01-31T06:45:18Z",
77
"plugins_used": [
88
{
99
"name": "AWSKeyDetector"
@@ -82,7 +82,7 @@
8282
"hashed_secret": "33da8d0e8af2efc260f01d8e5edfcc5c5aba44ad",
8383
"is_secret": true,
8484
"is_verified": false,
85-
"line_number": 35,
85+
"line_number": 36,
8686
"type": "Secret Keyword",
8787
"verified_result": null
8888
}

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* [Basic example with index creation and updates to cluster-wide settings](./examples/basic)
1717
* [Complete example with autoscaling, BYOK encryption and service credentials creation](./examples/complete)
1818
* [Financial Services Cloud profile example with autoscaling enabled](./examples/fscloud)
19+
* [Restore from backup example](./examples/backup-restore)
1920
* [Contributing](#contributing)
2021
<!-- END OVERVIEW HOOK -->
2122

examples/backup-restore/main.tf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ module "resource_group" {
1010
existing_resource_group_name = var.resource_group
1111
}
1212

13-
1413
data "ibm_database_backups" "backup_database" {
15-
deployment_id = var.elasticsearch_db_backup_crn
14+
deployment_id = var.existing_database_crn
1615
}
1716
# New elasticsearch instance pointing to the backup instance
1817
module "restored_icd_elasticsearch" {

examples/backup-restore/variables.tf

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ variable "elasticsearch_version" {
2121
description = "Version of the elasticsearch instance. If no value passed, the current ICD preferred version is used."
2222
default = null
2323
}
24+
2425
variable "resource_group" {
2526
type = string
2627
description = "An existing resource group name to use for this example, if unset a new resource group will be created"
@@ -39,8 +40,8 @@ variable "access_tags" {
3940
default = []
4041
}
4142

42-
variable "elasticsearch_db_backup_crn" {
43+
variable "existing_database_crn" {
4344
type = string
44-
description = "The existing CRN of a backup resource to restore from. If null then it will create a new instance first and then create another instance pointing to the backup of the first instance."
45+
description = "The existing CRN of a backup resource to restore from."
4546
default = null
4647
}

tests/other_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ func TestRunRestoredDBExample(t *testing.T) {
9494
Region: fmt.Sprint(permanentResources["elasticsearchRegion"]),
9595
ResourceGroup: resourceGroup,
9696
TerraformVars: map[string]interface{}{
97-
"elasticsearch_db_backup_crn": permanentResources["elasticsearchCrn"],
97+
"existing_database_crn": permanentResources["elasticsearchCrn"],
9898
},
9999
CloudInfoService: sharedInfoSvc,
100100
})

tests/pr_test.go

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -55,40 +55,6 @@ func TestMain(m *testing.M) {
5555
os.Exit(m.Run())
5656
}
5757

58-
func TestRunFSCloudExample(t *testing.T) {
59-
t.Parallel()
60-
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
61-
Testing: t,
62-
TerraformDir: fscloudExampleTerraformDir,
63-
Prefix: "es-fs-test",
64-
Region: "us-south",
65-
/*
66-
Comment out the 'ResourceGroup' input to force this test to create a unique resource group to ensure tests do
67-
not clash. This is due to the fact that an auth policy may already exist in this resource group since we are
68-
re-using a permanent HPCS instance. By using a new resource group, the auth policy will not already exist
69-
since this module scopes auth policies by resource group.
70-
*/
71-
//ResourceGroup: resourceGroup,
72-
TerraformVars: map[string]interface{}{
73-
"elasticsearch_version": latestVersion, // Always lock this test into the latest supported elasticsearch version
74-
"access_tags": permanentResources["accessTags"],
75-
"kms_key_crn": permanentResources["hpcs_south_root_key_crn"],
76-
},
77-
CloudInfoService: sharedInfoSvc,
78-
})
79-
options.SkipTestTearDown = true
80-
output, err := options.RunTestConsistency()
81-
assert.Nil(t, err, "This should not have errored")
82-
assert.NotNil(t, output, "Expected some output")
83-
84-
// check if outputs exist
85-
outputs := terraform.OutputAll(options.Testing, options.TerraformOptions)
86-
expectedOutputs := []string{"port", "hostname"}
87-
_, outputErr := testhelper.ValidateTerraformOutputs(outputs, expectedOutputs...)
88-
assert.NoErrorf(t, outputErr, "Some outputs not found or nil")
89-
options.TestTearDown()
90-
}
91-
9258
func TestRunStandardSolutionSchematics(t *testing.T) {
9359
t.Parallel()
9460

@@ -178,27 +144,6 @@ func TestRunStandardUpgradeSolution(t *testing.T) {
178144
}
179145
}
180146

181-
func TestRunBasicExample(t *testing.T) {
182-
t.Parallel()
183-
options := testhelper.TestOptionsDefaultWithVars(&testhelper.TestOptions{
184-
Testing: t,
185-
TerraformDir: "examples/basic",
186-
Prefix: "es-test",
187-
ResourceGroup: resourceGroup,
188-
BestRegionYAMLPath: regionSelectionPath,
189-
CloudInfoService: sharedInfoSvc,
190-
191-
TerraformVars: map[string]interface{}{
192-
"elasticsearch_version": latestVersion,
193-
"member_host_flavor": "multitenant", // Always lock this test into the latest supported elasticsearch version
194-
},
195-
})
196-
197-
output, err := options.RunTestConsistency()
198-
assert.Nil(t, err, "This should not have errored")
199-
assert.NotNil(t, output, "Expected some output")
200-
}
201-
202147
func TestRunExistingInstance(t *testing.T) {
203148
t.Parallel()
204149
prefix := fmt.Sprintf("elastic-t-%s", strings.ToLower(random.UniqueId()))

0 commit comments

Comments
 (0)