Skip to main content

A python module to manage AWS EC2 instances.

Project description

Copyright (c) 2018 Dr. Shubham Dipt

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Description: ec2_task
=================

Enabling easy start, running of tasks and stopping of EC2 instances in AWS.

Requirements
------------

* Python3 (>=3.4)


### Usage

$ pip install ec2-task

Add your AWS credentials and details of your EC2 instance in config file e.g. aws_config.ini.
The aws_config file should have the following:

[aws]
AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY
INSTANCE_ID=
REGION=
KEY_PATH=<path to aws key file for ssh>
USER=<user e.g. ubuntu>

List of tasks should be added as a separate file (containing mainly shell commands) e.g. task.sh.

>>> from ec2_task import connect_ec2
>>> ec2_instance = connect_ec2.Ec2Instance(config_file="aws_config.ini") # include the path of your aws config file
>>> ec2_instance.start_instance()
>>> ec2_instance.run_task(task_file="task.sh") # include the path of your task file
>>> ec2_instance.stop_instance()

Check example in the Github repository.

Platform: any
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent

Project details


Release history Release notifications | RSS feed

This version

0.9

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ec2-task-0.9.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ec2_task-0.9-py3-none-any.whl (3.6 kB view details)

Uploaded Python 3

File details

Details for the file ec2-task-0.9.tar.gz.

File metadata

  • Download URL: ec2-task-0.9.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ec2-task-0.9.tar.gz
Algorithm Hash digest
SHA256 868481b073a0914fea6b523524a42b6b3001192eb00c62bc9bfe246d21eabff6
MD5 2582d668f790e52679972c4aad22a17a
BLAKE2b-256 f85f4cb4290f06d268da947b71e9ee06924a76e8ed5d6efe4c8734d253ff47d8

See more details on using hashes here.

File details

Details for the file ec2_task-0.9-py3-none-any.whl.

File metadata

File hashes

Hashes for ec2_task-0.9-py3-none-any.whl
Algorithm Hash digest
SHA256 986776628a7b5e4e0630f477c925ce56458149d007e4f503789df00a45b3ae27
MD5 8aa18cbb21bd03cbf2361f8fc9319d9d
BLAKE2b-256 6cc280be64edf280f287f7998675cea20e0bd2089215e65eeb31f7a676802285

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page