Intorduction to AWS and Boto
-
Upload
mind-the-byte -
Category
Technology
-
view
811 -
download
2
description
Transcript of Intorduction to AWS and Boto
@chteijon@MindtheByte
Introduction to AMAZON WEB SERVICES and BOTO
2
@chteijon@MindtheByte
EC2: Elastic Compute Cloud
3
@chteijon@MindtheByte
EC2: Elastic Compute Cloud
KEY_ID='AGIAJPPYZBKTWGGX8AHS'KEY_SECRET='RwXTKmn7Ujfqmdsakcs/MRdf89sdSDffxU8sjRuD'REGION="us-west-1"
ec2 = boto.connect_ec2( KEY_ID, KEY_SECRET, region=REGION )
reservation = ec2.run_instances( image_id=AMI_ID, key_name=KEY_HANDLE, instance_type=INSTANCE_TYPE, security_groups = [ SGS ] )
Boto code:
4
@chteijon@MindtheByte
EC2: AMI (Amazon Machine Image)
5
@chteijon@MindtheByte
EC2: Spot instance
On demand price:
90%
discount!
6
@chteijon@MindtheByte
EC2: Spot instance
On demand price:
90%
discount!
ec2 = boto.connect_ec2( KEY_ID, KEY_SECRET, region=REGION )
ec2_conn.request_spot_instances(price=0.1,image_id=AMI,count=1,key_name=KEY_HANDLE,security_group_ids=[ SGS ] ,instance_type= "m1.xlarge",user_data=userdata )
Boto code:
7
@chteijon@MindtheByte
S3: Simple storage service
8
@chteijon@MindtheByte
S3: Simple storage service
# Connect to a bucket s3conn = boto.s3.connection.S3Connection( KEY_ID, KEY_SECRET )s3bucket = s3conn.get_bucket(“meetup_python_cloud”)
# Set a keys3key = boto.s3.key.Key(bucketconn)s3key.key = “data/file.txt”s3key.set_contents_from_string(“Some info”,policy=policy)
# Get a keys3key.key = “data/anotherfile.txt”value=s3key.get_contents_as_string()
# Delete a keyS3bucket.delete_key(s3key)
Boto code:
9
@chteijon@MindtheByte
Amazon S3
How does all this sum up?
10
@chteijon@MindtheByte
How does all this sum up?
Amazon S3
AMI
11
@chteijon@MindtheByte
Amazon S3
How does all this sum up?
12
@chteijon@MindtheByte
Amazon S3
How does all this sum up?
13
@chteijon@MindtheByte
Amazon S3
How does all this sum up?
14
@chteijon@MindtheByte
Amazon SQS: Simple Queue Service
Common alternatives to distribute jobs
Amazon RDS : Relational Dabatase Service
15
@chteijon@MindtheByte
Key advantatges of the cloud
●(almost) Infinite computational power available to speed up your computations
●Pay-as-you-go, no need of initial investment or hardware maintenance costs.