1
1
import { Construct } from 'constructs'
2
2
import {
3
3
Stack ,
4
- StackProps ,
5
4
RemovalPolicy ,
6
5
Duration ,
7
6
aws_kms as kms ,
@@ -13,6 +12,7 @@ import {
13
12
aws_glue as glue ,
14
13
aws_athena as athena ,
15
14
aws_logs as logs ,
15
+ StackProps ,
16
16
} from 'aws-cdk-lib'
17
17
18
18
import { LambdaFunctionProcessor as LambdaFunctionProcessorAlpha , DeliveryStream as DeliveryStreamAlpha } from '@aws-cdk/aws-kinesisfirehose-alpha'
@@ -24,9 +24,15 @@ import { Quicksight } from './quicksight/quicksight'
24
24
import { QuicksightRole } from './quicksight/quicksight-role'
25
25
import { DdbExport } from './ddb-export/ddb-export'
26
26
import { DdbExportStepFunction } from './ddb-export/ddb-export-step-function'
27
+ import { Config } from '../bin/config'
28
+
29
+
30
+ export interface CdkStackProps extends StackProps {
31
+ config : Config
32
+ }
27
33
28
34
export class CdkStack extends Stack {
29
- constructor ( scope : Construct , id : string , props ?: StackProps ) {
35
+ constructor ( scope : Construct , id : string , props ?: CdkStackProps ) {
30
36
super ( scope , id , props )
31
37
32
38
const name = `persons-cdk`
@@ -244,16 +250,19 @@ export class CdkStack extends Stack {
244
250
245
251
savedQueries . node . addDependency ( athenaWorkgroup )
246
252
247
- new Quicksight ( this , 'quicksight' , {
248
- bucket : firehoseBucket ,
249
- name : name ,
250
- prefix : ddbChangesPrefix ,
251
- } )
253
+ if ( props ?. config . isQuicksight ) {
252
254
253
- new QuicksightRole ( this , 'quicksight-role' , {
254
- name : name ,
255
- bucket : firehoseBucket ,
256
- } )
255
+ new Quicksight ( this , 'quicksight' , {
256
+ bucket : firehoseBucket ,
257
+ name : name ,
258
+ prefix : ddbChangesPrefix ,
259
+ } )
260
+
261
+ new QuicksightRole ( this , 'quicksight-role' , {
262
+ name : name ,
263
+ bucket : firehoseBucket ,
264
+ } )
265
+ }
257
266
258
267
new DdbExport ( this , 'ddb-export' , {
259
268
name : name ,
0 commit comments