Skip to content

Commit 59cbdfe

Browse files
committed
reduce opensearch domain capacity to free tier-eligible
1 parent 6c8a9d7 commit 59cbdfe

File tree

1 file changed

+37
-2
lines changed
  • src/pages/[platform]/build-a-backend/data/custom-business-logic/search-and-aggregate-queries

1 file changed

+37
-2
lines changed

src/pages/[platform]/build-a-backend/data/custom-business-logic/search-and-aggregate-queries/index.mdx

Lines changed: 37 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,15 @@ const openSearchDomain = new opensearch.Domain(
148148
'OpenSearchDomain',
149149
{
150150
version: opensearch.EngineVersion.OPENSEARCH_2_11,
151+
capacity: {
152+
// upgrade instance types for production use
153+
masterNodeInstanceType: "t3.small.search",
154+
masterNodes: 0,
155+
dataNodeInstanceType: "t3.small.search",
156+
dataNodes: 1,
157+
},
151158
nodeToNodeEncryption: true,
152-
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
159+
// set removalPolicy to DESTROY to make sure the OpenSearch domain is deleted on stack deletion.
153160
removalPolicy: RemovalPolicy.DESTROY,
154161
encryptionAtRest: {
155162
enabled: true
@@ -231,6 +238,13 @@ const openSearchDomain = new opensearch.Domain(
231238
"OpenSearchDomain",
232239
{
233240
version: opensearch.EngineVersion.OPENSEARCH_2_11,
241+
capacity: {
242+
// upgrade instance types for production use
243+
masterNodeInstanceType: "t3.small.search",
244+
masterNodes: 0,
245+
dataNodeInstanceType: "t3.small.search",
246+
dataNodes: 1,
247+
},
234248
nodeToNodeEncryption: true,
235249
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
236250
removalPolicy: RemovalPolicy.DESTROY,
@@ -356,6 +370,13 @@ const openSearchDomain = new opensearch.Domain(
356370
"OpenSearchDomain",
357371
{
358372
version: opensearch.EngineVersion.OPENSEARCH_2_11,
373+
capacity: {
374+
// upgrade instance types for production use
375+
masterNodeInstanceType: "t3.small.search",
376+
masterNodes: 0,
377+
dataNodeInstanceType: "t3.small.search",
378+
dataNodes: 1,
379+
},
359380
nodeToNodeEncryption: true,
360381
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
361382
removalPolicy: RemovalPolicy.DESTROY,
@@ -496,6 +517,13 @@ const openSearchDomain = new opensearch.Domain(
496517
"OpenSearchDomain",
497518
{
498519
version: opensearch.EngineVersion.OPENSEARCH_2_11,
520+
capacity: {
521+
// upgrade instance types for production use
522+
masterNodeInstanceType: "t3.small.search",
523+
masterNodes: 0,
524+
dataNodeInstanceType: "t3.small.search",
525+
dataNodes: 1,
526+
},
499527
nodeToNodeEncryption: true,
500528
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
501529
removalPolicy: RemovalPolicy.DESTROY,
@@ -696,6 +724,13 @@ const openSearchDomain = new opensearch.Domain(
696724
"OpenSearchDomain",
697725
{
698726
version: opensearch.EngineVersion.OPENSEARCH_2_11,
727+
capacity: {
728+
// upgrade instance types for production use
729+
masterNodeInstanceType: "t3.small.search",
730+
masterNodes: 0,
731+
dataNodeInstanceType: "t3.small.search",
732+
dataNodes: 1,
733+
},
699734
nodeToNodeEncryption: true,
700735
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
701736
removalPolicy: RemovalPolicy.DESTROY,
@@ -946,5 +981,5 @@ const schema = a.schema({
946981

947982
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.
948983

949-
![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)
984+
![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)
950985

0 commit comments

Comments
 (0)