Skip to content

Commit bdb9228

Browse files
committed
Remove unnecessary access policy for collection
1 parent 5ce8a49 commit bdb9228

File tree

1 file changed

+0
-21
lines changed

1 file changed

+0
-21
lines changed

packages/cdk/stacks/EpsAssistMeStack.ts

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import {
55
CfnOutput
66
} from "aws-cdk-lib"
77
import {PolicyStatement, Effect, ArnPrincipal} from "aws-cdk-lib/aws-iam"
8-
import {CfnAccessPolicy} from "aws-cdk-lib/aws-opensearchserverless"
98
import {nagSuppressions} from "../nagSuppressions"
109
import {Apis} from "../resources/Apis"
1110
import {Functions} from "../resources/Functions"
@@ -108,26 +107,6 @@ export class EpsAssistMeStack extends Stack {
108107
slackBotSigningSecret: secrets.slackBotSigningSecret
109108
})
110109

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-
131110
// Create vector index
132111
const vectorIndex = new VectorIndex(this, "VectorIndex", {
133112
indexName: VECTOR_INDEX_NAME,

0 commit comments

Comments
 (0)