This repo contains Python code examples on AWS (Amazon Web Services).
These examples show how to use Python 3 and Boto 3 in order to manage Amazon services on AWS. These use Resource API (high-level) and Client API (low-level) of Boto 3.
Boto is the AWS (Amazon Web Services) SDK for Python, which allows Python developers to write software that makes use of Amazon services like EC2 and S3. Boto provides an easy to use, object-oriented API as well as low-level direct service access.
Boto 3 offers two different styles of API:
- Resource API (high-level): It provides an object-oriented abstraction on top (object.delete(), object.put(), etc.).
- Client API (low-level): It maps directly to the underlying RPC-style service operations (put_object, delete_object, etc.).
You must have an AWS (Amazon Web Services) account.
The code for the samples is contained in individual folders on this repository.
For instructions on running the code, please consult the README in each folder.
This is the list of examples:
Compute - Amazon EC2:
- awsec2instances-capi - AWS EC2 instances (Client API): Example of how to handle AWS EC2 instances using the Client API (low-level) of Boto 3.
- awsec2instances-rapi - AWS EC2 instances (Resource API): Example of how to handle AWS EC2 instances using the Resource API (high-level) of Boto 3.
Compute - AWS Lambda:
- awslambdahello - AWS Lambda Function Hello World: Example of how to handle an AWS simple Lambda function and a text input.
- awslambdahello2 - AWS Lambda Function other Hello World: Example of how to handle an AWS simple Lambda function and a JSON input.
Storage - Amazon S3:
-  Using the Client API (low-level) of Boto 3: - awss3create-capi - AWS S3 Create (Client API): Example of how to handle S3 buckets and create a new S3 bucket using the Client API (low-level) of Boto 3.
- awss3delete-capi - AWS S3 Delete (Client API): Example of how to handle S3 buckets and delete a S3 bucket using the Client API (low-level) of Boto 3.
- awss3list-capi - AWS S3 List (Client API): Example of how to handle S3 buckets and list information about objects in a S3 bucket using the Client API (low-level) of Boto 3.
- awss3listall-capi - AWS S3 List All (Client API): Example of how to handle S3 buckets and list information about all S3 buckets and the objects they contain using the Client API (low-level) of Boto 3.
- awss3upload-capi - AWS S3 List (Client API): Example of how to handle S3 buckets and upload a local file to a S3 bucket using the Client API (low-level) of Boto 3.
- awss3download-capi - AWS S3 List (Client API): Example of how to handle S3 buckets and download an object from a S3 bucket to a local file using the Client API (low-level) of Boto 3.
- awss3copy-capi - AWS S3 Copy (Client API): Example of how to handle S3 buckets and copy an object from a S3 bucket to another S3 bucket using the Client API (low-level) of Boto 3.
- awss3move-capi - AWS S3 Move (Client API): Example of how to handle S3 buckets and move an object from a S3 bucket to another S3 bucket using the Client API (low-level) of Boto 3.
 
-  Using the Resource API (high-level) of Boto 3: - awss3create-rapi - AWS S3 Create (Resource API): Example of how to handle S3 buckets and create a new S3 bucket using the Resource API (high-level) of Boto 3.
- awss3delete-rapi - AWS S3 Delete (Resource API): Example of how to handle S3 buckets and delete a S3 bucket using the Resource API (high-level) of Boto 3.
- awss3list-rapi - AWS S3 List (Resource API): Example of how to handle S3 buckets and list information about objects in a S3 bucket using the Resource API (high-level) of Boto 3.
- awss3listall-rapi - AWS S3 List All (Resource API): Example of how to handle S3 buckets and list information about all S3 buckets and the objects they contain using the Resource API (high-level) of Boto 3.
- awss3upload-rapi - AWS S3 List (Resource API): Example of how to handle S3 buckets and upload a local file to a S3 bucket using the Resource API (high-level) of Boto 3.
- awss3download-rapi - AWS S3 List (Resource API): Example of how to handle S3 buckets and download an object from a S3 bucket to a local file using the Resource API (high-level) of Boto 3.
- awss3copy-rapi - AWS S3 Copy (Resource API): Example of how to handle S3 buckets and copy an object from a S3 bucket to another S3 bucket using the Resource API (high-level) of Boto 3.
- awss3move-rapi - AWS S3 Move (Resource API): Example of how to handle S3 buckets and move an object from a S3 bucket to another S3 bucket using the Resource API (high-level) of Boto 3.
 
This code is released under the MIT License. See LICENSE file.