|
5 | 5 | CfnOutput |
6 | 6 | } from "aws-cdk-lib" |
7 | 7 | import {PolicyStatement, Effect, ArnPrincipal} from "aws-cdk-lib/aws-iam" |
8 | | -import {CfnAccessPolicy} from "aws-cdk-lib/aws-opensearchserverless" |
9 | 8 | import {nagSuppressions} from "../nagSuppressions" |
10 | 9 | import {Apis} from "../resources/Apis" |
11 | 10 | import {Functions} from "../resources/Functions" |
@@ -108,26 +107,6 @@ export class EpsAssistMeStack extends Stack { |
108 | 107 | slackBotSigningSecret: secrets.slackBotSigningSecret |
109 | 108 | }) |
110 | 109 |
|
111 | | - // Define OpenSearchServerless access policy to access the index and collection |
112 | | - // from the Amazon Bedrock execution role and the lambda execution role |
113 | | - const aossAccessPolicy = new CfnAccessPolicy(this, "aossAccessPolicy", { |
114 | | - name: "eps-assist-access-policy", |
115 | | - type: "data", |
116 | | - policy: JSON.stringify([{ |
117 | | - Rules: [ |
118 | | - {ResourceType: "collection", Resource: ["collection/*"], Permission: ["aoss:*"]}, |
119 | | - {ResourceType: "index", Resource: ["index/*/*"], Permission: ["aoss:*"]} |
120 | | - ], |
121 | | - // Add principal of bedrock execution role and lambda execution role |
122 | | - Principal: [ |
123 | | - iamResources.bedrockExecutionRole.roleArn, |
124 | | - functions.functions.createIndex.function.role?.roleArn, |
125 | | - `arn:aws:iam::${account}:root` |
126 | | - ] |
127 | | - }]) |
128 | | - }) |
129 | | - openSearchResources.collection.collection.addDependency(aossAccessPolicy) |
130 | | - |
131 | 110 | // Create vector index |
132 | 111 | const vectorIndex = new VectorIndex(this, "VectorIndex", { |
133 | 112 | indexName: VECTOR_INDEX_NAME, |
|
0 commit comments