Commit 5f2728d5 authored by Erol Guven's avatar Erol Guven Committed by Vladislav Vaintroub

Define variable to override endpoint url

parent 897b51db
...@@ -81,6 +81,7 @@ static unsigned long key_spec; ...@@ -81,6 +81,7 @@ static unsigned long key_spec;
static unsigned long log_level; static unsigned long log_level;
static int rotate_key; static int rotate_key;
static int request_timeout; static int request_timeout;
static char* endpoint_url;
#ifndef DBUG_OFF #ifndef DBUG_OFF
#define WITH_AWS_MOCK 1 #define WITH_AWS_MOCK 1
...@@ -229,6 +230,10 @@ static int aws_init() ...@@ -229,6 +230,10 @@ static int aws_init()
{ {
clientConfiguration.region = region; clientConfiguration.region = region;
} }
if (endpoint_url && endpoint_url[0])
{
clientConfiguration.endpointOverride = endpoint_url;
}
if (request_timeout) if (request_timeout)
{ {
clientConfiguration.requestTimeoutMs= request_timeout; clientConfiguration.requestTimeoutMs= request_timeout;
...@@ -711,6 +716,11 @@ static MYSQL_SYSVAR_STR(region, region, ...@@ -711,6 +716,11 @@ static MYSQL_SYSVAR_STR(region, region,
"AWS region. For example us-east-1, or eu-central-1. If no value provided, SDK default is used.", "AWS region. For example us-east-1, or eu-central-1. If no value provided, SDK default is used.",
NULL, NULL, ""); NULL, NULL, "");
static MYSQL_SYSVAR_STR(endpoint_url, endpoint_url,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
"Used to override the default AWS API endpoint. If not set, the default will be used",
NULL, NULL, "");
#if WITH_AWS_MOCK #if WITH_AWS_MOCK
static MYSQL_SYSVAR_BOOL(mock, mock, static MYSQL_SYSVAR_BOOL(mock, mock,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY, PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
...@@ -725,6 +735,7 @@ static struct st_mysql_sys_var* settings[]= { ...@@ -725,6 +735,7 @@ static struct st_mysql_sys_var* settings[]= {
MYSQL_SYSVAR(log_level), MYSQL_SYSVAR(log_level),
MYSQL_SYSVAR(request_timeout), MYSQL_SYSVAR(request_timeout),
MYSQL_SYSVAR(region), MYSQL_SYSVAR(region),
MYSQL_SYSVAR(endpoint_url),
#if WITH_AWS_MOCK #if WITH_AWS_MOCK
MYSQL_SYSVAR(mock), MYSQL_SYSVAR(mock),
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment