summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErol Guven <erol.guven@appian.com>2020-08-24 11:25:37 +0100
committerVladislav Vaintroub <wlad@mariadb.com>2020-09-11 02:45:44 +0200
commit5f2728d594bf0202afebeff2323324df79b50425 (patch)
treed05dd87a9adc81600b4c53c6636525121bf455b4
parent897b51db434d58e5cfe0079195bb81b7ff624fce (diff)
downloadmariadb-git-5f2728d594bf0202afebeff2323324df79b50425.tar.gz
Define variable to override endpoint url
-rw-r--r--plugin/aws_key_management/aws_key_management_plugin.cc11
1 files changed, 11 insertions, 0 deletions
diff --git a/plugin/aws_key_management/aws_key_management_plugin.cc b/plugin/aws_key_management/aws_key_management_plugin.cc
index 489dd375387..348c171b618 100644
--- a/plugin/aws_key_management/aws_key_management_plugin.cc
+++ b/plugin/aws_key_management/aws_key_management_plugin.cc
@@ -81,6 +81,7 @@ static unsigned long key_spec;
static unsigned long log_level;
static int rotate_key;
static int request_timeout;
+static char* endpoint_url;
#ifndef DBUG_OFF
#define WITH_AWS_MOCK 1
@@ -229,6 +230,10 @@ static int aws_init()
{
clientConfiguration.region = region;
}
+ if (endpoint_url && endpoint_url[0])
+ {
+ clientConfiguration.endpointOverride = endpoint_url;
+ }
if (request_timeout)
{
clientConfiguration.requestTimeoutMs= request_timeout;
@@ -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.",
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
static MYSQL_SYSVAR_BOOL(mock, mock,
PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
@@ -725,6 +735,7 @@ static struct st_mysql_sys_var* settings[]= {
MYSQL_SYSVAR(log_level),
MYSQL_SYSVAR(request_timeout),
MYSQL_SYSVAR(region),
+ MYSQL_SYSVAR(endpoint_url),
#if WITH_AWS_MOCK
MYSQL_SYSVAR(mock),
#endif