diff --git a/deployment/config.go b/deployment/config.go index a35286dc0..7d17e5596 100644 --- a/deployment/config.go +++ b/deployment/config.go @@ -464,14 +464,6 @@ func (c *Config) validateElasticSearchConfig() error { return fmt.Errorf("Incorrect engine version: %s. Must start with %q", c.ElasticSearchSettings.Version, "OpenSearch") } - if c.ElasticSearchSettings.SnapshotRepository == "" { - return fmt.Errorf("Empty SnapshotRepository. Must supply a value") - } - - if c.ElasticSearchSettings.SnapshotName == "" { - return fmt.Errorf("Empty SnapshotName. Must supply a value") - } - return nil } diff --git a/deployment/terraform/create.go b/deployment/terraform/create.go index f3807b7fe..b8da1d3d4 100644 --- a/deployment/terraform/create.go +++ b/deployment/terraform/create.go @@ -540,6 +540,11 @@ func (t *Terraform) setupElasticSearchServer(extAgent *ssh.ExtAgent, ip string) mlog.Debug("Repositories registered", mlog.Array("repositories", repositories)) repo := esSettings.SnapshotRepository + snapshotName := esSettings.SnapshotName + if snapshotName == "" { + mlog.Debug("No Opensearch snapshot name given. Not restoring to any snapshot.") + return nil + } // Check if the registered repositories already include the one configured repoFound := false @@ -568,7 +573,6 @@ func (t *Terraform) setupElasticSearchServer(extAgent *ssh.ExtAgent, ip string) // Look for the configured snapshot var snapshot opensearch.Snapshot - snapshotName := esSettings.SnapshotName for _, s := range snapshots { if s.Name == snapshotName { snapshot = s