[Update] Amazon Aurora DSQL fault actions have been added to AWS Fault Injection Service (FIS)
I'm Iwasa.
AWS FIS provides various fault actions for different services.
In this morning's update, Amazon Aurora DSQL actions made their first appearance.
The details of the newly added action can be found in the official documentation under aws:dsql:cluster-connection-failure
.
This allows you to create connection failures in an Aurora DSQL cluster for a specified period, and you can also specify the percentage of failures to create a mixed environment of normal and abnormal users.
Creating an experiment template in AWS FIS
The newly added action type is as follows.
A DSQL category has also been added.
The action parameters you can specify are Duration
for the failure period and Percentage
for the proportion of failures.
For example, in the following case, connection failures will occur 50% of the time.
For the target, you specify an Aurora DSQL cluster. By the way, I'm trying this in the Tokyo region.
## Experiment in Progress
This time, we will connect to the DSQL cluster from CloudShell.
Before starting the experiment, we confirm the connection works as shown below.
Let's start the experiment.
If we try to connect from CloudShell to the DSQL cluster as before...
~ $ dsql-connect --hostname 2fs4kgkzq2rf3vmokhhpbqhruy.dsql.ap-northeast-1.on.aws --region ap-northeast-1 --database postgres --username admin
psql: error: connection to server at "2fs4kgkzq2rf3vmokhhpbqhruy.dsql.ap-northeast-1.on.aws" (18.99.75.128), port 5432 failed: FATAL: unable to accept connection
DETAIL: Session Id: mztduazocwxotqz2slsmptuxhm
HINT: Ongoing AWS Fault Injection Service (FIS) experiment
Error: Failed to connect to the database
~ $
The connection failed.
A hint is displayed: HINT: Ongoing AWS Fault Injection Service (FIS) experiment
.
Also, while the connection failed above, since we specified 50 for the Percentage
parameter this time, roughly 1 out of 2 connection attempts will succeed.
If we try connecting again, even though the experiment is still running, it succeeds as follows:
~ $ dsql-connect --hostname 2fs4kgkzq2rf3vmokhhpbqhruy.dsql.ap-northeast-1.on.aws --region ap-northeast-1 --database postgres --username admin
postgres=>
Conclusion
Today, we tried out the newly added fault action for Amazon Aurora DSQL in AWS Fault Injection Service (FIS).
If you're using Aurora DSQL and want to test how your application behaves when connection failures occur, please give this a try.