LocalStack Extension: Outages
Project description
LocalStack Outages Extension
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 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) 2023 LocalStack
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
Hashes for localstack-extension-outages-0.4.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09740cc2f65df612f0a327026c375cfa5f14a5d574f34b95fe68517f910eeb1c |
|
MD5 | 8f48a46166a54b4e09f40a1975527623 |
|
BLAKE2b-256 | 7ad98d985d2ec2e9e049d4168ade4901e4f07388a3243023090af87d3b2f0ccb |