forked from aws-samples/aws-waf-ops-dashboards
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcreate_esconfig.sh
27 lines (26 loc) · 849 Bytes
/
create_esconfig.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
27
#!/bin/sh
#
# Copyright Amazon.com, Inc. and its affiliates. All Rights Reserved.
# SPDX-License-Identifier: MIT
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
if [ -z "$1" ]
then
echo "Usage: $0 <bucket_name>"
exit 1
fi
pip3 install --user virtualenv
virtualenv -p python3.7 venv
source ./venv/bin/activate
pip3 install -U requests requests-AWS4Auth cfnresponse
cd $VIRTUAL_ENV/lib/python3.7/site-packages/
rm -rf wheel* easy_install* setuptools* _virtualenv* pip* _distutils* pkg_resources
wget https://raw.githubusercontent.com/aws-samples/aws-waf-ops-dashboards/b814ab96f0cea04da57a530970c9d8b8d3742972/lambda_function.py
zip -r esconfig.zip .
aws s3 cp esconfig.zip s3://$1
deactivate
cd ../../../..
rm -rf venv build