File tree 2 files changed +31
-14
lines changed
apidocs/namespaces/opensearchserverless/interfaces
src/cdk-lib/opensearchserverless
2 files changed +31
-14
lines changed Original file line number Diff line number Diff line change @@ -16,6 +16,14 @@ The name of the collection.
16
16
17
17
***
18
18
19
+ ### customAossPolicy?
20
+
21
+ > ` readonly ` ` optional ` ** customAossPolicy** : ` ManagedPolicy `
22
+
23
+ A user defined IAM policy that allows API access to the collection.
24
+
25
+ ***
26
+
19
27
### standbyReplicas?
20
28
21
29
> ` readonly ` ` optional ` ** standbyReplicas** : [ ` VectorCollectionStandbyReplicas ` ] ( ../enumerations/VectorCollectionStandbyReplicas.md )
Original file line number Diff line number Diff line change @@ -33,6 +33,11 @@ export interface VectorCollectionProps {
33
33
* @default ENABLED
34
34
*/
35
35
readonly standbyReplicas ?: VectorCollectionStandbyReplicas ;
36
+
37
+ /**
38
+ * A user defined IAM policy that allows API access to the collection.
39
+ */
40
+ readonly customAossPolicy ?: iam . ManagedPolicy ;
36
41
}
37
42
38
43
/**
@@ -135,20 +140,24 @@ export class VectorCollection extends Construct {
135
140
this . collectionArn = collection . attrArn ;
136
141
this . collectionId = collection . attrId ;
137
142
138
- this . aossPolicy = new iam . ManagedPolicy (
139
- this ,
140
- 'AOSSApiAccessAll' , {
141
- statements : [
142
- new iam . PolicyStatement ( {
143
- effect : iam . Effect . ALLOW ,
144
- actions : [
145
- 'aoss:APIAccessAll' ,
146
- ] ,
147
- resources : [ collection . attrArn ] ,
148
- } ) ,
149
- ] ,
150
- } ,
151
- ) ;
143
+ if ( props ?. customAossPolicy ) {
144
+ this . aossPolicy = props . customAossPolicy ;
145
+ } else {
146
+ this . aossPolicy = new iam . ManagedPolicy (
147
+ this ,
148
+ 'AOSSApiAccessAll' , {
149
+ statements : [
150
+ new iam . PolicyStatement ( {
151
+ effect : iam . Effect . ALLOW ,
152
+ actions : [
153
+ 'aoss:APIAccessAll' ,
154
+ ] ,
155
+ resources : [ collection . attrArn ] ,
156
+ } ) ,
157
+ ] ,
158
+ } ,
159
+ ) ;
160
+ }
152
161
153
162
collection . addDependency ( encryptionPolicy ) ;
154
163
collection . addDependency ( networkPolicy ) ;
You can’t perform that action at this time.
0 commit comments