Skip to content

Commit

Permalink
added Removal enum import
Browse files Browse the repository at this point in the history
  • Loading branch information
AnilMaktala authored Oct 28, 2024
1 parent 398cee0 commit b0b9de4
Showing 1 changed file with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,7 @@ Create an OpenSearch instance with encryption.
```ts title="amplify/backend.ts"
// highlight-start
import * as opensearch from 'aws-cdk-lib/aws-opensearchservice';
import { RemovalPolicy } from "aws-cdk-lib";
// highlight-end
import { defineBackend } from '@aws-amplify/backend';
import { auth } from './auth/resource';
Expand Down Expand Up @@ -191,6 +192,7 @@ Get the `s3BucketArn` and `s3BucketName` values from storage resource as shown b
```ts title="amplify/backend.ts"
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
import * as opensearch from "aws-cdk-lib/aws-opensearchservice";
import { RemovalPolicy } from "aws-cdk-lib";
// highlight-next-line
import * as iam from "aws-cdk-lib/aws-iam";
import { defineBackend } from "@aws-amplify/backend";
Expand Down Expand Up @@ -319,6 +321,7 @@ Customize the `template_content` JSON-representation to define the data structur
```ts title="amplify/backend.ts"
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
import * as opensearch from "aws-cdk-lib/aws-opensearchservice";
import { RemovalPolicy } from "aws-cdk-lib";
import * as iam from "aws-cdk-lib/aws-iam";
import { defineBackend } from "@aws-amplify/backend";
import { auth } from "./auth/resource";
Expand Down Expand Up @@ -354,6 +357,8 @@ const openSearchDomain = new opensearch.Domain(
{
version: opensearch.EngineVersion.OPENSEARCH_2_11,
nodeToNodeEncryption: true,
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
removalPolicy: RemovalPolicy.DESTROY,
encryptionAtRest: {
enabled: true,
},
Expand Down Expand Up @@ -456,6 +461,7 @@ The configuration is a data-prepper feature of OpenSearch. For specific document
```ts title="amplify/backend.ts"
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
import * as opensearch from "aws-cdk-lib/aws-opensearchservice";
import { RemovalPolicy } from "aws-cdk-lib";
import * as iam from "aws-cdk-lib/aws-iam";
import { defineBackend } from "@aws-amplify/backend";
import { auth } from "./auth/resource";
Expand Down Expand Up @@ -491,6 +497,8 @@ const openSearchDomain = new opensearch.Domain(
{
version: opensearch.EngineVersion.OPENSEARCH_2_11,
nodeToNodeEncryption: true,
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
removalPolicy: RemovalPolicy.DESTROY,
encryptionAtRest: {
enabled: true,
},
Expand Down Expand Up @@ -648,6 +656,7 @@ Now, create the OSIS pipeline resource:
```ts title="amplify/backend.ts"
import * as dynamodb from "aws-cdk-lib/aws-dynamodb";
import * as opensearch from "aws-cdk-lib/aws-opensearchservice";
import { RemovalPolicy } from "aws-cdk-lib";
import * as iam from "aws-cdk-lib/aws-iam";
// highlight-start
import * as osis from "aws-cdk-lib/aws-osis";
Expand Down Expand Up @@ -688,6 +697,8 @@ const openSearchDomain = new opensearch.Domain(
{
version: opensearch.EngineVersion.OPENSEARCH_2_11,
nodeToNodeEncryption: true,
// set removalPolicy to DESTROY to make sure the open search domain is deleted on stack deletion.
removalPolicy: RemovalPolicy.DESTROY,
encryptionAtRest: {
enabled: true,
},
Expand Down

0 comments on commit b0b9de4

Please sign in to comment.