You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-01 06:46:55 +03:00
add post-install setting of iam_role_name and sts_endpoint thru ENV variables.
This commit is contained in:
@ -254,6 +254,8 @@ if [ -z "$MCS_USE_S3_STORAGE" ]; then
|
||||
MCS_S3_ACCESS_KEY_ID="$(find_env_var "MCS_S3_ACCESS_KEY_ID")"
|
||||
MCS_S3_SECRET_ACCESS_KEY="$(find_env_var "MCS_S3_SECRET_ACCESS_KEY")"
|
||||
MCS_S3_REGION="$(find_env_var "MCS_S3_REGION")"
|
||||
MCS_S3_ROLE_NAME="$(find_env_var "MCS_S3_ROLE_NAME")"
|
||||
MCS_S3_STS_ENDPOINT="$(find_env_var "MCS_S3_STS_ENDPOINT")"
|
||||
fi
|
||||
|
||||
if [ ! -z "$MCS_USE_S3_STORAGE" ] && [ $MCS_USE_S3_STORAGE -eq 1 ]; then
|
||||
@ -276,6 +278,12 @@ if [ ! -z "$MCS_USE_S3_STORAGE" ] && [ $MCS_USE_S3_STORAGE -eq 1 ]; then
|
||||
if [ ! -z "$MCS_S3_REGION" ]; then
|
||||
sed -i "s|region =.*|region = $MCS_S3_REGION|" /etc/columnstore/storagemanager.cnf
|
||||
fi
|
||||
if [ ! -z "$MCS_S3_ROLE_NAME" ]; then
|
||||
sed -i "s|# iam_role_name =.*|iam_role_name = $MCS_S3_ROLE_NAME|" /etc/columnstore/storagemanager.cnf
|
||||
fi
|
||||
if [ ! -z "$MCS_S3_STS_ENDPOINT" ]; then
|
||||
sed -i "s|# sts_endpoint =.*|sts_endpoint = $MCS_S3_STS_ENDPOINT|" /etc/columnstore/storagemanager.cnf
|
||||
fi
|
||||
sed -i "s|bucket =.*|bucket = $MCS_S3_BUCKET|" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|# endpoint =.*|endpoint = $MCS_S3_ENDPOINT|" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|# aws_access_key_id =.*|aws_access_key_id = $MCS_S3_ACCESS_KEY_ID|" /etc/columnstore/storagemanager.cnf
|
||||
@ -283,7 +291,9 @@ if [ ! -z "$MCS_USE_S3_STORAGE" ] && [ $MCS_USE_S3_STORAGE -eq 1 ]; then
|
||||
|
||||
testS3Connection
|
||||
if [ $? -ne 0 ]; then
|
||||
sed -i "s|endpoint =.*|# endpoint = |" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|iam_role_name =.*|# iam_role_name = |" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|sts_endpoint =.*|# sts_endpoint = |" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|^endpoint =.*|# endpoint = |" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|aws_access_key_id =.*|# aws_access_key_id = |" /etc/columnstore/storagemanager.cnf
|
||||
sed -i "s|aws_secret_access_key =.*|# aws_secret_access_key = |" /etc/columnstore/storagemanager.cnf
|
||||
echo "There was an error validating the settings used to access S3."
|
||||
@ -294,6 +304,8 @@ if [ ! -z "$MCS_USE_S3_STORAGE" ] && [ $MCS_USE_S3_STORAGE -eq 1 ]; then
|
||||
echo "MCS_S3_ACCESS_KEY_ID"
|
||||
echo "MCS_S3_SECRET_ACCESS_KEY"
|
||||
echo "MCS_S3_REGION"
|
||||
echo "MCS_S3_ROLE_NAME"
|
||||
echo "MCS_S3_STS_ENDPOINT"
|
||||
echo "After environment variables are fixed, run command: columnstore-post-install"
|
||||
exit 1
|
||||
fi
|
||||
|
@ -113,13 +113,13 @@ bucket = some_bucket
|
||||
# The value for the IAM role that will provide the temporary credentials
|
||||
# via AssumeRole. Assumes the role has been created and permissions are
|
||||
# defined correctly prior to operation.
|
||||
# iam_role_name should contain any prefix paths. Example:
|
||||
# iam_role_name = application_abc/component_xyz/example_role
|
||||
# iam_role name =
|
||||
# iam_role_name should contain any prefix paths.
|
||||
# Example: application_abc/component_xyz/example_role
|
||||
# iam_role_name =
|
||||
|
||||
# Specify the endpoint to connect to for AWS Security Token Service
|
||||
# Default of sts.amazonaws.com used if iam_role_name set.
|
||||
# sts_endpoint = sts.amazonaws.com
|
||||
# sts_endpoint =
|
||||
|
||||
# The LocalStorage section configures the 'local storage' module
|
||||
# if specified by ObjectStorage/service.
|
||||
|
Reference in New Issue
Block a user