Skip to main content

A small example package for AWS: S3, EC2, CloudWatch

Project description

<h2>Project description</h2>
<p><a href="https://semver.org"><img alt="version" src="https://img.shields.io/badge/python-3.10-green" /></a>
<a href="https://semver.org"><img alt="version" src="https://img.shields.io/badge/boto%5Bs3%5D-1.26.87-green" /></a>
<a href="https://semver.org"><img alt="version" src="https://img.shields.io/badge/unittest-latest-green" /></a></p>
<h2>Custom package for AWS Services</h2>
<p><a href="https://setuptools.pypa.io/en/latest/userguide/declarative_config.html">SETUPTOOLS docs</a></p>
<h2>Getting Started</h2>
<p>Assuming that you have a supported version of Python installed, you can first set up your environment with:</p>
<p><code>shell
$ python -m venv .venv
...
$ . .venv/bin/activate</code></p>
<p>Then, you can install aws-service from PyPI with:
<code>shell
$ python -m pip install aws-service</code></p>
<p>or install from S3 source with:
<a href="https://blog.knoldus.com/packaging-hosting-python-repo-to-s3/">url</a></p>
<h2>Using AWS-service</h2>
<p>After installing aws-service</p>
<p>Next, set up credentials (in e.g. ~/.aws/credentials):</p>
<ul>
<li>aws_access_key_id = YOUR_KEY</li>
<li>aws_secret_access_key = YOUR_SECRET</li>
<li>Then, set up a default region (in e.g. ~/.aws/config):</li>
<li>region=us-east-1</li>
</ul>
<p>Other credentials configuration method can be found here</p>
<p>Then, from a Python interpreter:
```shell</p>
<blockquote>
<blockquote>
<blockquote>
<p>from aws_service.ec2_service import Ec2Service
from aws_service.s3_service import S3Service
from aws_service.cloudwatch_service import CloudwatchService
my_s3 = S3Service()
my_s3.create_new_bucket(bucket_name='my_new_bucket', region='eu-west-2')
my_s3.put_file( file_name='file_1', bucket='my_new_bucket', object_name='custom-name')
```</p>
</blockquote>
</blockquote>
</blockquote>
<h2>Availible modules:</h2>
<h3>Class S3Service (module s3_service)</h3>
<p>Functionality (availible methods):
* <a href="">create_new_bucket</a> - create new bucket
* <a href="">put_file</a> - upload file on s3
* <a href="">get_file</a> - download file from s3
* <a href="">check_exist</a> - check if file exists on s3</p>
<h3>Class Ec2Service (module ec2_service)</h3>
<p>Functionality (availible methods):
* <a href="">start_instance</a> - start ec2 instance
* <a href="">stop_instance</a> - stop instance
* <a href="">reboot_instance</a> - reboot instance
* <a href="">get_one_instance_status</a> - get one instance status
* <a href="">all_instances</a> - list all my ID's instances
* <a href="">create_my_instance</a> - create_instance</p>
<h3>Class CloudwatchService (module cloudwatch_service)</h3>
<p>Functionality (availible methods): </p>
<ul>
<li><a href="">get_cpu_usage_2</a> - get cpu usage, version 2</li>
<li><a href="">get_cpu_usage</a> - get cpu usage, version 1</li>
</ul>

Project details


Download files

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

Source Distribution

awsservice-0.0.3.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

awsservice-0.0.3-py3-none-any.whl (7.5 kB view hashes)

Uploaded Python 3

Supported by

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