LocalStack Extension: Outages
Project description
LocalStack Outages Extension
[!NOTE] LocalStack Outages Extension is no longer supported. Please migrate to LocalStack Chaos API.
This LocalStack extension can simulate outages for any AWS region or service.
Prerequisites
- LocalStack Pro
- Docker
- Python
Installation
Before installing the extension, make sure you're logged into LocalStack. If not, log in using the following command:
localstack auth login
You can then install this extension using the following command:
localstack extensions install localstack-extension-outages
Configuration
The extension is configured using an API endpoint.
The configuration consists of a list of rules which are greedily evaluated.
Each rule consists of two attributes: service name and region.
You may use the *
wildcard in either of these attributes.
Start an outage for a list of specified service/region pairs using a POST request like follows:
curl --location --request POST 'http://outages.localhost.localstack.cloud:4566/outages' \
--header 'Content-Type: application/json' \
--data '
[
{
"service": "kms",
"region": "us-east-1"
},
{
"service": "s3",
"region": "us-*"
},
{
"service": "lambda",
"region": "*"
}
]'
When activated, API calls to affected services and regions will return a HTTP 503 Service Unavailable error.
In the above example, following are affected:
- KMS in
us-east-1
- S3 in all US regions (
us-east-1
,us-east-2
,us-west-1
,us-west-2
,us-gov-east-1
andus-gov-west-1
) - Lambda in all regions
Outages may be stopped by using empty list in the configuration. The following request will clear the current configuration:
curl --location --request POST 'http://outages.localhost.localstack.cloud:4566/outages' \
--header 'Content-Type: application/json' \
--data '[]'
To retrieve the current configuration, make the following GET call:
curl --location --request GET 'http://outages.localhost.localstack.cloud:4566/outages'
To add a new service/region rule pair to the configuration, make a PATCH call as follows:
curl --location --request PATCH 'http://outages.localhost.localstack.cloud:4566/outages' \
--header 'Content-Type: application/json' \
--data '[{"service": "transcribe", "region": "us-west-1"}]'
To remove a service/region rule pair from the configuration, make a DELETE call as follows:
curl --location --request DELETE 'http://outages.localhost.localstack.cloud:4566/outages' \
--header 'Content-Type: application/json' \
--data '[{"service": "transcribe", "region": "us-west-1"}]'
License
(c) 2024 LocalStack
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
File details
Details for the file localstack-extension-outages-0.6.0.tar.gz
.
File metadata
- Download URL: localstack-extension-outages-0.6.0.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 colorama/0.4.4 importlib-metadata/4.6.4 keyring/23.5.0 pkginfo/1.8.2 readme-renderer/34.0 requests-toolbelt/0.9.1 requests/2.25.1 rfc3986/1.5.0 tqdm/4.57.0 urllib3/1.26.5 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f44c210630a9e5fd182f8ce1ed97f7c508ea555bca77bcf16f12d9e8918f2075 |
|
MD5 | 48eb2c835de1367b99cd01e2cfcc1142 |
|
BLAKE2b-256 | 4fa6dd54c71f9c3d557d66bc57b37adcb313d38b2c2ac2f1bfc41bf524ca583c |