Class FlowLogDestination
The destination type for the flow log.
Namespace: Amazon.CDK.AWS.EC2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class FlowLogDestination : DeputyBase
Syntax (vb)
Public MustInherit Class FlowLogDestination Inherits DeputyBase
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
| FlowLogDestination() | The destination type for the flow log. |
Methods
| Bind(Construct, FlowLog) | Generates a flow log destination configuration. |
| ToCloudWatchLogs(ILogGroup?, IRole?) | Use CloudWatch logs as the destination. |
| ToKinesisDataFirehoseDestination(string) | Use Amazon Data Firehose as the destination. |
| ToS3(IBucket?, string?, IS3DestinationOptions?) | Use S3 as the destination. |
Constructors
FlowLogDestination()
The destination type for the flow log.
protected FlowLogDestination()
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)
});
Methods
Bind(Construct, FlowLog)
Generates a flow log destination configuration.
public abstract IFlowLogDestinationConfig Bind(Construct scope, FlowLog flowLog)
Parameters
- scope Construct
- flowLog FlowLog
Returns
Remarks
ExampleMetadata: infused
ToCloudWatchLogs(ILogGroup?, IRole?)
Use CloudWatch logs as the destination.
public static FlowLogDestination ToCloudWatchLogs(ILogGroup? logGroup = null, IRole? iamRole = null)
Parameters
Returns
Remarks
ExampleMetadata: infused
ToKinesisDataFirehoseDestination(string)
Use Amazon Data Firehose as the destination.
public static FlowLogDestination ToKinesisDataFirehoseDestination(string deliveryStreamArn)
Parameters
- deliveryStreamArn string
the ARN of Amazon Data Firehose delivery stream to publish logs to.
Returns
Remarks
ExampleMetadata: infused
ToS3(IBucket?, string?, IS3DestinationOptions?)
Use S3 as the destination.
public static FlowLogDestination ToS3(IBucket? bucket = null, string? keyPrefix = null, IS3DestinationOptions? options = null)
Parameters
- bucket IBucket
optional s3 bucket to publish logs to.
- keyPrefix string
optional prefix within the bucket to write logs to.
- options IS3DestinationOptions
additional s3 destination options.
Returns
Remarks
ExampleMetadata: infused