Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

awscc.ec2.flow_log

CloudFormation Type: AWS::EC2::FlowLog

Specifies a VPC flow log, which enables you to capture IP traffic for a specific network interface, subnet, or VPC.

Example

let vpc = awscc.ec2.vpc {
  cidr_block = "10.0.0.0/16"
}

awscc.ec2.flow_log {
  resource_id          = vpc.vpc_id
  resource_type        = VPC
  traffic_type         = ALL
  log_destination_type = s3
  log_destination      = "arn:aws:s3:::example-flow-logs-bucket"

  tags = {
    Environment = "example"
  }
}

Argument Reference

deliver_cross_account_role

  • Type: IamRoleArn
  • Required: No

The ARN of the IAM role that allows Amazon EC2 to publish flow logs across accounts.

deliver_logs_permission_arn

  • Type: IamRoleArn
  • Required: No

The ARN for the IAM role that permits Amazon EC2 to publish flow logs to a CloudWatch Logs log group in your account. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.

destination_options

log_destination

  • Type: Arn
  • Required: No

Specifies the destination to which the flow log data is to be published. Flow log data can be published to a CloudWatch Logs log group, an Amazon S3 bucket, or a Kinesis Firehose stream. The value specified for this parameter depends on the value specified for LogDestinationType.

log_destination_type

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.

log_format

  • Type: String
  • Required: No

The fields to include in the flow log record, in the order in which they should appear.

log_group_name

  • Type: String
  • Required: No

The name of a new or existing CloudWatch Logs log group where Amazon EC2 publishes your flow logs. If you specify LogDestinationType as s3 or kinesis-data-firehose, do not specify DeliverLogsPermissionArn or LogGroupName.

max_aggregation_interval

  • Type: IntEnum([60, 600])
  • Required: No

The maximum interval of time during which a flow of packets is captured and aggregated into a flow log record. You can specify 60 seconds (1 minute) or 600 seconds (10 minutes).

resource_id

  • Type: String
  • Required: Yes

The ID of the subnet, network interface, or VPC for which you want to create a flow log.

resource_type

The type of resource for which to create the flow log. For example, if you specified a VPC ID for the ResourceId property, specify VPC for this property.

tags

  • Type: Map
  • Required: No

The tags to apply to the flow logs.

traffic_type

The type of traffic to log. You can log traffic that the resource accepts or rejects, or all traffic.

Enum Values

file_format (FileFormat)

ValueDSL Identifier
plain-textawscc.ec2.flow_log.FileFormat.plain_text
parquetawscc.ec2.flow_log.FileFormat.parquet

Shorthand formats: plain_text or FileFormat.plain_text

log_destination_type (LogDestinationType)

ValueDSL Identifier
cloud-watch-logsawscc.ec2.flow_log.LogDestinationType.cloud_watch_logs
s3awscc.ec2.flow_log.LogDestinationType.s3
kinesis-data-firehoseawscc.ec2.flow_log.LogDestinationType.kinesis_data_firehose

Shorthand formats: cloud_watch_logs or LogDestinationType.cloud_watch_logs

resource_type (ResourceType)

ValueDSL Identifier
NetworkInterfaceawscc.ec2.flow_log.ResourceType.NetworkInterface
Subnetawscc.ec2.flow_log.ResourceType.Subnet
VPCawscc.ec2.flow_log.ResourceType.VPC
TransitGatewayawscc.ec2.flow_log.ResourceType.TransitGateway
TransitGatewayAttachmentawscc.ec2.flow_log.ResourceType.TransitGatewayAttachment
RegionalNatGatewayawscc.ec2.flow_log.ResourceType.RegionalNatGateway

Shorthand formats: NetworkInterface or ResourceType.NetworkInterface

traffic_type (TrafficType)

ValueDSL Identifier
ACCEPTawscc.ec2.flow_log.TrafficType.ACCEPT
ALLawscc.ec2.flow_log.TrafficType.ALL
REJECTawscc.ec2.flow_log.TrafficType.REJECT

Shorthand formats: ACCEPT or TrafficType.ACCEPT

Struct Definitions

DestinationOptions

FieldTypeRequiredDescription
file_formatEnum (FileFormat)Yes
hive_compatible_partitionsBoolYes
per_hour_partitionBoolYes

Attribute Reference

id

  • Type: FlowLogId