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

(experimental) A VPC flow log.

Stability

experimental

Resource

AWS::EC2::FlowLog

Parameters
  • scope (Construct) –

  • id (str) –

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

  • flow_log_name (Optional[str]) – (experimental) 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]) – (experimental) 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]) – (experimental) The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic. Default: ALL

Stability

experimental

Methods

to_string()

Returns a string representation of this construct.

Return type

str

Attributes

bucket

(experimental) The S3 bucket to publish flow logs to.

Stability

experimental

Return type

Optional[IBucket]

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

Return type

ResourceEnvironment

flow_log_id

(experimental) The Id of the VPC Flow Log.

Stability

experimental

Attribute

true

Return type

str

iam_role

(experimental) The iam role used to publish logs to CloudWatch.

Stability

experimental

Return type

Optional[IRole]

key_prefix

(experimental) S3 bucket key prefix to publish the flow logs under.

Stability

experimental

Return type

Optional[str]

log_group

(experimental) The CloudWatch Logs LogGroup to publish flow logs to.

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)

(experimental) Import a Flow Log by it’s Id.

Parameters
  • scope (Construct) –

  • id (str) –

  • flow_log_id (str) –

Stability

experimental

Return type

IFlowLog

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters

x (Any) –

Return type

bool