import { Stack , Construct , StackProps , CfnOutput } from '@aws-cdk/core' ; import { Bucket } from '@aws-cdk/aws-s3' ; import KendraIndex from '../constructs/kendra/kendra-index' ; import KendraS3DataSource from '../constructs/kendra/kendra-s3-data-source' ; import { KendraInfrastructureProps } from './web-crawler-stack' ; /**
 * This stack deploys the kendra infrastructure to enable the "search engine" part of this sample.
 * It's an optional part of the sample - see the README for more details.
 */ export class KendraStack extends Stack { public readonly kendra : KendraInfrastructureProps ; constructor ( scope , id , props ? ) { super ( scope , id , props ) ; const dataSourceBucket = new Bucket ( this , 'KendraDataSourceBucket' ) ; const kendraIndex = new KendraIndex ( this , 'KendraIndex' ) . index ; const kendraDataSource = new KendraS3DataSource ( this , 'KendraDataSource' , { index : kendraIndex , bucket : dataSourceBucket , } ) . dataSource ; new CfnOutput ( this , 'CrawlerKendraIndexId' , { exportName : 'CrawlerKendraIndexId' , value : kendraIndex . attrId , } ) ; this . kendra = { kendraIndex , kendraDataSource , dataSourceBucket , } ; } }