Setting the file. One moment. Db2 Driver · RDS Db2 · aws/agent-toolkit-for-aws · Skills Docs70
Creating Amazon Aurora Db Cluster With Instances
93
Routing Traffic With Route53 And CloudFront
Resilience Program Design
Creating API Gateway Stage
This file
- Number
- 72.17
- Position
- 17 of 28
- Type
- Shell
- Size
- 20 KB
- Lines
- 511
scripts/db2-driver.sh
Shell·511 lines·20 KB
12
# DB2_VER=12.1 → installs Db2 12.1.3 RT client
13DB2_VER=${DB2_VER:-"11.5"}
14
15case "$DB2_VER" in
16 11.5)
17 DRIVER_RT="v11.5.9_linuxx64_rtcl.tar"
18 TOOLS_ZIP="db211.5-tools.zip"
19 DB2_INSTALL_DIR="/opt/ibm/db2/V11.5"
20 DB2_VERSION_LABEL="11.5.9"
21 ;;
22 12.1)
23 DRIVER_RT="v12.1.4_linuxx64_rtcl.tar"
24 TOOLS_ZIP="db212.1-tools.zip"
25 DB2_INSTALL_DIR="/opt/ibm/db2/V12.1"
26 DB2_VERSION_LABEL="12.1.4"
27 ;;
28 *)
29 echo "ERROR: Unsupported DB2_VER='${DB2_VER}'. Valid values: 11.5, 12.1" >&2
30 exit 1
31 ;;
32esac
33
34# Public source (online mode)
35SOURCE_URL="https://aws-blogs-artifacts-public.s3.amazonaws.com/artifacts/DBBLOG-4900"
36
37# =============================================================================
38# db2-driver.sh — Install RDS DB2 RT client
39# =============================================================================
40# Works in two modes — auto-detected based on whether BUCKET is set:
41#
42# ONLINE mode (CloudShell / EC2 with internet access):
43# curl -sL https://bit.ly/getdb2driver | bash
44# — or —
45# REGION=us-east-1 ./${SCRIPT_CLIENT}
46#
47# AIRGAP mode (private subnet, no internet — run ${SCRIPT_AIRGAP} first):
48# export BUCKET=db2client-artifacts-<account>-<region> REGION=<region>
49# ./${SCRIPT_CLIENT}
50# =============================================================================
51
52if [ -z "$BASH_VERSION" ]; then exec bash "$0" "$@"; fi
53set -eo pipefail
54export AWS_PAGER=""
55
56RED='\033[0;31m'; GREEN='\033[0;32m'; YELLOW='\033[1;33m'
57BLUE='\033[0;34m'; NC='\033[0m'
58log_info() { echo -e "${BLUE}[ INFO]${NC} $(date '+%H:%M:%S') - $1" >&2; }
59log_success() { echo -e "${GREEN}[SUCCESS]${NC} $(date '+%H:%M:%S') - $1" >&2; }
60log_warning() { echo -e "${YELLOW}[WARNING]${NC} $(date '+%H:%M:%S') - $1" >&2; }
61log_error() { echo -e "${RED}[ ERROR]${NC} $(date '+%H:%M:%S') - $1" >&2; }
62
63# --- Curl-pipe detection ---
64# True when script is being piped via bash (not run as a saved file)
65CURL_PIPE=false
66if [ ! -f "${BASH_SOURCE[0]:-}" ]; then
67 CURL_PIPE=true
68fi
69
70
71
72# --- Defaults ---
73PROFILE=${PROFILE:-""}
74REGION=${REGION:-""}
75DB2USER_NAME=${DB2USER_NAME:-"db2inst1"}
76BUCKET=${BUCKET:-""}
77VERBOSE=${VERBOSE:-false}
78
79# --- Argument parsing ---
80while [[ $# -gt 0 ]]; do
81 case $1 in
82 --region) REGION="$2"; shift 2 ;;
83 --profile) PROFILE="$2"; shift 2 ;;
84 --bucket) BUCKET="$2"; shift 2 ;;
85 --verbose) VERBOSE=true; shift ;;
86 -h|--help)
87 echo "Usage: [BUCKET=<bucket>] [REGION=<region>] ./$SCRIPT_CLIENT [--region REGION] [--profile PROFILE]"
88 echo " No BUCKET = online mode (downloads from public S3)"
89 echo " BUCKET set = airgap mode (downloads from private bucket)"
90 exit 0 ;;
91 *) log_error "Unknown option: $1"; exit 1 ;;
92 esac
93done
94
95log_debug() { [[ "$VERBOSE" == "true" ]] && echo -e "${BLUE}[ DEBUG]${NC} $(date '+%H:%M:%S') - $1" >&2 || true; }
96
97# =============================================================================
98# Validation
99# =============================================================================
100validate() {
101 # Auto-detect region if not set
102 if [ -z "$REGION" ]; then
103 if [ -n "${AWS_DEFAULT_REGION:-}" ]; then
104 REGION="$AWS_DEFAULT_REGION"
105 log_info "Detected region from environment: $REGION"
106 elif curl -s --connect-timeout 1 http://169.254.169.254/latest/meta-data/ >/dev/null 2>&1; then
107 local token
108 token=$(curl -sX PUT "http://169.254.169.254/latest/api/token" -H "X-aws-ec2-metadata-token-ttl-seconds: 21600" 2>/dev/null)
109 REGION=$(curl -s -H "X-aws-ec2-metadata-token: $token" \
110 http://169.254.169.254/latest/meta-data/placement/region 2>/dev/null)
111 log_info "Detected region from EC2 metadata: $REGION"
112 fi
113 fi
114
115 if [ -z "$REGION" ]; then
116 log_error "REGION not set. Either: export REGION=us-east-1 or use --region us-east-1"
117 exit 1
118 fi
119
120 if [ "$(uname -s)" != "Linux" ]; then
121 log_error "This script only supports Linux. Detected: $(uname -s)"
122 exit 1
123 fi
124
125 if ! sudo -n true 2>/dev/null; then
126 log_error "This script requires sudo privileges."
127 exit 1
128 fi
129
130 if ! command -v aws &>/dev/null; then
131 log_error "aws CLI not found. Please install it first."
132 exit 1
133 fi
134
135 # Set PROFILE_ARG early so ensure_jq can use it if needed.
136 # Guard against an empty PROFILE: "--profile " (no name) is an invalid CLI
137 # argument and would break the airgap jq download in ensure_jq, which runs
138 # before set_credentials can resolve metadata creds.
139 if [ -n "${AWS_ACCESS_KEY_ID:-}" ] && [ -n "${AWS_SECRET_ACCESS_KEY:-}" ]; then
140 PROFILE_ARG=""
141 elif [ -n "$PROFILE" ]; then
142 PROFILE_ARG="--profile $PROFILE"
143 else
144 PROFILE_ARG=""
145 fi
146
147 ensure_jq
148 set_credentials # sets CREDS_FROM_METADATA=true when sourced from CloudShell/EC2
149
150 if [ "${CREDS_FROM_METADATA:-false}" = "false" ]; then
151 if ! aws sts get-caller-identity $PROFILE_ARG --region "$REGION" >/dev/null 2>&1; then
152 if [ -n "$PROFILE" ]; then
153 log_error "Profile '$PROFILE' credentials are invalid or expired."
154 log_error "Run: aws sts get-caller-identity --profile $PROFILE"
155 log_error "Either refresh credentials for '$PROFILE' or unset PROFILE to use instance metadata."
156 else
157 log_error "AWS credentials invalid. Set AWS_ACCESS_KEY_ID/SECRET or export PROFILE=<name>."
158 fi
159 exit 1
160 fi
161 fi
162
163 if [ -n "$BUCKET" ]; then
164 log_success "Validation passed | Mode: AIRGAP | Region: $REGION | Bucket: $BUCKET"
165 else
166 log_success "Validation passed | Mode: ONLINE | Region: $REGION"
167 fi
168}
169
170# =============================================================================
171# Ensure jq is available — install from private bucket if missing
172# =============================================================================
173ensure_jq() {
174 command -v jq &>/dev/null && return 0
175 if [ -n "${BUCKET:-}" ]; then
176 # Airgap mode — pull the static jq binary staged in the private bucket
177 log_info "jq not found — downloading from s3://${BUCKET}/scripts/jq ..."
178 local tmp_jq
179 tmp_jq=$(mktemp)
180 aws s3 cp "s3://${BUCKET}/scripts/jq" "$tmp_jq" \
181 --region "$REGION" $PROFILE_ARG --quiet
182 sudo mv -f "$tmp_jq" /usr/local/bin/jq
183 sudo chmod +x /usr/local/bin/jq
184 log_success "jq installed from private bucket"
185 else
186 # Online mode — BUCKET is empty, so install via the OS package manager
187 log_info "jq not found — installing via package manager ..."
188 sudo yum install -y jq &>/dev/null || sudo apt-get install -y jq &>/dev/null
189 if ! command -v jq &>/dev/null; then
190 log_error "Failed to install jq. Please install it manually and re-run."
191 exit 1
192 fi
193 log_success "jq installed via package manager"
194 fi
195}
196
197# =============================================================================
198# Credentials — probe CloudShell, EC2 IMDSv2, then fall back to profile/env
199# Precedence:
200# 1. Exported AWS_ACCESS_KEY_ID/SECRET → use immediately
201# 2. PROFILE explicitly set → validate with sts, exit if fails
202# 3. No profile → probe CloudShell IMDS → EC2 IMDS → exit if neither works
203#
204# SECURITY: exported AWS_ACCESS_KEY_ID/SECRET are long-lived static keys —
205# acceptable only for temporary CI/CD automation, NEVER for production. In
206# production, obtain credentials exclusively through an EC2 instance profile /
207# IAM role (CloudShell or EC2 IMDS below), never hard-coded or long-lived keys.
208# =============================================================================
209set_credentials() {
210 local creds
211 CREDS_FROM_METADATA=false
212
213 # Priority 1: exported env var credentials
214 if [ -n "${AWS_ACCESS_KEY_ID:-}" ] && [ -n "${AWS_SECRET_ACCESS_KEY:-}" ]; then
215 PROFILE_ARG=""
216 return 0
217 fi
218
219 # Priority 2: explicit profile — skip IMDS, validate immediately
220 if [ -n "$PROFILE" ]; then
221 PROFILE_ARG="--profile $PROFILE"
222 log_info "Using explicit profile: $PROFILE"
223 return 0
224 fi
225
226 # Priority 3a: CloudShell IMDS
227 if curl -s --connect-timeout 1 http://127.0.0.1:1338/latest/meta-data/ >/dev/null 2>&1; then
228 log_info "Detected AWS CloudShell environment"
229 local token
230 token=$(curl -sX PUT "http://127.0.0.1:1338/latest/api/token" \
231 -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
232 creds=$(curl -s -H "Authorization: $token" \
233 "http://127.0.0.1:1338/latest/meta-data/container/security-credentials")
234 export AWS_ACCESS_KEY_ID=$(echo "$creds" | jq -r .AccessKeyId)
235 export AWS_SECRET_ACCESS_KEY=$(echo "$creds" | jq -r .SecretAccessKey)
236 export AWS_SESSION_TOKEN=$(echo "$creds" | jq -r .Token)
237 PROFILE_ARG=""
238 CREDS_FROM_METADATA=true
239 return 0
240 fi
241
242 # Priority 3b: EC2 IMDSv2
243 if curl -s --connect-timeout 1 http://169.254.169.254/latest/meta-data/ >/dev/null 2>&1; then
244 log_info "Detected EC2 environment"
245 local token role
246 token=$(curl -sX PUT "http://169.254.169.254/latest/api/token" \
247 -H "X-aws-ec2-metadata-token-ttl-seconds: 21600")
248 role=$(curl -s -H "X-aws-ec2-metadata-token: $token" \
249 http://169.254.169.254/latest/meta-data/iam/security-credentials/)
250 if [ -n "$role" ]; then
251 creds=$(curl -s -H "X-aws-ec2-metadata-token: $token" \
252 "http://169.254.169.254/latest/meta-data/iam/security-credentials/$role")
253 export AWS_ACCESS_KEY_ID=$(echo "$creds" | jq -r .AccessKeyId)
254 export AWS_SECRET_ACCESS_KEY=$(echo "$creds" | jq -r .SecretAccessKey)
255 export AWS_SESSION_TOKEN=$(echo "$creds" | jq -r .Token)
256 PROFILE_ARG=""
257 CREDS_FROM_METADATA=true
258 return 0
259 fi
260 fi
261
262 log_error "No credentials found. Set AWS_ACCESS_KEY_ID/SECRET, export PROFILE=<name>, or run from CloudShell/EC2."
263 exit 1
264}
265
266# =============================================================================
267# Download artifacts — online (curl from public S3) or airgap (aws s3 cp)
268# =============================================================================
269curl_download() {
270 local url="$1" dest="$2"
271 curl -fsSL "$url" -o "$dest"
272}
273
274s3_download() {
275 local key="$1" dest="$2"
276 aws s3 cp "s3://${BUCKET}/${key}" "$dest" \
277 --region "$REGION" $PROFILE_ARG --quiet
278}
279
280download_artifacts() {
281 local work_dir="$1"
282
283 if [ -n "$BUCKET" ]; then
284 # --- Airgap mode: pull from private bucket ---
285 for f in "$FILE_FUNCTIONS" "$FILE_README"; do
286 s3_download "scripts/${f}" "${work_dir}/${f}"
287 done
288 if [ "$INCLUDE_OTHER_TOOLS" = "TRUE" ]; then
289 s3_download "scripts/${TOOLS_ZIP}" "${work_dir}/${TOOLS_ZIP}"
290 fi
291 s3_download "ssl/${REGION}-bundle.pem" "${work_dir}/${REGION}-bundle.pem"
292 s3_download "drivers/${DRIVER_RT}" "${work_dir}/${DRIVER_RT}"
293 s3_download "scripts/${SCRIPT_CONFIGURE}" "${work_dir}/${SCRIPT_CONFIGURE}"
294 else
295 # --- Online mode: pull from public S3 via curl ---
296 for f in "$FILE_FUNCTIONS" "$FILE_README"; do
297 curl_download "${SOURCE_URL}/${f}" "${work_dir}/${f}"
298 done
299 if [ "$INCLUDE_OTHER_TOOLS" = "TRUE" ]; then
300 curl_download "${SOURCE_URL}/${TOOLS_ZIP}" "${work_dir}/${TOOLS_ZIP}"
301 fi
302 curl_download \
303 "https://truststore.pki.rds.amazonaws.com/${REGION}/${REGION}-bundle.pem" \
304 "${work_dir}/${REGION}-bundle.pem"
305 curl_download "${SOURCE_URL}/${DRIVER_RT}" "${work_dir}/${DRIVER_RT}"
306 curl_download "${SOURCE_URL}/${SCRIPT_CONFIGURE}" "${work_dir}/${SCRIPT_CONFIGURE}"
307 fi
308
309 echo "${DRIVER_RT}"
310}
311
312# =============================================================================
313# User creation
314# =============================================================================
315create_db2_user() {
316 local username="$DB2USER_NAME"
317 local start_id=1001
318
319 while getent group "$start_id" >/dev/null; do start_id=$((start_id + 1)); done
320 local gid=$start_id
321 while getent passwd "$start_id" >/dev/null; do start_id=$((start_id + 1)); done
322 local uid=$start_id
323
324 log_info "Creating group $username (GID $gid) and user (UID $uid)"
325 sudo groupadd -g "$gid" "$username"
326 sudo useradd -u "$uid" -g "$gid" -d "/home/$username" -m -s /bin/bash "$username"
327 log_success "User $username created"
328}
329
330
331# =============================================================================
332# Install RT Client (runtime client) — mirrors install_rt_client() in db2-driver.sh
333# =============================================================================
334install_rt_client() {
335 local work_dir="$1"
336 local driver_pkg="$2"
337
338 log_info "============================================================================"
339 log_info "Deploying Db2 ${DB2_VERSION_LABEL} Runtime client"
340 log_debug "Extracting ${driver_pkg} from ${work_dir}"
341 if ! tar -xf "${work_dir}/${driver_pkg}" -C "$work_dir" 2>/tmp/tar_err; then
342 log_error "tar extraction failed: $(cat /tmp/tar_err)"
343 return 1
344 fi
345
346 if id "$DB2USER_NAME" &>/dev/null; then
347 log_info "User $DB2USER_NAME already exists. Skipping user creation."
348 else
349 create_db2_user
350 fi
351
352 # db2_install only if not already done for this version
353 if [ ! -d "${DB2_INSTALL_DIR}" ]; then
354 log_info "Installing Db2 ${DB2_VERSION_LABEL} runtime client"
355 # AL2023 ships without libcrypt.so.1 — db2iure requires it
356 if ! ldconfig -p | grep -q libcrypt.so.1; then
357 log_info "Installing libxcrypt-compat for AL2023 compatibility"
358 sudo yum install -y libxcrypt-compat &>/dev/null
359 fi
360 (cd "${work_dir}/rtcl" && sudo TMPDIR=/var/tmp ./db2_install -f sysreq -y -b /opt/ibm/db2 2>/tmp/db2install_err) || true
361 if [ ! -d "/opt/ibm/db2" ]; then
362 log_error "db2_install failed — /opt/ibm/db2 not found."
363 return 1
364 fi
365 else
366 log_info "Db2 software already installed at ${DB2_INSTALL_DIR} — skipping db2_install"
367 fi
368 rm -rf "${work_dir}/rtcl"
369
370 # Always remove sqllib before db2icrt so it can recreate it cleanly
371 sudo rm -rf "/home/$DB2USER_NAME/sqllib" &>/dev/null || true
372 local tmp_free
373 tmp_free=$(df /tmp --output=avail | tail -1)
374 if [ "$tmp_free" -lt 524288 ]; then
375 log_info "/tmp has insufficient space (${tmp_free}KB) — bind-mounting /var/tmp over /tmp"
376 sudo mount --bind /var/tmp /tmp
377 trap "sudo umount /tmp 2>/dev/null; rm -rf $work_dir" EXIT
378 fi
379
380 local icrt_out
381 icrt_out=$(sudo env -i TMPDIR=/var/tmp PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
382 /opt/ibm/db2/instance/db2icrt -s client "$DB2USER_NAME" 2>&1) || true
383
384 if [ ! -d "/home/$DB2USER_NAME/sqllib" ]; then
385 log_error "db2icrt failed — /home/$DB2USER_NAME/sqllib not found."
386 log_error "db2icrt output: $icrt_out"
387 return 1
388 fi
389
390 # Place functions.sh and README.txt
391 sudo mv -f "${work_dir}/${FILE_FUNCTIONS}" "/home/$DB2USER_NAME/"
392 sudo chown "$DB2USER_NAME:$DB2USER_NAME" "/home/$DB2USER_NAME/${FILE_FUNCTIONS}"
393 sudo mv -f "${work_dir}/${FILE_README}" "/home/$DB2USER_NAME/"
394 sudo chown "$DB2USER_NAME:$DB2USER_NAME" "/home/$DB2USER_NAME/${FILE_README}"
395
396 if [ "$INCLUDE_OTHER_TOOLS" = "TRUE" ] && [ -f "${work_dir}/${TOOLS_ZIP}" ]; then
397 log_info "Installing tools from ${TOOLS_ZIP}..."
398 # Extract tools zip — expected contents: db2exfmt, db2advis, db2advisbind.zip
399 local tools_dir="${work_dir}/tools"
400 mkdir -p "$tools_dir"
401 unzip -o "${work_dir}/${TOOLS_ZIP}" -d "$tools_dir" &>/dev/null
402
403 # Place db2advisbind.zip into sqllib/bnd and unzip
404 if [ -f "${tools_dir}/db2advisbind.zip" ]; then
405 sudo mv -f "${tools_dir}/db2advisbind.zip" "/home/$DB2USER_NAME/sqllib/bnd/"
406 sudo bash -c "
407 cd /home/$DB2USER_NAME/sqllib/bnd
408 rm -f db2adv*.bnd
409 unzip -o db2advisbind.zip &>/dev/null
410 chown -R bin:bin db2adv*.bnd
411 rm -f db2advisbind.zip
412 "
413 fi
414
415 # Place db2exfmt and db2advis into /opt/ibm/db2/bin
416 for bin in db2exfmt db2advis; do
417 if [ -f "${tools_dir}/${bin}" ]; then
418 sudo mv -f "${tools_dir}/${bin}" /opt/ibm/db2/bin/
419 sudo chown bin:bin "/opt/ibm/db2/bin/${bin}"
420 sudo chmod +x "/opt/ibm/db2/bin/${bin}"
421 fi
422 done
423 rm -rf "$tools_dir"
424 else
425 log_info "Skipping additional tools — set INCLUDE_OTHER_TOOLS=TRUE to enable"
426 fi
427
428 # Grant db2inst1 passwordless sudo ONLY for the Db2 binaries/instance tools it
429 # needs post-install (least privilege) — not blanket NOPASSWD:ALL. db2client-configure.sh
430 # and the Db2 admin commands run out of these paths.
431 cat <<SUDOERS | sudo tee "/etc/sudoers.d/$DB2USER_NAME" >/dev/null
432$DB2USER_NAME ALL=(ALL) NOPASSWD: /opt/ibm/db2/bin/*, /opt/ibm/db2/V*/bin/*, /opt/ibm/db2/V*/instance/*, /opt/ibm/db2/V*/adm/*
433SUDOERS
434 sudo chmod 440 "/etc/sudoers.d/$DB2USER_NAME"
435
436 sudo mv -f "${work_dir}/${SCRIPT_CONFIGURE}" "/home/$DB2USER_NAME/${SCRIPT_CONFIGURE}"
437 sudo chown "$DB2USER_NAME:$DB2USER_NAME" "/home/$DB2USER_NAME/${SCRIPT_CONFIGURE}"
438 sudo chmod +x "/home/$DB2USER_NAME/${SCRIPT_CONFIGURE}"
439
440 log_success "Db2 ${DB2_VERSION_LABEL} Runtime client installed successfully for user $DB2USER_NAME"
441 log_info "============================================================================"
442}
443
444# =============================================================================
445# Curl-pipe handler — download script then exit so user can run it directly
446# =============================================================================
447handle_curl_pipe() {
448 log_info "Curl-pipe detected — downloading $SCRIPT_CLIENT and $SCRIPT_AIRGAP for direct use"
449 local dest_client="./$SCRIPT_CLIENT"
450 local dest_airgap="./$SCRIPT_AIRGAP"
451 curl -fsSL "${SOURCE_URL}/${SCRIPT_CLIENT}" -o "$dest_client" && chmod +x "$dest_client"
452 log_success "Saved: $dest_client"
453 curl -fsSL "${SOURCE_URL}/${SCRIPT_AIRGAP}" -o "$dest_airgap" && chmod +x "$dest_airgap"
454 log_success "Saved: $dest_airgap"
455 curl -fsSL "${SOURCE_URL}/${FILE_README}" -o "./$FILE_README"
456 log_success "Saved: ./$FILE_README"
457 echo
458 echo "============================================================="
459 echo " ONLINE mode (EC2 / CloudShell with internet):"
460 echo " REGION=<region> ./$SCRIPT_CLIENT"
461 echo " DB2_VER=12.1 REGION=<region> ./$SCRIPT_CLIENT # install Db2 12.1"
462 echo " DB2_VER=11.5 REGION=<region> ./$SCRIPT_CLIENT # install Db2 11.5 (default)"
463 echo
464 echo " AIRGAP mode (no internet — private subnet):"
465 echo " Step 1: On any machine WITH internet, download all artifacts:"
466 echo " DB2_VER=12.1 ./$SCRIPT_AIRGAP --mode download --region <region>"
467 echo " # saves to ./db2client-artifacts/"
468 echo
469 echo " Step 2: On a machine WITH AWS configured, upload to S3:"
470 echo " ./$SCRIPT_AIRGAP --mode upload --region <region>"
471 echo " # creates bucket + uploads artifacts"
472 echo
473 echo " Step 3: Follow steps given after completion of step 2:"
474 echo "============================================================="
475}
476
477# =============================================================================
478# Main
479# =============================================================================
480main() {
481 if [ "$CURL_PIPE" = "true" ]; then
482 handle_curl_pipe
483 return
484 fi
485
486 validate
487
488 local work_dir
489 work_dir=$(mktemp -d -p /var/tmp)
490 trap "rm -rf $work_dir" EXIT
491
492 log_info "Downloading artifacts ..."
493 local driver_pkg
494 driver_pkg=$(download_artifacts "$work_dir")
495 log_success "Downloading artifacts ... Done."
496
497 install_rt_client "$work_dir" "$driver_pkg"
498
499 log_success "============================================================="
500 log_success "DB2 RT client installed successfully"
501 log_info "To configure DSN entries, switch to the DB2 user and run:"
502 log_info " 1. sudo su - $DB2USER_NAME"
503 if [ -n "$BUCKET" ]; then
504 log_info " 2. BUCKET=$BUCKET REGION=$REGION source $SCRIPT_CONFIGURE"
505 else
506 log_info " 2. REGION=$REGION source $SCRIPT_CONFIGURE"
507 fi
508 log_success "============================================================="
509}
510
511main "$@"