FlowLogProps Struct
Properties of a VPC Flow Log.
Example
declare const tgw: ec2.CfnTransitGateway;
new ec2.FlowLog(this, 'TransitGatewayFlowLog', {
resourceType: ec2.FlowLogResourceType.fromTransitGatewayId(tgw.ref)
})
# tgw: ec2.CfnTransitGateway
ec2.FlowLog(self, "TransitGatewayFlowLog",
resource_type=ec2.FlowLogResourceType.from_transit_gateway_id(tgw.ref)
)
CfnTransitGateway tgw;
FlowLog.Builder.create(this, "TransitGatewayFlowLog")
.resourceType(FlowLogResourceType.fromTransitGatewayId(tgw.getRef()))
.build();
// Install: dotnet add package Amazon.CDK.Lib
CfnTransitGateway tgw;
new FlowLog(this, "TransitGatewayFlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromTransitGatewayId(tgw.Ref)
});
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var tgw CfnTransitGateway
ec2.NewFlowLog(this, jsii.String("TransitGatewayFlowLog"), &FlowLogProps{
ResourceType: ec2.FlowLogResourceType_FromTransitGatewayId(tgw.ref),
})
Properties
destinationoptionalFlowLogDestinationdestinationoptionalFlowLogDestinationdestinationoptionalFlowLogDestinationDestinationoptionalFlowLogDestinationDestinationoptionalFlowLogDestination#Default: FlowLogDestinationType.toCloudWatchLogs()
Flow log data can be published to CloudWatch Logs or Amazon S3
flowLogNameoptionalstringflow_log_nameoptionalstrflowLogNameoptionalStringFlowLogNameoptionalstringFlowLogNameoptional*string#Default: CDK generated name
Since the FlowLog resource doesn't support providing a physical name, the value provided here will be recorded in the Name tag.
logFormatoptionalLogFormat[]log_formatoptionaltyping.List[LogFormat]logFormatoptionalList<LogFormat>LogFormatoptionalLogFormat[]LogFormatoptional*[]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().
maxAggregationIntervaloptionalFlowLogMaxAggregationIntervalmax_aggregation_intervaloptionalFlowLogMaxAggregationIntervalmaxAggregationIntervaloptionalFlowLogMaxAggregationIntervalMaxAggregationIntervaloptionalFlowLogMaxAggregationIntervalMaxAggregationIntervaloptionalFlowLogMaxAggregationInterval#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.
resourceTypeFlowLogResourceTyperesource_typeFlowLogResourceTyperesourceTypeFlowLogResourceTypeResourceTypeFlowLogResourceTypeResourceTypeFlowLogResourceTyperequired#trafficTypeoptionalFlowLogTrafficTypetraffic_typeoptionalFlowLogTrafficTypetrafficTypeoptionalFlowLogTrafficTypeTrafficTypeoptionalFlowLogTrafficTypeTrafficTypeoptionalFlowLogTrafficType= 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.