FlowLogResourceType

class aws_cdk.aws_ec2.FlowLogResourceType

Bases: object

The type of resource to create the flow log for.

ExampleMetadata

infused

Example:

# Example automatically generated from non-compiling source. May contain errors.
# vpc: ec2.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)
)

Attributes

resource_id

The Id of the resource that the flow log should be attached to.

Return type

str

resource_type

The type of resource to attach a flow log to.

Return type

str

Static Methods

classmethod from_network_interface_id(id)

The Network Interface to attach the Flow Log to.

Parameters

id (str) –

Return type

FlowLogResourceType

classmethod from_subnet(subnet)

The subnet to attach the Flow Log to.

Parameters

subnet (ISubnet) –

Return type

FlowLogResourceType

classmethod from_vpc(vpc)

The VPC to attach the Flow Log to.

Parameters

vpc (IVpc) –

Return type

FlowLogResourceType