Skip to content

Commit

Permalink
adjust vpc flow log creation logic (#1112)
Browse files Browse the repository at this point in the history
  • Loading branch information
rjjaegeraws committed Mar 9, 2023
1 parent 055c6a8 commit b5dc19c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/deployments/cdk/src/deployments/vpc/step-2.ts
Expand Up @@ -156,13 +156,14 @@ function createVpcFlowLog(props: {
customFields,
} = props;
for (const [index, logDestination] of logDestinations.entries()) {
const flowLogs = new ec2.CfnFlowLog(scope, `FlowLog${vpcName}${logDestinationTypes[index]}`, {
deliverLogsPermissionArn: roleArn,
const logDestinationType = logDestinationTypes[index];
const flowLogs = new ec2.CfnFlowLog(scope, `FlowLog${vpcName}${logDestinationType}`, {
deliverLogsPermissionArn: logDestinationType == ec2.FlowLogDestinationType.CLOUD_WATCH_LOGS ? roleArn : undefined,
resourceId: vpcId,
resourceType: 'VPC',
trafficType,
logDestination,
logDestinationType: logDestinationTypes[index],
logDestinationType: logDestinationType,
});
flowLogs.addPropertyOverride('MaxAggregationInterval', aggregationInterval);
if (customFields) {
Expand Down

0 comments on commit b5dc19c

Please sign in to comment.