Chaos Toolkit Extension for AWS
Project description
# Chaos Toolkit Extension for AWS
[![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-aws.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-aws)
[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-aws.svg)](https://www.python.org/)
This project is a collection of [actions][] and [probes][], gathered as an
extension to the [Chaos Toolkit][chaostoolkit].
[actions]: http://chaostoolkit.org/reference/api/experiment/#action
[probes]: http://chaostoolkit.org/reference/api/experiment/#probe
[chaostoolkit]: http://chaostoolkit.org
## Install
This package requires Python 3.5+
To be used from your experiment, this package must be installed in the Python
environment where [chaostoolkit][] already lives.
```
$ pip install -U chaostoolkit-aws
```
## Usage
To use the probes and actions from this package, add the following to your
experiment file:
```json
{
"name": "stop-an-ec2-instance",
"provider": {
"type": "python",
"module": "chaosaws.ec2.actions",
"func": "stop_instance",
"arguments": {
"instance_id": "i-123456"
}
}
}
```
That's it!
Please explore the code to see existing probes and actions.
## Configuration
### Credentials
This extension uses the [boto3][] library under the hood. This library expects
that you have properly [configured][creds] your environment to connect and
authenticate with the AWS services.
[boto3]: https://boto3.readthedocs.io
[creds]: https://boto3.readthedocs.io/en/latest/guide/configuration.html
Generally speaking, there are two ways of doing this:
* you have [configured][creds] the environment where you will run the
experiment from (so either with a `~/.aws/credentials` or proper environment
variables)
* you explicitely pass the correct environment variables to the experiment
definition as follows:
```json
{
"secrets": {
"aws": {
"aws_access_key_id": "your key",
"aws_secret_access_key": "access key",
"aws_session_token": "token",
}
}
}
```
Note that the token is optional.
Then, use it as follows:
```json
{
"name": "stop-an-ec2-instance",
"provider": {
"type": "python",
"module": "chaosaws.ec2.actions",
"func": "stop_instance",
"secrets": ["aws"],
"arguments": {
"instance_id": "i-123456"
}
}
}
```
### Other AWS settings
In additon to the authentication credentials, you can configure the region
against which you want to use. At the top level of the experiment, add:
```json
{
"configuration": {
"aws_region": "us-east-1"
}
}
```
## Contribute
If you wish to contribute more functions to this package, you are more than
welcome to do so. Please, fork this project, make your changes following the
usual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for
review.
[pep8]: https://pycodestyle.readthedocs.io/en/latest/
The Chaos Toolkit projects require all contributors must sign a
[Developer Certificate of Origin][dco] on each commit they would like to merge
into the master branch of the repository. Please, make sure you can abide by
the rules of the DCO before submitting a PR.
[dco]: https://github.com/probot/dco#how-it-works
### Develop
If you wish to develop on this project, make sure to install the development
dependencies. But first, [create a virtual environment][venv] and then install
those dependencies.
[venv]: http://chaostoolkit.org/reference/usage/install/#create-a-virtual-environment
```console
$ pip install -r requirements-dev.txt -r requirements.txt
```
Then, point your environment to this directory:
```console
$ python setup.py develop
```
Now, you can edit the files and they will be automatically be seen by your
environment, even when running from the `chaos` command locally.
### Test
To run the tests for the project execute the following:
```
$ pytest
```
[![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-aws.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-aws)
[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-aws.svg)](https://www.python.org/)
This project is a collection of [actions][] and [probes][], gathered as an
extension to the [Chaos Toolkit][chaostoolkit].
[actions]: http://chaostoolkit.org/reference/api/experiment/#action
[probes]: http://chaostoolkit.org/reference/api/experiment/#probe
[chaostoolkit]: http://chaostoolkit.org
## Install
This package requires Python 3.5+
To be used from your experiment, this package must be installed in the Python
environment where [chaostoolkit][] already lives.
```
$ pip install -U chaostoolkit-aws
```
## Usage
To use the probes and actions from this package, add the following to your
experiment file:
```json
{
"name": "stop-an-ec2-instance",
"provider": {
"type": "python",
"module": "chaosaws.ec2.actions",
"func": "stop_instance",
"arguments": {
"instance_id": "i-123456"
}
}
}
```
That's it!
Please explore the code to see existing probes and actions.
## Configuration
### Credentials
This extension uses the [boto3][] library under the hood. This library expects
that you have properly [configured][creds] your environment to connect and
authenticate with the AWS services.
[boto3]: https://boto3.readthedocs.io
[creds]: https://boto3.readthedocs.io/en/latest/guide/configuration.html
Generally speaking, there are two ways of doing this:
* you have [configured][creds] the environment where you will run the
experiment from (so either with a `~/.aws/credentials` or proper environment
variables)
* you explicitely pass the correct environment variables to the experiment
definition as follows:
```json
{
"secrets": {
"aws": {
"aws_access_key_id": "your key",
"aws_secret_access_key": "access key",
"aws_session_token": "token",
}
}
}
```
Note that the token is optional.
Then, use it as follows:
```json
{
"name": "stop-an-ec2-instance",
"provider": {
"type": "python",
"module": "chaosaws.ec2.actions",
"func": "stop_instance",
"secrets": ["aws"],
"arguments": {
"instance_id": "i-123456"
}
}
}
```
### Other AWS settings
In additon to the authentication credentials, you can configure the region
against which you want to use. At the top level of the experiment, add:
```json
{
"configuration": {
"aws_region": "us-east-1"
}
}
```
## Contribute
If you wish to contribute more functions to this package, you are more than
welcome to do so. Please, fork this project, make your changes following the
usual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for
review.
[pep8]: https://pycodestyle.readthedocs.io/en/latest/
The Chaos Toolkit projects require all contributors must sign a
[Developer Certificate of Origin][dco] on each commit they would like to merge
into the master branch of the repository. Please, make sure you can abide by
the rules of the DCO before submitting a PR.
[dco]: https://github.com/probot/dco#how-it-works
### Develop
If you wish to develop on this project, make sure to install the development
dependencies. But first, [create a virtual environment][venv] and then install
those dependencies.
[venv]: http://chaostoolkit.org/reference/usage/install/#create-a-virtual-environment
```console
$ pip install -r requirements-dev.txt -r requirements.txt
```
Then, point your environment to this directory:
```console
$ python setup.py develop
```
Now, you can edit the files and they will be automatically be seen by your
environment, even when running from the `chaos` command locally.
### Test
To run the tests for the project execute the following:
```
$ pytest
```
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file chaostoolkit-aws-0.1.0.tar.gz
.
File metadata
- Download URL: chaostoolkit-aws-0.1.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 16562a1fb12d95a70b8a2a8ba7cbe8841e60fc87b02259d9ac361b65866abfc3 |
|
MD5 | 244d70fe885363f372b9e9e24581bba5 |
|
BLAKE2b-256 | e4a51308fb66302f7edab60448233e606452e50a218fe3cd2d2e941a0af232f4 |
File details
Details for the file chaostoolkit_aws-0.1.0-py3-none-any.whl
.
File metadata
- Download URL: chaostoolkit_aws-0.1.0-py3-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d4e6e69e5d296aa39f5cf500095b8e66660578bfb1d9ee8c5bd7c5f740f50de |
|
MD5 | cad274b188e1dc462981f61cf08646be |
|
BLAKE2b-256 | 46653f2d097027ba0ca45ce8f7fbe4290d48825e31ddb8f37fd4aee02a84f021 |