Skip to content

Commit

Permalink
Added suffix parameter while creating the infra stack (#80)
Browse files Browse the repository at this point in the history
Signed-off-by: Navneet Verma <[email protected]>
  • Loading branch information
navneet1v authored Nov 13, 2023
1 parent b9665a6 commit 521aeb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ In order to deploy both the stacks the user needs to provide a set of required a
| 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"}'` |
| suffix | Optional | string | An optional string identifier to be concatenated with infra stack name. |
| networkStackSuffix (Optional) | string | An optional string identifier to be concatenated with network stack name. |
| region | Optional | string | User provided aws region |
| account | Optional | string | User provided aws account |
| dataNodeStorage | Optional | string | User provided ebs block storage size. Defaults to 100Gb |
Expand Down
8 changes: 7 additions & 1 deletion lib/os-cluster-entrypoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ export class OsClusterEntrypoint {
}

const suffix = `${scope.node.tryGetContext('suffix')}`;
const networkStackSuffix = `${scope.node.tryGetContext('networkStackSuffix')}`;

const use50heap = `${scope.node.tryGetContext('use50PercentHeap')}`;
const use50PercentHeap = use50heap === 'true';
Expand All @@ -215,7 +216,12 @@ export class OsClusterEntrypoint {

const customRoleArn = `${scope.node.tryGetContext('customRoleArn')}`;

const network = new NetworkStack(scope, 'opensearch-network-stack', {
let networkStackName = 'opensearch-network-stack';
if (networkStackSuffix !== 'undefined') {
networkStackName = `opensearch-network-stack-${networkStackSuffix}`;
}

const network = new NetworkStack(scope, networkStackName, {
cidrBlock: cidrRange,
maxAzs: 3,
vpcId,
Expand Down

0 comments on commit 521aeb5

Please sign in to comment.