From 59cbdfe502e501323dbb0ba38615c0487733bd2b Mon Sep 17 00:00:00 2001 From: josefaidt Date: Thu, 14 Nov 2024 09:48:30 -0800 Subject: [PATCH] reduce opensearch domain capacity to free tier-eligible --- .../search-and-aggregate-queries/index.mdx | 39 ++++++++++++++++++- 1 file changed, 37 insertions(+), 2 deletions(-) diff --git a/src/pages/[platform]/build-a-backend/data/custom-business-logic/search-and-aggregate-queries/index.mdx b/src/pages/[platform]/build-a-backend/data/custom-business-logic/search-and-aggregate-queries/index.mdx index c6e71d688d1..1a14ddc386e 100644 --- a/src/pages/[platform]/build-a-backend/data/custom-business-logic/search-and-aggregate-queries/index.mdx +++ b/src/pages/[platform]/build-a-backend/data/custom-business-logic/search-and-aggregate-queries/index.mdx @@ -148,8 +148,15 @@ const openSearchDomain = new opensearch.Domain( 'OpenSearchDomain', { version: opensearch.EngineVersion.OPENSEARCH_2_11, + capacity: { + // upgrade instance types for production use + masterNodeInstanceType: "t3.small.search", + masterNodes: 0, + dataNodeInstanceType: "t3.small.search", + dataNodes: 1, + }, nodeToNodeEncryption: true, - // set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion. + // set removalPolicy to DESTROY to make sure the OpenSearch domain is deleted on stack deletion. removalPolicy: RemovalPolicy.DESTROY, encryptionAtRest: { enabled: true @@ -231,6 +238,13 @@ const openSearchDomain = new opensearch.Domain( "OpenSearchDomain", { version: opensearch.EngineVersion.OPENSEARCH_2_11, + capacity: { + // upgrade instance types for production use + masterNodeInstanceType: "t3.small.search", + masterNodes: 0, + dataNodeInstanceType: "t3.small.search", + dataNodes: 1, + }, nodeToNodeEncryption: true, // set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion. removalPolicy: RemovalPolicy.DESTROY, @@ -356,6 +370,13 @@ const openSearchDomain = new opensearch.Domain( "OpenSearchDomain", { version: opensearch.EngineVersion.OPENSEARCH_2_11, + capacity: { + // upgrade instance types for production use + masterNodeInstanceType: "t3.small.search", + masterNodes: 0, + dataNodeInstanceType: "t3.small.search", + dataNodes: 1, + }, nodeToNodeEncryption: true, // set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion. removalPolicy: RemovalPolicy.DESTROY, @@ -496,6 +517,13 @@ const openSearchDomain = new opensearch.Domain( "OpenSearchDomain", { version: opensearch.EngineVersion.OPENSEARCH_2_11, + capacity: { + // upgrade instance types for production use + masterNodeInstanceType: "t3.small.search", + masterNodes: 0, + dataNodeInstanceType: "t3.small.search", + dataNodes: 1, + }, nodeToNodeEncryption: true, // set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion. removalPolicy: RemovalPolicy.DESTROY, @@ -696,6 +724,13 @@ const openSearchDomain = new opensearch.Domain( "OpenSearchDomain", { version: opensearch.EngineVersion.OPENSEARCH_2_11, + capacity: { + // upgrade instance types for production use + masterNodeInstanceType: "t3.small.search", + masterNodes: 0, + dataNodeInstanceType: "t3.small.search", + dataNodes: 1, + }, nodeToNodeEncryption: true, // set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion. removalPolicy: RemovalPolicy.DESTROY, @@ -946,5 +981,5 @@ const schema = a.schema({ Once you've deployed the resources, you can verify the changes by checking the AppSync console. Run the 'searchTodo' query and review the results to confirm their accuracy. -![A screenshot from the AppSync console displaying a generated query for 'searchTodo' with the results fetched from OpenSearch on the right side.](/images/gen2/opensearch-integration/opensearch_appsync_console.png) +![AppSync console displaying a generated query for 'searchTodo' with the results fetched from OpenSearch on the right side.](/images/gen2/opensearch-integration/opensearch_appsync_console.png)