Skip to content

Instantly share code, notes, and snippets.

@sayanchowdhury
Last active March 1, 2017 18:39
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 sayanchowdhury/ffbc1f847ba84d47a454e4fd3cc603fd to your computer and use it in GitHub Desktop.
Save sayanchowdhury/ffbc1f847ba84d47a454e4fd3cc603fd to your computer and use it in GitHub Desktop.
import boto.ec2
import os
env = os.environ
aws_access_key_id = os.environ.get('AWS_ACCESS_KEY')
aws_secret_access_key = os.environ.get('AWS_SECRET_ACCESS_KEY')
REGIONS = (
'us-east-1',
'us-west-2',
'us-west-1',
'eu-west-1',
'eu-central-1',
'ap-south-1',
'ap-southeast-1',
'ap-northeast-1',
'ap-northeast-2',
'ap-southeast-2',
'sa-east-1',
)
failed = set()
for region in REGIONS:
conn = boto.ec2.connect_to_region(
region,
aws_access_key_id=aws_access_key_id,
aws_secret_access_key=aws_secret_access_key)
snapshots = conn.get_all_snapshots(owner='self')
for snapshot in snapshots:
snap_id = snapshot.id
conn.modify_snapshot_attribute(
snap_id,
operation="add", attribute='createVolumePermission',
groups=["all"]
)
@dustymabe
Copy link

dustymabe commented Mar 1, 2017

failed = set()

What is this used for?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment