src/flow_logs.js
function buildVpcFlowLogs({ name = 'S3FlowLog' } = {}) {
  return {
    [name]: {
      Type: 'AWS::EC2::FlowLog',
      DependsOn: 'LogBucketPolicy',
      Properties: {
        LogDestinationType: 's3',
        LogDestination: {
          'Fn::GetAtt': ['LogBucket', 'Arn'],
        },
        ResourceId: {
          Ref: 'VPC',
        },
        ResourceType: 'VPC',
        TrafficType: 'ALL',
      },
    },
  };
}
function buildVpcFlowLogs({ name = 'S3FlowLog' } = {}) {
  return {
    [name]: {
      Type: 'AWS::EC2::FlowLog',
      DependsOn: 'LogBucketPolicy',
      Properties: {
        LogDestinationType: 's3',
        LogDestination: {
          'Fn::GetAtt': ['LogBucket', 'Arn'],
        },
        ResourceId: {
          Ref: 'VPC',
        },
        ResourceType: 'VPC',
        TrafficType: 'ALL',
      },
    },
  };
}
function buildVpcFlowLogs ( { name = 'S3FlowLog' } = { } ) { return { [ name ] : { Type : 'AWS::EC2::FlowLog' , DependsOn : 'LogBucketPolicy' , Properties : { LogDestinationType : 's3' , LogDestination : { 'Fn::GetAtt' : [ 'LogBucket' , 'Arn' ] , } , ResourceId : { Ref : 'VPC' , } , ResourceType : 'VPC' , TrafficType : 'ALL' , } , } , } ; }
Build a VPC FlowLog definition that logs to an S3 bucket

@param {Object} params
@return {Object}
Build a VPC FlowLog definition that logs to an S3 bucket