class FlowLogDestination
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.EC2.FlowLogDestination |
![]() | software.amazon.awscdk.services.ec2.FlowLogDestination |
![]() | aws_cdk.aws_ec2.FlowLogDestination |
![]() | @aws-cdk/aws-ec2 » FlowLogDestination |
The destination type for the 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)
});
Initializer
new FlowLogDestination()
Methods
Name | Description |
---|---|
bind(scope, flowLog) | Generates a flow log destination configuration. |
static to | Use CloudWatch logs as the destination. |
static to | Use S3 as the destination. |
bind(scope, flowLog)
public bind(scope: Construct, flowLog: FlowLog): FlowLogDestinationConfig
Parameters
Returns
Generates a flow log destination configuration.
static toCloudWatchLogs(logGroup?, iamRole?)
public static toCloudWatchLogs(logGroup?: ILogGroup, iamRole?: IRole): FlowLogDestination
Parameters
Returns
Use CloudWatch logs as the destination.
static toS3(bucket?, keyPrefix?)
public static toS3(bucket?: IBucket, keyPrefix?: string): FlowLogDestination
Parameters
- bucket
IBucket
- keyPrefix
string
Returns
Use S3 as the destination.