

Prerequisites
- An AWS account
- An IAM user or role with EC2 permissions
- An SSH key pair (local
~/.ssh/id_rsaand~/.ssh/id_rsa.pub)
Required IAM Permissions
The IAM user needs these permissions (or use theAmazonEC2FullAccess managed policy):
Get Your Credentials
- Go to IAM Console > Users > select your user
- Security credentials tab > Create access key
- Save the Access key ID and Secret access key
Configuration
Minimal Setup
Instance Types
| Instance | vCPU | RAM | $/hr (on-demand) | $/hr (spot, ~70% off) | Best For |
|---|---|---|---|---|---|
| t3.medium | 2 | 4 GB | $0.0416 | ~$0.012 | Light scans, single targets |
| t3.large | 2 | 8 GB | $0.0832 | ~$0.025 | General scanning |
| t3.xlarge | 4 | 16 GB | $0.1664 | ~$0.050 | Heavy scans, large target lists |
| t3.2xlarge | 8 | 32 GB | $0.3328 | ~$0.100 | Parallel pipelines |
Spot Instances
Spot instances cost 60-80% less than on-demand. They can be interrupted but are fine for security scanning (stateless, can retry).Regions
Pick a region close to your targets or with the lowest pricing:| Region | Location | Code |
|---|---|---|
| US East (N. Virginia) | US | us-east-1 |
| US West (Oregon) | US | us-west-2 |
| EU (Frankfurt) | Europe | eu-central-1 |
| EU (Ireland) | Europe | eu-west-1 |
| Asia Pacific (Singapore) | Asia | ap-southeast-1 |
| Asia Pacific (Tokyo) | Asia | ap-northeast-1 |
| Asia Pacific (Mumbai) | Asia | ap-south-1 |
| Asia Pacific (Sydney) | Australia | ap-southeast-2 |
Custom AMI
Use a custom AMI with tools pre-installed for faster startup:Cost Limits
Examples
Quick Domain Recon
Large-Scale Subdomain Enumeration
Custom Nmap Scan
Distributed Nuclei Scanning
Spot Instance Pipeline
Persistent Recon Campaign
Multi-Region Scanning
Troubleshooting
”UnauthorizedOperation” Error
Your IAM user lacks required permissions. AttachAmazonEC2FullAccess policy or the minimal permissions listed above.
Instances Not Starting
SSH Connection Timeout
Spot Instance Interrupted
Spot instances can be reclaimed by AWS. The scan will fail for that worker. Mitigation:- Use
--auto-destroyto clean up - Re-run the failed targets
- Use on-demand instances for critical scans
Cleaning Up
Cost Optimization
- Use spot instances for all non-critical scans (
use_spot: true) - Right-size instances: t3.medium is enough for most single-target scans
- Always use
--auto-destroyto prevent forgotten instances - Set cost limits to catch runaway spending
- Use custom AMIs to reduce setup time (less instance-hours)
- Pick the cheapest region if target geo-location doesn’t matter (us-east-1 is usually cheapest)
