This tool traces every lines where the program actually runs during execution of AWS CLI v2.
You need to install supported python versions. Details:
https://github.com/aws/aws-cli/tree/v2
For example, you can install python3.12 using pyenv for AWS CLI v2
sudo dnf install -y git gcc g++ zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel- Clone repository recursively
git clone --recursive https://github.com/AWSSampleOrg/aws-cli.git- Change directory to
aws-cli, and checkout to the specified AWS CLI version.
cd aws-cli/aws-cli
git checkout <specific aws cli version>- Change directory to the project directory, and execute following command.
cd ..
./setup.sh- generate output.log
change directory to aws-cli directory.
cd aws-cli
./aws.sh s3 ls --debug- Analyze with your own analyze scripts or sample scripts under
analyzedirectory.
- Generate html files so that those files can be seen on your web browser.
./analyze/html output.log- To get call stacks when the moment of specified index was executed. For example, below command shows the call stacks when index of 12000 was executed.
./analyze/call_stack output.log 12000- Search specified variables. For example,
169.254.169.254were given to see IMDS related requests.
./analyze/search.sh 169.254.169.254- show the file content
./analyze/with_source output.log ./analyze/result.txt- Analyze using Athena
-
Create database and table. Refer to
analyze/query.sql. Replace <S3_BUCKET_NAME> with your own bucket. -
Upload the output.log to the under aws_cli_logs in the S3 bucket.
aws s3 cp output.log s3://<S3_BUCKET_NAME>/aws_cli_logs/output.logSearch logging location
grep -rn 'logger.' output --include=*.py --exclude-dir=__pycache__- Change directory to the project directory.
Execute following command in the root directory.
./cleanup.sh