This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a new key in an S3 bucket and specify you want to use | |
# the Reduced Redundancy Storage (RRS) option of S3 | |
import boto | |
# create connection to S3 service | |
s3 = boto.connect_s3() | |
# lookup my existing bucket | |
bucket = s3.lookup('mybucket') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Copy an existing key in an S3 bucket and specify you want to use | |
# the Reduced Redundancy Storage (RRS) option of S3 for the new copy | |
import boto | |
# create connection to S3 service | |
s3 = boto.connect_s3() | |
# lookup my existing bucket | |
bucket = s3.lookup('mybucket') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Convert an existing key in an S3 bucket that uses the STANDARD storage class | |
# to one using the REDUCED_REDUNDANCY storage class. This uses the S3 COPY | |
# command to copy the key back to the same bucket. The ACL is preserved. | |
import boto | |
# create connection to S3 service | |
s3 = boto.connect_s3() | |
# lookup my existing bucket | |
bucket = s3.lookup('mybucket') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto | |
from boto.ec2.regioninfo import RegionInfo | |
reg = RegionInfo(name='ECC', endpoint='ecc.eucalyptus.com') | |
c = boto.connect_ec2(aws_access_key_id='<my euca access key>', aws_secret_access_key='<my euca secret key>', region=reg, port=8773, path='/services/Eucalyptus') | |
c.get_all_images() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
IAM boto examples: | |
In this example we create a group that provides access | |
to all EC2 and S3 resources and actions and then add a | |
user to that group. | |
""" | |
import boto | |
# | |
# First create a connection to the IAM service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
IAM boto examples: | |
In this example, we show how to create a group | |
for administrators who have full access to IAM | |
functionality but no access to other AWS services. | |
""" | |
import boto | |
# | |
# First create a connection to the IAM service |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
IAM boto examples: | |
In this example, we create a group that allows read-only access | |
to a single SimpleDB domain. | |
""" | |
import boto | |
# | |
# First create a connection to the IAM service | |
# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/"> | |
<ListGroupsResult> | |
<IsTruncated>false</IsTruncated> | |
<Groups> | |
<member> | |
<GroupId>AGPAJ3O3FIPZF4F5NUDGO</GroupId> | |
<GroupName>Admin</GroupName> | |
<Path>/</Path> | |
<Arn>arn:aws:iam::963068290131:group/Admin</Arn> | |
</member> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{u'list_groups_response': {u'list_groups_result': {u'groups': [{u'arn': u'arn:aws:iam::963068290131:group/Admin', | |
u'group_id': u'AGPAJ3O3FIPZF4F5NUDGO', | |
u'group_name': u'Admin', | |
u'path': u'/'}, | |
{u'arn': u'arn:aws:iam::963068290131:group/EC2-S3-Users', | |
u'group_id': u'AGPAJOINL5IR3W2DHU4MU', | |
u'group_name': u'EC2-S3-Users', | |
u'path': u'/'}, | |
{u'arn': u'arn:aws:iam::963068290131:group/SDB-ReadOnly', | |
u'group_id': u'AGPAIIKY4E53EEXTBKKY6', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> r = iam.get_all_groups() | |
>>> r.groups | |
[{u'arn': u'arn:aws:iam::963068290131:group/Admin', | |
u'group_id': u'AGPAJ3O3FIPZF4F5NUDGO', | |
u'group_name': u'Admin', | |
u'path': u'/'}, | |
{u'arn': u'arn:aws:iam::963068290131:group/EC2-S3-Users', | |
u'group_id': u'AGPAJOINL5IR3W2DHU4MU', | |
u'group_name': u'EC2-S3-Users', | |
u'path': u'/'}, |
OlderNewer