FlowLogDestination

class aws_cdk.aws_ec2.FlowLogDestination

Bases: object

The destination type for the flow log.

Example:

# vpc is of type Vpc


log_group = logs.LogGroup(self, "MyCustomLogGroup")

role = iam.Role(self, "MyCustomRole",
    assumed_by=iam.ServicePrincipal("vpc-flow-logs.amazonaws.com")
)

ec2.FlowLog(self, "FlowLog",
    resource_type=ec2.FlowLogResourceType.from_vpc(vpc),
    destination=ec2.FlowLogDestination.to_cloud_watch_logs(log_group, role)
)

Methods

abstract bind(scope, flow_log)

Generates a flow log destination configuration.

Parameters
Return type

FlowLogDestinationConfig

Static Methods

classmethod to_cloud_watch_logs(log_group=None, iam_role=None)

Use CloudWatch logs as the destination.

Parameters
Return type

FlowLogDestination

classmethod to_s3(bucket=None, key_prefix=None)

Use S3 as the destination.

Parameters
  • bucket (Optional[IBucket]) –

  • key_prefix (Optional[str]) –

Return type

FlowLogDestination