1. awsec2tools

1.1. awsec2tools.AwsEC2Tools

class awsec2tools.AwsEC2Tools(region, aws_access_key_id, aws_secret_access_key)[source]

Bases: boto.ec2.connection.EC2Connection

AWS tools

create_snapshots(instances_id=None, dry_run=False)[source]

Create a snapshot with running instances

Parameters:
  • instances_id (str) – instances id.
  • dry_run (bool) – dry_run.
Returns:

snapshot id

Return type:

str

get_all_instances()[source]

Get all on running instances

Return type:list
Returns:A list of boto.ec2.instance.Reservation
get_spot_price_history()[source]

Get spot instances history

Return type:list
Returns:A list tuples containing price and timestamp.

Todo

  • Remove availability_zone, instance_type hard code.
register_image(snapshot_id, root_device_name, delete_on_termination=False)[source]

Register a AMI

Parameters:
  • snapshot_id (str) – snapshot id
  • root_device_name (path) – path of root device
  • delete_on_termination (bool) – delete on termination
Return type:

string

Returns:

The new image id

Todo

  • Remove kernel_id hard code.
run_from_image(image_id)[source]

Create instance from image in VPC

Parameters:image_id (str) – image id.
Return type:boto.ec2.instance.Reservation
Returns:The boto.ec2.instance.Reservation associated with the request for machines

Todo

  • Remove subnet_id, security_group_ids hard code.
run_spot_instances_from_image(image_id, price)[source]

Create spot instances from image_id

Parameters:
  • image_id (str) – image id.
  • price (str) – max limit price.
Return type:

boto.ec2.spotinstancerequest.SpotInstanceRequest

Returns:

The boto.ec2.spotinstancerequest.SpotInstanceRequest associated with the request for machines.

Todo

  • Remove network_interfaces hard code and using setting.

1.2. awsec2tools.AwsEC2MetaData

class awsec2tools.AwsEC2MetaData[source]

Show EC2 user/meta data

get(data='')[source]

get meta-data info

Parameters:data (str) – data name.
Return type:str
Returns:instance data.
keys()[source]

Show all meta data keys

Return type:str
Returns:all meta data key name.

Table Of Contents

Previous topic

Welcome to aws-tools’s documentation!

Next topic

2. awssestools

This Page