-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathbootstrap.sh
27 lines (23 loc) · 1022 Bytes
/
bootstrap.sh
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
#!/bin/bash
# create the virtual environment
python3 -m venv .env
# Install into the virtual environment
source .env/bin/activate
# download requirements
.env/bin/python -m pip install -r requirements.txt --upgrade pip
# Load dependency for lambda functions,
.env/bin/python -m pip install --target CWMetricsToOpenSearch/ -r CWMetricsToOpenSearch/requirements.txt
# and add boto3 which would be added as layer for metrics, as latest boto3 is needed for serverless collection
.env/bin/python -m pip install boto3 -t boto3-layer/python
# Set region to deploy the stack
region_default="us-east-1"
echo -e
read -p "Please enter your region to deploy the stack [$region_default]: " region
region="${region:-$region_default}"
aws configure set default.region $region
# Add e-mail for the notification
email_default="[email protected]"
echo -e
read -p "Please enter an e-mail for alert [$email_default]: " email
email="${email:-$email_default}"
sed -i -e 's/[email protected]/'$email'/g' opensearch/opensearch_monitor_stack.py