Skip to main content
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

Metadata

Release files for ec2-task 0.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ec2-task 0.9
File Size Uploaded
ec2-task-0.9.tar.gz 3.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ec2-task 0.9
File Interpreter ABI Platform
ec2_task-0.9-py3-none-any.whl Python 3 none any Details

Total release size: 7.0 kB

Release files / ec2-task-0.9.tar.gz

Download URL ec2-task-0.9.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
868481b073a0914fea6b523524a42b6b3001192eb00c62bc9bfe246d21eabff6
BLAKE2b-256 checksum
How to use checksums
f85f4cb4290f06d268da947b71e9ee06924a76e8ed5d6efe4c8734d253ff47d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ec2_task-0.9-py3-none-any.whl

Download URL ec2_task-0.9-py3-none-any.whl
Size 3.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
986776628a7b5e4e0630f477c925ce56458149d007e4f503789df00a45b3ae27
BLAKE2b-256 checksum
How to use checksums
6cc280be64edf280f287f7998675cea20e0bd2089215e65eeb31f7a676802285
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.9 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page