Class FlowLog

All Implemented Interfaces:
IConstruct, IDependable, IResource, IFlowLog,, software.constructs.IConstruct

@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)", date="2023-06-19T16:30:39.309Z") @Stability(Stable) public class FlowLog extends Resource implements IFlowLog
A VPC flow log.


 Vpc vpc;
 LogGroup logGroup = new LogGroup(this, "MyCustomLogGroup");
 Role role = Role.Builder.create(this, "MyCustomRole")
         .assumedBy(new ServicePrincipal(""))
 FlowLog.Builder.create(this, "FlowLog")
         .destination(FlowLogDestination.toCloudWatchLogs(logGroup, role))
  • Constructor Details

    • FlowLog

      protected FlowLog( objRef)
    • FlowLog

      protected FlowLog( initializationMode)
    • FlowLog

      @Stability(Stable) public FlowLog(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull FlowLogProps props)
      scope - This parameter is required.
      id - This parameter is required.
      props - This parameter is required.
  • Method Details

    • fromFlowLogId

      @Stability(Stable) @NotNull public static IFlowLog fromFlowLogId(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String flowLogId)
      Import a Flow Log by it's Id.

      scope - This parameter is required.
      id - This parameter is required.
      flowLogId - This parameter is required.
    • getFlowLogId

      @Stability(Stable) @NotNull public String getFlowLogId()
      The Id of the VPC Flow Log.
      Specified by:
      getFlowLogId in interface IFlowLog
    • getBucket

      @Stability(Stable) @Nullable public IBucket getBucket()
      The S3 bucket to publish flow logs to.
    • getIamRole

      @Stability(Stable) @Nullable public IRole getIamRole()
      The iam role used to publish logs to CloudWatch.
    • getKeyPrefix

      @Stability(Stable) @Nullable public String getKeyPrefix()
      S3 bucket key prefix to publish the flow logs under.
    • getLogGroup

      @Stability(Stable) @Nullable public ILogGroup getLogGroup()
      The CloudWatch Logs LogGroup to publish flow logs to.