Skip to content

Instantly share code, notes, and snippets.

@arbabnazar
Forked from garnaat/gist:4111114
Created February 11, 2016 11:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arbabnazar/8f36938e0adde6feb4f2 to your computer and use it in GitHub Desktop.
Save arbabnazar/8f36938e0adde6feb4f2 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