From 826baa00c477974c9b4795187aeb9542c0e1d504 Mon Sep 17 00:00:00 2001 From: Leo Singer Date: Tue, 17 Dec 2024 14:42:57 -0500 Subject: [PATCH] Add options to enable automatic software updates --- README.md | 4 ++++ service.ts | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/README.md b/README.md index 98cabb8..803b218 100644 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ Pair this pacakge with [@nasa-gcn/architect-functions-search](https://github.com 3. Amazon offers two flavors of managed OpenSearch: OpenSearch Service and OpenSearch Serverless. By default, this plugin will provision OpenSearch Serverless. If you want to use OpenSearch Service instead, then add a `@search` section to your `app.arc` file: @search + # Enable automatic software updates (disabled by default). + autoSoftwareUpdateEnabled true # See https://docs.aws.amazon.com/opensearch-service/latest/developerguide/supported-instance-types.html for supported instance types instanceType t3.small.search instanceCount 2 @@ -30,6 +32,8 @@ Pair this pacakge with [@nasa-gcn/architect-functions-search](https://github.com # master nodes are disabled. dedicatedMasterCount 3 dedicatedMasterType t3.small.search + # Enable off-peak window for software updates (disabled by default). + offPeakWindowEnabled true # Use OpenSearch in sandbox mode; default is Elasticsearch. sandboxEngine opensearch diff --git a/service.ts b/service.ts index d9d4ddd..d6bd901 100644 --- a/service.ts +++ b/service.ts @@ -7,11 +7,13 @@ */ export function cloudformationResources({ + autoSoftwareUpdateEnabled, availabilityZoneCount, dedicatedMasterCount, dedicatedMasterType, instanceCount, instanceType, + offPeakWindowEnabled, volumeSize, }: Record) { if (!availabilityZoneCount) @@ -80,6 +82,7 @@ export function cloudformationResources({ }, ], }, + AutoSoftwareUpdateEnabled: Boolean(autoSoftwareUpdateEnabled), ClusterConfig: { DedicatedMasterCount, DedicatedMasterEnabled, @@ -106,6 +109,9 @@ export function cloudformationResources({ }, }, NodeToNodeEncryptionOptions: { Enabled: true }, + OffPeakWindowOptions: { + Enabled: Boolean(offPeakWindowEnabled), + }, }, }, }