src/flow_logs.js
function buildLogBucket() {
  return {
    LogBucket: {
      Type: 'AWS::S3::Bucket',
      DeletionPolicy: 'Retain',
      Properties: {
        AccessControl: 'LogDeliveryWrite',
        BucketEncryption: {
          ServerSideEncryptionConfiguration: [
            {
              ServerSideEncryptionByDefault: {
                SSEAlgorithm: 'AES256',
              },
            },
          ],
        },
        PublicAccessBlockConfiguration: {
          BlockPublicAcls: true,
          BlockPublicPolicy: true,
          IgnorePublicAcls: true,
          RestrictPublicBuckets: true,
        },
        Tags: [
          {
            Key: 'Name',
            Value: {
              'Fn::Join': [' ', [{ Ref: 'AWS::StackName' }, 'Logs']],
            },
          },
        ],
      },
    },
  };
}
function buildLogBucket() {
  return {
    LogBucket: {
      Type: 'AWS::S3::Bucket',
      DeletionPolicy: 'Retain',
      Properties: {
        AccessControl: 'LogDeliveryWrite',
        BucketEncryption: {
          ServerSideEncryptionConfiguration: [
            {
              ServerSideEncryptionByDefault: {
                SSEAlgorithm: 'AES256',
              },
            },
          ],
        },
        PublicAccessBlockConfiguration: {
          BlockPublicAcls: true,
          BlockPublicPolicy: true,
          IgnorePublicAcls: true,
          RestrictPublicBuckets: true,
        },
        Tags: [
          {
            Key: 'Name',
            Value: {
              'Fn::Join': [' ', [{ Ref: 'AWS::StackName' }, 'Logs']],
            },
          },
        ],
      },
    },
  };
}
function buildLogBucket ( ) { return { LogBucket : { Type : 'AWS::S3::Bucket' , DeletionPolicy : 'Retain' , Properties : { AccessControl : 'LogDeliveryWrite' , BucketEncryption : { ServerSideEncryptionConfiguration : [ { ServerSideEncryptionByDefault : { SSEAlgorithm : 'AES256' , } , } , ] , } , PublicAccessBlockConfiguration : { BlockPublicAcls : true , BlockPublicPolicy : true , IgnorePublicAcls : true , RestrictPublicBuckets : true , } , Tags : [ { Key : 'Name' , Value : { 'Fn::Join' : [ ' ' , [ { Ref : 'AWS::StackName' } , 'Logs' ] ] , } , } , ] , } , } , } ; }
Build an S3 bucket for logging

@return {Object}
Build an S3 bucket for logging