Skip to content
v2.274.0

FlowLogDestination Class ​

The destination type for the flow log.

Example ​

ts
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 ​

ts
new FlowLogDestination()
python
FlowLogDestination()
java
new FlowLogDestination()
csharp
new FlowLogDestination()
go
NewFlowLogDestination()

Methods ​

bind(scope: Construct, flowLog: FlowLog): FlowLogDestinationConfigdef bind(self, scope: Construct, flow_log: FlowLog) -> FlowLogDestinationConfigpublic FlowLogDestinationConfig bind(Construct scope, FlowLog flowLog)public FlowLogDestinationConfig Bind(Construct scope, FlowLog flowLog)func Bind(Scope Construct, FlowLog FlowLog) FlowLogDestinationConfig#
Generates a flow log destination configuration.
toCloudWatchLogs(logGroup?: ILogGroupRef, iamRole?: IRole): FlowLogDestination // chainable@staticmethod def to_cloud_watch_logs(log_group: typing.Optional[ILogGroupRef] = None, iam_role: typing.Optional[IRole] = None) -> FlowLogDestinationpublic static FlowLogDestination toCloudWatchLogs(ILogGroupRef logGroup, IRole iamRole)public static FlowLogDestination ToCloudWatchLogs(ILogGroupRef? logGroup = null, IRole? iamRole = null)func ToCloudWatchLogs(LogGroup ILogGroupRef, IamRole IRole) FlowLogDestinationstatic#
Use CloudWatch logs as the destination.
toFirehose(deliveryStream: IDeliveryStreamRef, iamRole?: IRole): FlowLogDestination // chainable@staticmethod def to_firehose(delivery_stream: IDeliveryStreamRef, iam_role: typing.Optional[IRole] = None) -> FlowLogDestinationpublic static FlowLogDestination toFirehose(IDeliveryStreamRef deliveryStream, IRole iamRole)public static FlowLogDestination ToFirehose(IDeliveryStreamRef deliveryStream, IRole? iamRole = null)func ToFirehose(DeliveryStream IDeliveryStreamRef, IamRole IRole) FlowLogDestinationstatic#
Use Amazon Data Firehose as the destination.

If the delivery stream and the VPC are in different account, you must specify iamRole.

2 parameters

Parameters

  • deliveryStreamdelivery_streamdeliveryStreamdeliveryStreamDeliveryStream — the Amazon Data Firehose delivery stream to publish logs to.
  • iamRoleiam_roleiamRoleiamRoleIamRole — the IAM Role for cross account log delivery.
toKinesisDataFirehoseDestination(deliveryStreamArn: string): FlowLogDestination // chainable@staticmethod def to_kinesis_data_firehose_destination(delivery_stream_arn: str) -> FlowLogDestinationpublic static FlowLogDestination toKinesisDataFirehoseDestination(String deliveryStreamArn)public static FlowLogDestination ToKinesisDataFirehoseDestination(string deliveryStreamArn)func ToKinesisDataFirehoseDestination(DeliveryStreamArn *string) FlowLogDestinationstaticdeprecated#
use `toFirehose`
1 parameter

Parameters

  • deliveryStreamArndelivery_stream_arndeliveryStreamArndeliveryStreamArnDeliveryStreamArn — the ARN of Amazon Data Firehose delivery stream to publish logs to.
toS3(bucket?: IBucket, keyPrefix?: string, options?: S3DestinationOptions): FlowLogDestination // chainable@staticmethod def to_s3(bucket: typing.Optional[IBucket] = None, key_prefix: typing.Optional[str] = None, options: typing.Optional[S3DestinationOptions] = None) -> FlowLogDestinationpublic static FlowLogDestination toS3(IBucket bucket, String keyPrefix, S3DestinationOptions options)public static FlowLogDestination ToS3(IBucket? bucket = null, string? keyPrefix = null, S3DestinationOptions? options = null)func ToS3(Bucket IBucket, KeyPrefix *string, Options S3DestinationOptions) FlowLogDestinationstatic#
Use S3 as the destination.
3 parameters

Parameters

  • bucketbucketbucketbucketBucket — optional s3 bucket to publish logs to.
  • keyPrefixkey_prefixkeyPrefixkeyPrefixKeyPrefix — optional prefix within the bucket to write logs to.
  • optionsoptionsoptionsoptionsOptions — additional s3 destination options.