pip install boto3
apt-get install python-boto
All supported services are accessed with a specific client.
2 types of clients:
The developper manipulates object that represent AWS entities
Instance
, SecurityGroup
, Bucket
…instance = ec2.Instance('<instance-id>')
instance.update()
Run instances:
Wait for an instance to be running
:
1instances[0].wait_until_running()
Common operations:
.start()
.stop()
.terminate()
.reboot()
.add_tag()
/.remove_tag()
.update()
A collection of instances resulting from a single run_instances()
call
.stop_all()
Get instances with a filter:
Create a load balancer:
Get existing load balancers:
1elb.describe_load_balancers()
Register an instance to the load balancer:
Deregister the instance:
Enable an availability zone:
Disable an availability zone: