FlowLogOptions

class aws_cdk.aws_ec2.FlowLogOptions(*, destination=None, traffic_type=None)

Bases: object

Options to add a flow log to a VPC.

Parameters:
  • destination (Optional[FlowLogDestination]) – 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 Default: FlowLogDestinationType.toCloudWatchLogs()

  • traffic_type (Optional[FlowLogTrafficType]) – The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic. Default: ALL

ExampleMetadata:

infused

Example:

vpc = ec2.Vpc(self, "Vpc")

vpc.add_flow_log("FlowLogS3",
    destination=ec2.FlowLogDestination.to_s3()
)

vpc.add_flow_log("FlowLogCloudWatch",
    traffic_type=ec2.FlowLogTrafficType.REJECT
)

Attributes

destination

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

Default:

FlowLogDestinationType.toCloudWatchLogs()

traffic_type

The type of traffic to log.

You can log traffic that the resource accepts or rejects, or all traffic.

Default:

ALL