File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
src/deployments/cdk/src/deployments/vpc Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -156,13 +156,14 @@ function createVpcFlowLog(props: {
156156 customFields,
157157 } = props ;
158158 for ( const [ index , logDestination ] of logDestinations . entries ( ) ) {
159- const flowLogs = new ec2 . CfnFlowLog ( scope , `FlowLog${ vpcName } ${ logDestinationTypes [ index ] } ` , {
160- deliverLogsPermissionArn : roleArn ,
159+ const logDestinationType = logDestinationTypes [ index ] ;
160+ const flowLogs = new ec2 . CfnFlowLog ( scope , `FlowLog${ vpcName } ${ logDestinationType } ` , {
161+ deliverLogsPermissionArn : logDestinationType == ec2 . FlowLogDestinationType . CLOUD_WATCH_LOGS ? roleArn : undefined ,
161162 resourceId : vpcId ,
162163 resourceType : 'VPC' ,
163164 trafficType,
164165 logDestination,
165- logDestinationType : logDestinationTypes [ index ] ,
166+ logDestinationType : logDestinationType ,
166167 } ) ;
167168 flowLogs . addPropertyOverride ( 'MaxAggregationInterval' , aggregationInterval ) ;
168169 if ( customFields ) {
You can’t perform that action at this time.
0 commit comments