11
11
* and limitations under the License.
12
12
*/
13
13
import * as path from 'path' ;
14
- import { Duration , Aws } from 'aws-cdk-lib' ;
14
+ import { Duration , Aws , Annotations } from 'aws-cdk-lib' ;
15
15
import * as appsync from 'aws-cdk-lib/aws-appsync' ;
16
16
import * as cognito from 'aws-cdk-lib/aws-cognito' ;
17
17
import * as ec2 from 'aws-cdk-lib/aws-ec2' ;
@@ -158,6 +158,21 @@ export interface QaAppsyncOpensearchProps {
158
158
* @summary The QaAppsyncOpensearch class.
159
159
*/
160
160
export class QaAppsyncOpensearch extends Construct {
161
+ /**
162
+ * Construct warning
163
+ */
164
+ public static readonly CONSTRUCT_SCHEMA_UPDATE_WARNING = `
165
+ Attention QaAppsyncOpensearch users, an update has been made to
166
+ the GraphQL schema.To ensure continued functionality, please review
167
+ and update your GraphQL mutations and subscriptions to align with
168
+ the new schema.This schema update enables enhanced capabilities
169
+ and optimizations,so adopting the changes is recommended.
170
+ Please refer to the construct documentation for details
171
+ on the schema changes and examples of updated GraphQL statements.
172
+ Reach out to the support team if you need assistance
173
+ updating your integration codebase.
174
+ ` ;
175
+
161
176
/**
162
177
* Returns the instance of ec2.IVpc used by the construct
163
178
*/
@@ -189,6 +204,7 @@ export class QaAppsyncOpensearch extends Construct {
189
204
*/
190
205
public readonly qaLambdaFunction : lambda . DockerImageFunction ;
191
206
207
+
192
208
/**
193
209
* @summary Constructs a new instance of the RagAppsyncStepfnOpensearch class.
194
210
* @param {cdk.App } scope - represents the scope for all the resources.
@@ -200,6 +216,7 @@ export class QaAppsyncOpensearch extends Construct {
200
216
constructor ( scope : Construct , id : string , props : QaAppsyncOpensearchProps ) {
201
217
super ( scope , id ) ;
202
218
219
+ Annotations . of ( scope ) . addWarning ( QaAppsyncOpensearch . CONSTRUCT_SCHEMA_UPDATE_WARNING ) ;
203
220
// stage
204
221
let stage = '-dev' ;
205
222
if ( props ?. stage ) {
@@ -425,7 +442,7 @@ export class QaAppsyncOpensearch extends Construct {
425
442
} ,
426
443
) ;
427
444
428
- // Minimum permissions for a Lambda function to execute while accessing a resource within a VPC
445
+ // Minimum permissions for a Lambda functienvon to execute while accessing a resource within a VPC
429
446
question_answering_function_role . addToPolicy (
430
447
new iam . PolicyStatement ( {
431
448
effect : iam . Effect . ALLOW ,
@@ -449,6 +466,13 @@ export class QaAppsyncOpensearch extends Construct {
449
466
resources : [ '*' ] ,
450
467
} ) ,
451
468
) ;
469
+ question_answering_function_role . addToPolicy (
470
+ new iam . PolicyStatement ( {
471
+ effect : iam . Effect . ALLOW ,
472
+ actions : [ 'sagemaker:InvokeEndpoint' ] ,
473
+ resources : [ '*' ] ,
474
+ } ) ,
475
+ ) ;
452
476
453
477
// The lambda will access the opensearch credentials
454
478
if ( props . openSearchSecret ) {
0 commit comments