Skip to content

Instantly share code, notes, and snippets.

@garnaat
Created November 19, 2012 14:59
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save garnaat/4111114 to your computer and use it in GitHub Desktop.
Save garnaat/4111114 to your computer and use it in GitHub Desktop.
Set up simple lifecycle config for a bucket
from boto.s3.lifecycle import Lifecycle, Transition, Rule
import boto
c = boto.connect_s3()
b = c.lookup('mybucket')
t = Transition(days=0, storage_class='GLACIER')
r = Rule('foo rule', 'foo', 'Enabled', 1, t)
l = Lifecycle()
l.append(r)
b.configure_lifecycle(t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment