Giter VIP home page Giter VIP logo

aws-cloudfront-log-expire's Introduction

AWS CloudFront log expire

Processes an S3 bucket configured as a CloudFront distribution access log target - removing all access log objects prior to a specified expiry date or days.

  • For safety, will only consider objects for deletion that meet the CloudFront access log naming format.
  • By default will only simulate the processing of logs before actual removal from S3 (providing the --commit argument will enable actual deletes).
  • Can optionally display script processing output back to the users terminal.
  • Requires Boto 2.
  • AWS credentials expected to be provided either via shell environment variables or the usual places Boto will check.

Usage

usage: cloudfrontlogexpire.py [-h] --s3-bucket-name NAME
                              [--s3-bucket-log-prefix PREFIX]
                              [--expire-before YYYY-MM-DD]
                              [--expire-days DAY_COUNT] [--progress]
                              [--commit]

Remove AWS CloudFront access log archives from an S3 bucket before a given
date or number of expiry days.

optional arguments:
  -h, --help            show this help message and exit
  --s3-bucket-name NAME
                        S3 bucket holding CloudFront access log archives
  --s3-bucket-log-prefix PREFIX
                        S3 bucket path prefix to access log archives
  --expire-before YYYY-MM-DD
                        expire log archives before given date
  --expire-days DAY_COUNT
                        expire log archives older than X number of days
  --progress            display progress of access log archive processing
  --commit              delete access log archives, otherwise simulation only

Notes:

  • Must specify one of --expire-before or --expire-days - not both.
  • Script will never delete bucket objects unless the --commit argument is provided.

aws-cloudfront-log-expire's People

Contributors

magnetikonline avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.