interface FlowLogProps
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.FlowLogProps |
![]() | software.amazon.awscdk.services.ec2.FlowLogProps |
![]() | aws_cdk.aws_ec2.FlowLogProps |
![]() | @aws-cdk/aws-ec2 » FlowLogProps |
Properties of a VPC Flow Log.
Example
declare const vpc: ec2.Vpc;
const logGroup = new logs.LogGroup(this, 'MyCustomLogGroup');
const role = new iam.Role(this, 'MyCustomRole', {
assumedBy: new iam.ServicePrincipal('vpc-flow-logs.amazonaws.com')
});
new ec2.FlowLog(this, 'FlowLog', {
resourceType: ec2.FlowLogResourceType.fromVpc(vpc),
destination: ec2.FlowLogDestination.toCloudWatchLogs(logGroup, role)
});
Properties
Name | Type | Description |
---|---|---|
resource | Flow | The type of resource for which to create the flow log. |
destination? | Flow | Specifies the type of destination to which the flow log data is to be published. |
flow | string | The name of the FlowLog. |
traffic | Flow | The type of traffic to log. |
resourceType
Type:
Flow
The type of resource for which to create the flow log.
destination?
Type:
Flow
(optional, default: FlowLogDestinationType.toCloudWatchLogs())
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
flowLogName?
Type:
string
(optional, default: If you don't specify a flowLogName, AWS CloudFormation generates a
unique physical ID and uses that ID for the group name.)
The name of the FlowLog.
It is not recommended to use an explicit name.
trafficType?
Type:
Flow
(optional, default: ALL)
The type of traffic to log.
You can log traffic that the resource accepts or rejects, or all traffic.