interface FlowLogProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.EC2.FlowLogProps |
Go | github.com/aws/aws-cdk-go/awscdk/v2/awsec2#FlowLogProps |
Java | software.amazon.awscdk.services.ec2.FlowLogProps |
Python | aws_cdk.aws_ec2.FlowLogProps |
TypeScript (source) | aws-cdk-lib » aws_ec2 » FlowLogProps |
Properties of a VPC Flow Log.
Example
declare const tgw: ec2.CfnTransitGateway;
new ec2.FlowLog(this, 'TransitGatewayFlowLog', {
resourceType: ec2.FlowLogResourceType.fromTransitGatewayId(tgw.ref)
})
Properties
Name | Type | Description |
---|---|---|
resource | Flow | The type of resource for which to create the flow log. |
destination? | Flow | Specifies the type of destination to which the flow log data is to be published. |
flow | string | The name of the FlowLog. |
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. |
resourceType
Type:
Flow
The type of resource for which to create the flow 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
flowLogName?
Type:
string
(optional, default: CDK generated name)
The name of the FlowLog.
Since the FlowLog resource doesn't support providing a physical name, the value provided here will be recorded in the Name
tag.
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.ONE_MINUTES if creating flow logs for Transit Gateway, otherwise FlowLogMaxAggregationInterval.TEN_MINUTES.)
The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record.
When creating flow logs for a Transit Gateway or Transit Gateway Attachment, this property must be ONE_MINUTES.
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.
When the target is either TransitGateway
or TransitGatewayAttachment
, setting the traffic type is not possible.
See also: https://docs.aws.amazon.com/vpc/latest/tgw/working-with-flow-logs.html