A Python script to scan and list AWS resources by region and globally, using a specified AWS profile.
- Scans all AWS regions or a specific list of regions.
- Retrieves resources from EC2, RDS, DynamoDB, Lambda, and more.
- Fetches global resources like S3 buckets, IAM users, and Route 53 hosted zones.
- Outputs results in a structured JSON file.
-
Install Python 3.8+
Ensure you have Python installed on your system. You can download it from python.org. -
Install AWS CLI
- Download and install the AWS CLI from AWS CLI official documentation.
- Verify the installation:
You should see a version number, e.g.,
aws --version
aws-cli/2.x.x
.
-
Configure AWS CLI
- Set up your AWS CLI with profiles:
aws configure --profile <profile-name>
- Provide your access key, secret key, default region, and output format when prompted.
- Set up your AWS CLI with profiles:
-
Install Dependencies
- Install the
boto3
library using pip:pip install boto3
- Install the
git clone https://github.com/yourusername/aws-resource-scanner.git
cd aws-resource-scanner
pip install -r requirements.txt
- Scan all regions
python aws-scanner.py <aws-profile-name>
- Scan specific regions
python aws-scanner.py <aws-profile-name> --regions us-east-1 eu-west-1
The script saves a JSON file named aws_resources.json with details of the resources grouped by region.
This project is licensed under the MIT License.