GithubHelp home page GithubHelp logo

s3life's Introduction

s3life

๐ŸŒ‡ As of January 2020, this module is deprecated. It is provided as-is, with no warranty. We are not accepting new bugfixes or feature requests at this time.


Helper for managing S3 lifecycle policies.

CLI Usage

s3life read <bucket> [-j | --json]

Read the Lifecycle Configuration for the specified bucket. The --json flag prints the configuration as JSON. Default behavior is to print rules as simple strings.

s3life put-rule <bucket> <rule>

Add or overwrite a rule in a bucket. If no ID is specified, a new rule will always be added. Specify an ID as part of the rule in order to update an existing rule.

s3life remove-rule <bucket> <ruleid>

Remove a rule from a bucket by specifying its ID.

Rules as strings

The CLI tool allows you to read and specify Lifecycle Configuration rules as strings. The format of the string indicates the rule's details.

Multipart Upload Expiration:

# expire multipart uploads older than 7 days bucket-wide
mpu * 7d

Object & Version Expiration:

# expire objects under `temp/` after 1 day
expire temp/ 1d

# expire objects under `temp/` on March 20th, 2016
expire temp/ 1458432000000

# expire non-current versions under `temp/` after 1 day
expire version temp/ 1d

# expire deleted object markers under `temp/` with no non-current versions
expire tombstones temp/

Storage transitions:

# move objects to infrequent-access after 30 days
transition * ia 30d

# move objects to glacier after 2 days
transition * glacier 2d

# move non-current versions to glacier after 1 day
transition version * glacier 1d

Complex rules. All actions must share the same prefix:

# specify multiple transitions in one rule
transition * ia 30d, transition * glacier 60d

# transitions and expiration
transition * ia 30d, transition * glacier 60d, expire 100d

Rule with an ID specified:

# ID `abc`
abc: expire * 1d

Testing

Running tests requires authentication. Environment must be configured for access to interact with Lifecycle Configuration on Mapbox buckets.

s3life's People

Contributors

rclark 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.