-
Notifications
You must be signed in to change notification settings - Fork 32
/
sm-local-configure
51 lines (38 loc) · 1.47 KB
/
sm-local-configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
# Install locally AWS CLI and Session Manager Plugin
# See: https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
# See: https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html
set -e
set -o pipefail
_on_error() {
echo 'Error! Configuration is NOT complete.'
}
trap '_on_error' ERR
self=$(realpath "${BASH_SOURCE[0]}")
dir=$(dirname "$self")
source "$dir"/sm-helper-functions 2>/dev/null || source sm-helper-functions
uname -a
cat /etc/issue 2>/dev/null || echo "No /etc/issue file is present on the system."
cat /etc/os-release 2>/dev/null || echo "No /etc/os-release is file present on the system."
# Smoke test - Python version
$(_python) --version || echo "Error: No python3 is present on the system."
echo "sm-local-configure: Installing tools. The 'sudo' commands can ask for your password."
_install_unzip
_install_curl
_install_aws_cli
echo "AWS default region - $AWS_DEFAULT_REGION"
echo "AWS region - $AWS_REGION"
if _is_windows; then
echo "WARNING: Running on Windows. Restart your terminal app (e.g., Git Bash) "\
"and run 'aws configure list' manually, to verify the install"
else
aws configure list
fi
_install_session_manager_plugin
if _is_windows; then
echo "WARNING: Running on Windows. Restart your terminal app (e.g., Git Bash) "\
"and run 'session-manager-plugin' manually, to verify the install"
else
session-manager-plugin
fi
echo "Configuration is complete!"