File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 55 VectorCollectionStandbyReplicas
66} from "@cdklabs/generative-ai-cdk-constructs/lib/cdk-lib/opensearchserverless"
77import { RemovalPolicy } from "aws-cdk-lib"
8+ import { CfnCollection } from "aws-cdk-lib/aws-opensearchserverless"
89
910export interface OpenSearchResourcesProps {
1011 readonly stackName : string
@@ -28,7 +29,10 @@ export class OpenSearchResources extends Construct {
2829 // Grant access to the Bedrock execution role
2930 this . collection . grantDataAccess ( props . bedrockExecutionRole )
3031
31- this . collection . applyRemovalPolicy ( RemovalPolicy . DESTROY )
32+ const cfnCollection = this . collection . node . defaultChild as CfnCollection
33+ if ( cfnCollection ) {
34+ cfnCollection . applyRemovalPolicy ( RemovalPolicy . DESTROY )
35+ }
3236
3337 }
3438}
You can’t perform that action at this time.
0 commit comments