interface FlowLogOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.FlowLogOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#FlowLogOptions |
![]() | software.amazon.awscdk.services.ec2.FlowLogOptions |
![]() | aws_cdk.aws_ec2.FlowLogOptions |
![]() | aws-cdk-lib » aws_ec2 » FlowLogOptions |
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
Name | Type | Description |
---|---|---|
destination? | Flow | Specifies the type of destination to which the flow log data is to be published. |
log | Log [] | The fields to include in the flow log record, in the order in which they should appear. |
max | Flow | The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. |
traffic | Flow | The type of traffic to log. |
destination?
Type:
Flow
(optional, default: FlowLogDestinationType.toCloudWatchLogs())
Specifies the type of destination to which the flow log data is to be published.
Flow log data can be published to CloudWatch Logs or Amazon S3
logFormat?
Type:
Log
[]
(optional, default: default log format is used.)
The fields to include in the flow log record, in the order in which they should appear.
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()
.
See https://docs.aws.amazon.com/vpc/latest/userguide/flow-logs.html#flow-log-records
maxAggregationInterval?
Type:
Flow
(optional, default: FlowLogMaxAggregationInterval.TEN_MINUTES)
The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record.
trafficType?
Type:
Flow
(optional, default: ALL)
The type of traffic to log.
You can log traffic that the resource accepts or rejects, or all traffic.