FlowLogOptions Struct
Options to add a flow log to a VPC.
Example
const vpc = new ec2.Vpc(this, 'Vpc');
vpc.addFlowLog('FlowLogS3', {
destination: ec2.FlowLogDestination.toS3()
});
// Only reject traffic and interval every minute.
vpc.addFlowLog('FlowLogCloudWatch', {
trafficType: ec2.FlowLogTrafficType.REJECT,
maxAggregationInterval: ec2.FlowLogMaxAggregationInterval.ONE_MINUTE,
});
Properties
destinationFlowLogDestinationdestinationFlowLogDestinationdestinationFlowLogDestinationDestinationFlowLogDestinationDestinationFlowLogDestination#Default: FlowLogDestinationType.toCloudWatchLogs()
Flow log data can be published to CloudWatch Logs or Amazon S3
logFormatLogFormat[]log_formattyping.List[LogFormat]logFormatList<LogFormat>LogFormatLogFormat[]LogFormat*[]LogFormat#Default: default log format is used.
notes
If multiple fields are specified, they will be separated by spaces. For full control over the literal log format string, pass a single field constructed with LogFormat.custom().
maxAggregationIntervalFlowLogMaxAggregationIntervalmax_aggregation_intervalFlowLogMaxAggregationIntervalmaxAggregationIntervalFlowLogMaxAggregationIntervalMaxAggregationIntervalFlowLogMaxAggregationIntervalMaxAggregationIntervalFlowLogMaxAggregationInterval#Default: FlowLogMaxAggregationInterval.ONE_MINUTES if creating flow logs for Transit Gateway, otherwise FlowLogMaxAggregationInterval.TEN_MINUTES.
When creating flow logs for a Transit Gateway or Transit Gateway Attachment, this property must be ONE_MINUTES.
trafficTypeFlowLogTrafficTypetraffic_typeFlowLogTrafficTypetrafficTypeFlowLogTrafficTypeTrafficTypeFlowLogTrafficTypeTrafficTypeFlowLogTrafficType= ALL#You can log traffic that the resource accepts or rejects, or all traffic. When the target is either TransitGateway or TransitGatewayAttachment, setting the traffic type is not possible.