Class FlowLogProps
Properties of a VPC Flow Log.
Inheritance
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.AWS.EC2.dll
Syntax (csharp)
public class FlowLogProps : Object, IFlowLogProps, IFlowLogOptions
Syntax (vb)
Public Class FlowLogProps
Inherits Object
Implements IFlowLogProps, IFlowLogOptions
Remarks
ExampleMetadata: infused
Examples
Vpc vpc;
var logGroup = new LogGroup(this, "MyCustomLogGroup");
var role = new Role(this, "MyCustomRole", new RoleProps {
AssumedBy = new ServicePrincipal("vpc-flow-logs.amazonaws.com")
});
new FlowLog(this, "FlowLog", new FlowLogProps {
ResourceType = FlowLogResourceType.FromVpc(vpc),
Destination = FlowLogDestination.ToCloudWatchLogs(logGroup, role)
});
Synopsis
Constructors
FlowLogProps() |
Properties
Destination | Specifies the type of destination to which the flow log data is to be published. |
FlowLogName | The name of the FlowLog. |
ResourceType | The type of resource for which to create the flow log. |
TrafficType | The type of traffic to log. |
Constructors
FlowLogProps()
public FlowLogProps()
Properties
Destination
Specifies the type of destination to which the flow log data is to be published.
public FlowLogDestination Destination { get; set; }
Property Value
Remarks
Flow log data can be published to CloudWatch Logs or Amazon S3
Default: FlowLogDestinationType.toCloudWatchLogs()
FlowLogName
The name of the FlowLog.
public string FlowLogName { get; set; }
Property Value
System.String
Remarks
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.
ResourceType
The type of resource for which to create the flow log.
public FlowLogResourceType ResourceType { get; set; }
Property Value
TrafficType
The type of traffic to log.
public Nullable<FlowLogTrafficType> TrafficType { get; set; }
Property Value
System.Nullable<FlowLogTrafficType>
Remarks
You can log traffic that the resource accepts or rejects, or all traffic.
Default: ALL