aws/scipt.sh
Michal Gulczynski 5bedea67f1 script fix
2024-12-16 00:52:19 +01:00

20 lines
774 B
Bash

#!/bin/bash
echo "Pobieranie danych AWS CLI..."
AWS_ACCESS_KEY_ID=$(aws configure get aws_access_key_id)
AWS_SECRET_ACCESS_KEY=$(aws configure get aws_secret_access_key)
AWS_SESSION_TOKEN=$(aws configure get aws_session_token)
DEFAULT_VPC=$(aws ec2 describe-vpcs --filters "Name=isDefault,Values=true" --query 'Vpcs[0].VpcId' --output text)
if [[ -z "$AWS_ACCESS_KEY_ID" || -z "$AWS_SECRET_ACCESS_KEY" || -z "$AWS_SESSION_TOKEN" || -z "$DEFAULT_VPC" ]]; then
echo "Brak wymaganych danych! Sprawdź konfigurację AWS CLI."
exit 1
fi
echo "Uruchamianie main.py..."
python3 main.py \
--aws_access_key_id "$AWS_ACCESS_KEY_ID" \
--aws_secret_access_key "$AWS_SECRET_ACCESS_KEY" \
--aws_session_token "$AWS_SESSION_TOKEN" \
--default_vpc "$DEFAULT_VPC"