Skip to content

Commit

Permalink
reduce opensearch domain capacity to free tier-eligible
Browse files Browse the repository at this point in the history
  • Loading branch information
josefaidt committed Nov 14, 2024
1 parent 6c8a9d7 commit 59cbdfe
Showing 1 changed file with 37 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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)

0 comments on commit 59cbdfe

Please sign in to comment.