From 33d37b080b30e8403a4acbffe37354d90fe13fec Mon Sep 17 00:00:00 2001 From: Sayali Gaikawad Date: Thu, 2 Nov 2023 11:44:15 -0700 Subject: [PATCH] Fix naming Signed-off-by: Sayali Gaikawad --- README.md | 2 +- lib/infra/infra-stack.ts | 21 +++++++++++---------- lib/os-cluster-entrypoint.ts | 6 +++--- test/os-cluster.test.ts | 2 +- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 28cb7f9d5bf..72e682049eb 100644 --- a/README.md +++ b/README.md @@ -56,7 +56,7 @@ In order to deploy both the stacks the user needs to provide a set of required a | mlInstanceType | Optional | string | EC2 instance type for ml node. Defaults to r5.xlarge. See options in `lib/opensearch-config/node-config.ts` for available options. E.g., `-c mlInstanceType=m5.xlarge` | | jvmSysProps | Optional | string | A comma-separated list of key=value pairs that will be added to `jvm.options` as JVM system properties. | | additionalConfig | Optional | string | Additional opensearch.yml config parameters passed as JSON. e.g., `--context additionalConfig='{"plugins.security.nodes_dn": ["CN=*.example.com, OU=SSL, O=Test, L=Test, C=DE", "CN=node.other.com, OU=SSL, O=Test, L=Test, C=DE"], "plugins.security.nodes_dn_dynamic_config_enabled": false}'` | -| additionalOSDconfig | Optional | string | Additional opensearch_dashboards.yml config parameters passed as JSON. e.g., `additionalOSDconfig='{"data.search.usageTelemetry.enabled": "true"}'` | +| additionalOsdConfig | Optional | string | Additional opensearch_dashboards.yml config parameters passed as JSON. e.g., `additionalOsdConfig='{"data.search.usageTelemetry.enabled": "true"}'` | | suffix | Optional | string | An optional string identifier to be concatenated with infra stack name. | | region | Optional | string | User provided aws region | | account | Optional | string | User provided aws account | diff --git a/lib/infra/infra-stack.ts b/lib/infra/infra-stack.ts index 7c33c262bb9..c9d260dc2d1 100644 --- a/lib/infra/infra-stack.ts +++ b/lib/infra/infra-stack.ts @@ -61,7 +61,7 @@ export interface infraProps extends StackProps { readonly mlNodeStorage: number, readonly jvmSysPropsString?: string, readonly additionalConfig?: string, - readonly additionalOSDconfig?: string, + readonly additionalOsdConfig?: string, readonly dataEc2InstanceType: InstanceType, readonly mlEc2InstanceType: InstanceType, readonly use50PercentHeap: boolean, @@ -581,7 +581,7 @@ export class InfraStack extends Stack { })); } - // final run command based on whether the distribution type is min or bundle + // // Startinng OpenSearch based on whether the distribution type is min or bundle if (props.minDistribution) { // using (stackProps.minDistribution) condition is not working when false value is being sent cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch; sudo -u ec2-user nohup ./bin/opensearch >> install.log 2>&1 &', { @@ -621,21 +621,22 @@ export class InfraStack extends Stack { })); } - cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch-dashboards;' - + 'sudo -u ec2-user nohup ./bin/opensearch-dashboards > dashboard_install.log 2>&1 &', { - cwd: '/home/ec2-user', - ignoreErrors: false, - })); - // @ts-ignore - if (props.additionalOSDconfig.toString() !== 'undefined') { + if (props.additionalOsdConfig.toString() !== 'undefined') { // @ts-ignore - cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch-dashboards; echo "${props.additionalOSDconfig}">>config/opensearch_dashboards.yml`, + cfnInitConfig.push(InitCommand.shellCommand(`set -ex;cd opensearch-dashboards; echo "${props.additionalOsdConfig}">>config/opensearch_dashboards.yml`, { cwd: '/home/ec2-user', ignoreErrors: false, })); } + + // Startinng OpenSearch-Dashboards + cfnInitConfig.push(InitCommand.shellCommand('set -ex;cd opensearch-dashboards;' + + 'sudo -u ec2-user nohup ./bin/opensearch-dashboards > dashboard_install.log 2>&1 &', { + cwd: '/home/ec2-user', + ignoreErrors: false, + })); } return cfnInitConfig; diff --git a/lib/os-cluster-entrypoint.ts b/lib/os-cluster-entrypoint.ts index 49ebd3fa1d4..071422f3305 100644 --- a/lib/os-cluster-entrypoint.ts +++ b/lib/os-cluster-entrypoint.ts @@ -192,13 +192,13 @@ export class OsClusterEntrypoint { } } - const osdConfig = `${scope.node.tryGetContext('additionalOSDconfig')}`; + const osdConfig = `${scope.node.tryGetContext('additionalOsdConfig')}`; if (osdConfig.toString() !== 'undefined') { try { const jsonObj = JSON.parse(osdConfig); osdYmlConfig = dump(jsonObj); } catch (e) { - throw new Error(`Encountered following error while parsing additionalOSDconfig json parameter: ${e}`); + throw new Error(`Encountered following error while parsing additionalOsdConfig json parameter: ${e}`); } } @@ -261,7 +261,7 @@ export class OsClusterEntrypoint { mlNodeStorage, jvmSysPropsString: jvmSysProps, additionalConfig: ymlConfig, - additionalOSDconfig: osdYmlConfig, + additionalOsdConfig: osdYmlConfig, use50PercentHeap, isInternal, enableRemoteStore, diff --git a/test/os-cluster.test.ts b/test/os-cluster.test.ts index d055529e755..b3b1eceb2bd 100644 --- a/test/os-cluster.test.ts +++ b/test/os-cluster.test.ts @@ -23,7 +23,7 @@ test('Test Resources with security disabled multi-node default instance types', serverAccessType: 'ipv4', restrictServerAccessTo: 'all', additionalConfig: '{ "name": "John Doe", "age": 30, "email": "johndoe@example.com" }', - additionalOSDconfig: '{ "something.enabled": "true", "something_else.enabled": "false" }', + additionalOsdConfig: '{ "something.enabled": "true", "something_else.enabled": "false" }', }, });