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
Hashes for localstack-extension-outages-0.5.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a95389a7b5c501f7210f039a3d8abf433077bbba942e0d02ebae4c548536786 |
|
MD5 | 78df2490f9d0a1e7898b49937c9e81b1 |
|
BLAKE2b-256 | 525ca3226f14dfaeebe739eda529617c77d90f8ec994131bc6919a393d2a3845 |