FlowLog

class aws_cdk.aws_ec2.FlowLog(scope, id, *, resource_type, flow_log_name=None, destination=None, traffic_type=None)

Bases: aws_cdk.core.Resource

A VPC flow log.

stability :stability: experimental resource: :resource:: AWS::EC2::FlowLog

__init__(scope, id, *, resource_type, flow_log_name=None, destination=None, traffic_type=None)
Parameters
  • scope (Construct) –

  • id (str) –

  • resource_type (FlowLogResourceType) – The type of resource for which to create the flow log.

  • flow_log_name (Optional[str]) – The name of the FlowLog. It is not recommended to use an explicit name. Default: If you don’t specify a flowLogName, AWS CloudFormation generates a unique physical ID and uses that ID for the group name.

  • 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

stability :stability: experimental

Return type

None

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

bucket

The S3 bucket to publish flow logs to.

stability :stability: experimental

Return type

Optional[IBucket]

flow_log_id

The Id of the VPC Flow Log.

stability :stability: experimental attribute: :attribute:: true

Return type

str

iam_role

The iam role used to publish logs to CloudWatch.

stability :stability: experimental

Return type

Optional[IRole]

log_group

The CloudWatch Logs LogGroup to publish flow logs to.

stability :stability: experimental

Return type

Optional[ILogGroup]

node

The construct tree node associated with this construct.

Return type

ConstructNode

stack

The stack in which this resource is defined.

Return type

Stack

Static Methods

classmethod from_flow_log_id(scope, id, flow_log_id)

Import a Flow Log by it’s Id.

Parameters
  • scope (Construct) –

  • id (str) –

  • flow_log_id (str) –

stability :stability: experimental

Return type

IFlowLog

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool