Skip to content

Commit d57eb75

Browse files
authored
reduce opensearch domain capacity to free tier-eligible (#8093)
* reduce opensearch domain capacity to free tier-eligible * open search -> OpenSearch
1 parent 6c8a9d7 commit d57eb75

File tree

1 file changed

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

1 file changed

+41
-6
lines changed

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

Lines changed: 41 additions & 6 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,8 +238,15 @@ 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,
235-
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
249+
// set removalPolicy to DESTROY to make sure the OpenSearch domain is deleted on stack deletion.
236250
removalPolicy: RemovalPolicy.DESTROY,
237251
encryptionAtRest: {
238252
enabled: true,
@@ -356,8 +370,15 @@ 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,
360-
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
381+
// set removalPolicy to DESTROY to make sure the OpenSearch domain is deleted on stack deletion.
361382
removalPolicy: RemovalPolicy.DESTROY,
362383
encryptionAtRest: {
363384
enabled: true,
@@ -496,8 +517,15 @@ 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,
500-
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
528+
// set removalPolicy to DESTROY to make sure the OpenSearch domain is deleted on stack deletion.
501529
removalPolicy: RemovalPolicy.DESTROY,
502530
encryptionAtRest: {
503531
enabled: true,
@@ -696,8 +724,15 @@ 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,
700-
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
735+
// set removalPolicy to DESTROY to make sure the OpenSearch domain is deleted on stack deletion.
701736
removalPolicy: RemovalPolicy.DESTROY,
702737
encryptionAtRest: {
703738
enabled: true,
@@ -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)