Amazon EC2 usingPython (boto)
Infrastructure as a Service (IaaS)
2.
Introduction to AmazonEC2
• Amazon EC2 is an Infrastructure as a Service
(IaaS).
• Provides scalable, pay-as-you-go compute
capacity in the cloud.
• Offers virtual machines (instances) launched in
Amazon’s cloud.
• Accessible via web service APIs (like boto in
Python).
3.
Establishing Connection toEC2
• Use boto.ec2.connect_to_region function.
• Parameters:
- EC2 region
- AWS access key
- AWS secret key
• Creates a connection handle to EC2.
4.
Launching an EC2Instance
• Use conn.run_instances function.
• Parameters:
- AMI ID
- Instance Type
- EC2 Key Pair
- Security Group
• Returns a reservation object.
5.
Working with Instances
•Reservation contains instances.
• Access using reservation.instances.
• Update instance status using
instance.update().
6.
2)Amazon AutoScaling
• AmazonAutoScaling allows automatically
scaling of Amazon EC2 capacity up or out
according to user defined conditions.
• The Python code for creating an AutoScaling
group.
9.
3) Amazon S3
•Amazon S3 is an online cloud-based data
storage infrastructure for storing and
retrieving any amount of data.
• S3 provides highly reliable, scalable, fast, fully
redundant and affordable storage
infrastructure.
• The Python code for uploading a file to
Amazon S3 cloud storage.
Python for GoogleCloud Platform
1)Google Compute Engine (GAE):-
• Google Compute Engine provides scalable and
flexible virtual machine computing
capabilities in the cloud.
• The Python program for launching Google
Compute Engine instance.