Skip to content

Commit d33e504

Browse files
committed
it is doing things correctly
1 parent e154b44 commit d33e504

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

.github/scripts/fix_cdk_json.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,5 +48,3 @@ fix_string_key commitId "${COMMIT_ID}"
4848
fix_string_key cfnDriftDetectionGroup "${CFN_DRIFT_DETECTION_GROUP}"
4949
fix_boolean_number_key logRetentionInDays "${LOG_RETENTION_IN_DAYS}"
5050
fix_boolean_number_key forwardCsocLogs "${FORWARD_CSOC_LOGS}"
51-
52-
cat .build/cdk.json

packages/cdk/stacks/VpcResourcesStack.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export class VpcResourcesStack extends Stack {
4747
// Context
4848
/* context values passed as --context cli arguments are passed as strings so coerce them to expected types*/
4949
const logRetentionInDays: number = Number(this.node.tryGetContext("logRetentionInDays"))
50-
//const forwardCsocLogs: boolean = Boolean(this.node.tryGetContext("forwardCsocLogs"))
50+
const forwardCsocLogs: boolean = Boolean(this.node.tryGetContext("forwardCsocLogs"))
5151

5252
// Imports
5353
const cloudwatchKmsKey = Key.fromKeyArn(
@@ -73,19 +73,19 @@ export class VpcResourcesStack extends Stack {
7373
}
7474

7575
// Conditionally add S3 flow logs if forwardCsocLogs is true
76-
//if (forwardCsocLogs) {
77-
const vpcFlowLogsBucket = Bucket.fromBucketArn(
78-
this,
79-
"VpcFlowLogsBucket",
80-
"arn:aws:s3:::nhsd-audit-vpcflowlogs"
81-
)
82-
83-
flowLogsConfig["FlowLogS3"] = {
84-
destination: FlowLogDestination.toS3(vpcFlowLogsBucket),
85-
trafficType: FlowLogTrafficType.ALL,
86-
maxAggregationInterval: FlowLogMaxAggregationInterval.TEN_MINUTES
76+
if (forwardCsocLogs) {
77+
const vpcFlowLogsBucket = Bucket.fromBucketArn(
78+
this,
79+
"VpcFlowLogsBucket",
80+
"arn:aws:s3:::nhsd-audit-vpcflowlogs"
81+
)
82+
83+
flowLogsConfig["FlowLogS3"] = {
84+
destination: FlowLogDestination.toS3(vpcFlowLogsBucket),
85+
trafficType: FlowLogTrafficType.ALL,
86+
maxAggregationInterval: FlowLogMaxAggregationInterval.TEN_MINUTES
87+
}
8788
}
88-
//}
8989

9090
const vpc = new Vpc(this, "vpc", {
9191
ipAddresses: IpAddresses.cidr("10.190.0.0/16"),

0 commit comments

Comments
 (0)