LogFormat

class aws_cdk.aws_ec2.LogFormat(value)

Bases: object

The following table describes all of the available fields for a flow log record.

ExampleMetadata:

infused

Example:

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

vpc.add_flow_log("FlowLog",
    log_format=[ec2.LogFormat.DST_PORT, ec2.LogFormat.SRC_PORT
    ]
)

# If you just want to add a field to the default field
vpc.add_flow_log("FlowLog",
    log_format=[ec2.LogFormat.VERSION, ec2.LogFormat.ALL_DEFAULT_FIELDS
    ]
)

# If AWS CDK does not support the new fields
vpc.add_flow_log("FlowLog",
    log_format=[ec2.LogFormat.SRC_PORT,
        ec2.LogFormat.custom("${new-field}")
    ]
)
Parameters:

value (str) –

Attributes

ACCOUNT_ID = <aws_cdk.aws_ec2.LogFormat object>
ACTION = <aws_cdk.aws_ec2.LogFormat object>
ALL_DEFAULT_FIELDS = <aws_cdk.aws_ec2.LogFormat object>
AZ_ID = <aws_cdk.aws_ec2.LogFormat object>
BYTES = <aws_cdk.aws_ec2.LogFormat object>
DST_ADDR = <aws_cdk.aws_ec2.LogFormat object>
DST_PORT = <aws_cdk.aws_ec2.LogFormat object>
END_TIMESTAMP = <aws_cdk.aws_ec2.LogFormat object>
FLOW_DIRECTION = <aws_cdk.aws_ec2.LogFormat object>
INSTANCE_ID = <aws_cdk.aws_ec2.LogFormat object>
INTERFACE_ID = <aws_cdk.aws_ec2.LogFormat object>
LOG_STATUS = <aws_cdk.aws_ec2.LogFormat object>
PACKETS = <aws_cdk.aws_ec2.LogFormat object>
PKT_DST_ADDR = <aws_cdk.aws_ec2.LogFormat object>
PKT_DST_AWS_SERVICE = <aws_cdk.aws_ec2.LogFormat object>
PKT_SRC_ADDR = <aws_cdk.aws_ec2.LogFormat object>
PKT_SRC_AWS_SERVICE = <aws_cdk.aws_ec2.LogFormat object>
PROTOCOL = <aws_cdk.aws_ec2.LogFormat object>
REGION = <aws_cdk.aws_ec2.LogFormat object>
SRC_ADDR = <aws_cdk.aws_ec2.LogFormat object>
SRC_PORT = <aws_cdk.aws_ec2.LogFormat object>
START_TIMESTAMP = <aws_cdk.aws_ec2.LogFormat object>
SUBLOCATION_ID = <aws_cdk.aws_ec2.LogFormat object>
SUBLOCATION_TYPE = <aws_cdk.aws_ec2.LogFormat object>
SUBNET_ID = <aws_cdk.aws_ec2.LogFormat object>
TCP_FLAGS = <aws_cdk.aws_ec2.LogFormat object>
TRAFFIC_PATH = <aws_cdk.aws_ec2.LogFormat object>
TRAFFIC_TYPE = <aws_cdk.aws_ec2.LogFormat object>
VERSION = <aws_cdk.aws_ec2.LogFormat object>
VPC_ID = <aws_cdk.aws_ec2.LogFormat object>
value

Static Methods

classmethod custom(format_string)

A custom format string.

Gives full control over the format string fragment.

Parameters:

format_string (str) –

Return type:

LogFormat

classmethod field(field)

A custom field name.

If there is no ready-made constant for a new field yet, you can use this. The field name will automatically be wrapped in ${ ... }.

Parameters:

field (str) –

Return type:

LogFormat