Comprehensive guide to configuring Instancepedia for your workflow.
- Configuration File
- AWS Configuration
- TUI Settings
- CLI Settings
- Performance Tuning
- Cache Configuration
- Filter Presets
- Environment Variables
- Advanced Configuration
Instancepedia uses a TOML configuration file located at:
~/.instancepedia/config.toml
The config file is optional. Instancepedia works with defaults if no config exists.
To create a config file:
mkdir -p ~/.instancepedia
cat > ~/.instancepedia/config.toml <<EOF
# Instancepedia Configuration
# Default AWS region
default_region = "us-east-1"
# Enable Vim-style navigation (hjkl)
vim_keys = false
# TUI pricing concurrency (5-50)
tui_pricing_concurrency = 20
# CLI pricing concurrency (5-100)
cli_pricing_concurrency = 50
# Pricing cache TTL in seconds (default: 4 hours)
pricing_cache_ttl = 14400
EOF# AWS Settings
default_region = "us-east-1"
aws_profile = "my-profile" # Optional
# TUI Settings
vim_keys = false
tui_pricing_concurrency = 20
# CLI Settings
cli_pricing_concurrency = 50
default_output_format = "table"
default_sort = "name"
# Cache Settings
pricing_cache_ttl = 14400
instance_cache_ttl = 86400
spot_cache_ttl = 900
region_cache_ttl = 604800
# Debug Settings
debug_mode = false
log_level = "INFO"Set the default AWS region for all operations:
default_region = "us-east-1"Available Regions:
- US East:
us-east-1,us-east-2 - US West:
us-west-1,us-west-2 - Europe:
eu-west-1,eu-west-2,eu-west-3,eu-central-1,eu-north-1 - Asia Pacific:
ap-south-1,ap-northeast-1,ap-northeast-2,ap-southeast-1,ap-southeast-2 - Canada:
ca-central-1 - South America:
sa-east-1 - Middle East:
me-south-1 - Africa:
af-south-1
Note: You can override the default region with --region flag in CLI commands.
Use a named AWS CLI profile:
aws_profile = "my-profile"This is equivalent to export AWS_PROFILE=my-profile.
When to use:
- Multiple AWS accounts
- Different credential sets
- Separate development/production profiles
Override in CLI:
instancepedia --profile production listInstancepedia supports standard AWS credential methods (in order of precedence):
-
Environment Variables:
export AWS_ACCESS_KEY_ID=your-key export AWS_SECRET_ACCESS_KEY=your-secret export AWS_SESSION_TOKEN=your-token # Optional, for temporary credentials
-
Named Profile (via config or env var):
export AWS_PROFILE=my-profile -
AWS CLI Configuration (
~/.aws/credentials):[default] aws_access_key_id = your-key aws_secret_access_key = your-secret [production] aws_access_key_id = prod-key aws_secret_access_key = prod-secret
-
IAM Instance Profile (when running on EC2)
Minimum IAM policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"ec2:DescribeInstanceTypes",
"ec2:DescribeSpotPriceHistory",
"ec2:DescribeRegions",
"pricing:GetProducts"
],
"Resource": "*"
}
]
}All these APIs are free - Instancepedia never incurs AWS charges.
Settings specific to the interactive TUI mode.
Enable hjkl Vim-style navigation keys:
vim_keys = trueWhen enabled:
h: Move left / Collapsej: Move downk: Move upl: Move right / Expand
Default: false (uses arrow keys only)
Note: Arrow keys still work when Vim keys are enabled.
Number of concurrent pricing API calls in TUI:
tui_pricing_concurrency = 20Range: 5-50 Default: 20
Considerations:
- Higher values (30-50): Faster pricing loads, more API calls
- Lower values (5-15): Slower pricing loads, gentler on API limits
- Sweet spot (15-25): Balance between speed and API usage
When to adjust:
- Increase if you have high AWS API limits and want faster loads
- Decrease if you encounter rate limiting errors
Default sort order when launching TUI:
tui_default_sort = "name"Options: name, vcpu, memory, price
Default: name
Note: You can cycle through sort options with S key in TUI.
Settings specific to CLI commands.
Number of concurrent pricing API calls in CLI:
cli_pricing_concurrency = 50Range: 5-100 Default: 50
Considerations:
- Higher values (60-100): Much faster for bulk operations
- Lower values (10-30): Safer for accounts with API limits
- Default (50): Good balance for most users
When to adjust:
- Increase for large-scale automation with high API limits
- Decrease if encountering throttling errors
Default format for CLI list commands:
default_output_format = "table"Options: table, json, csv
Default: table
Examples:
table: Human-readable tabular outputjson: Machine-readable for scriptingcsv: Spreadsheet-friendly
Override in CLI:
instancepedia list --format jsonDefault sort for CLI list commands:
default_sort = "name"Options: name, vcpu, memory, price
Default: name
Override in CLI:
instancepedia list --sort priceSuppress headers and formatting by default:
quiet_mode = falseDefault: false (show headers)
When enabled: Removes headers and formatting for cleaner scripting output.
Override in CLI:
instancepedia list --quietOptimize Instancepedia for your use case.
Control how long data is cached:
# Pricing cache (default: 4 hours = 14400 seconds)
pricing_cache_ttl = 14400
# Instance types cache (default: 24 hours = 86400 seconds)
instance_cache_ttl = 86400
# Spot price cache (default: 15 minutes = 900 seconds)
spot_cache_ttl = 900
# Region list cache (default: 7 days = 604800 seconds)
region_cache_ttl = 604800Considerations:
- Longer TTL: Fewer API calls, faster subsequent runs, potentially stale data
- Shorter TTL: More API calls, slower, fresher data
Recommendations:
- Pricing: 1-6 hours (pricing changes infrequently)
- Spot: 10-30 minutes (spot prices change frequently)
- Instances: 12-48 hours (instance types change rarely)
- Regions: 7+ days (regions almost never change)
For maximum speed, minimal API usage:
pricing_cache_ttl = 21600 # 6 hours
instance_cache_ttl = 172800 # 48 hours
spot_cache_ttl = 1800 # 30 minutes
region_cache_ttl = 2592000 # 30 daysFor minimum staleness, maximum freshness:
pricing_cache_ttl = 3600 # 1 hour
instance_cache_ttl = 43200 # 12 hours
spot_cache_ttl = 600 # 10 minutes
region_cache_ttl = 86400 # 1 dayCache files are stored at:
~/.instancepedia/cache/
Files:
instance_types_{region}.json: Instance specificationspricing_{instance_type}_{region}.json: Pricing dataspot_prices_{instance_type}_{region}.json: Spot price historyregions.json: Available AWS regions
View cache statistics:
instancepedia cache statsClear all caches:
instancepedia cache clearClear specific cache type:
instancepedia cache clear --type pricing
instancepedia cache clear --type instances
instancepedia cache clear --type spot
instancepedia cache clear --type regionsClear for specific region:
instancepedia cache clear --region us-east-1First run:
- Fetches all data from AWS APIs
- Populates cache
- Takes 20-60 seconds depending on concurrency settings
Subsequent runs:
- Reads from cache
- Instant results (< 1 second)
- Refreshes expired entries in background
Cache invalidation:
- Automatic based on TTL
- Manual with
cache clearcommand - Per-entry (individual instance types, regions, etc.)
Manage custom filter presets.
Presets are stored at:
~/.instancepedia/presets/filter_presets.json
Cannot be modified or deleted:
web-serverdatabasecompute-intensivegpu-mldevelopmentmemory-intensivebudgetarm
Create custom preset (CLI):
instancepedia presets save my-api-server \
--min-vcpu 4 \
--min-memory 8 \
--architecture arm64 \
--current-generationCreate custom preset (TUI):
- Press
Fto open filter modal - Set desired filters
- Click Save Preset button
- Enter preset name and description
Load preset (CLI):
instancepedia presets apply my-api-serverLoad preset (TUI):
- Press
Fto open filter modal - Select preset from dropdown
- Filters auto-populate
Delete preset (CLI):
instancepedia presets delete my-api-serverList all presets:
instancepedia presets list~/.instancepedia/presets/filter_presets.json:
{
"custom_presets": [
{
"name": "my-api-server",
"description": "API server instances",
"min_vcpu": 4,
"min_memory": 8,
"architecture": "arm64",
"current_generation_only": true
}
]
}Override configuration with environment variables.
| Environment Variable | Config Equivalent | Description |
|---|---|---|
AWS_REGION |
default_region |
Default AWS region |
AWS_DEFAULT_REGION |
default_region |
Default AWS region (alternate) |
AWS_PROFILE |
aws_profile |
AWS CLI profile name |
AWS_ACCESS_KEY_ID |
N/A | AWS access key |
AWS_SECRET_ACCESS_KEY |
N/A | AWS secret key |
AWS_SESSION_TOKEN |
N/A | AWS session token (temp creds) |
INSTANCEPEDIA_DEBUG |
debug_mode |
Enable debug logging |
INSTANCEPEDIA_CONFIG |
N/A | Override config file path |
Example:
# Use specific region and profile
export AWS_REGION=us-west-2
export AWS_PROFILE=production
instancepedia
# Override config file location
export INSTANCEPEDIA_CONFIG=/custom/path/config.toml
instancepediaPrecedence (highest to lowest):
- Command-line flags (
--region,--profile) - Environment variables (
AWS_REGION,AWS_PROFILE) - Configuration file (
~/.instancepedia/config.toml) - Built-in defaults
Enable verbose debug logging:
debug_mode = true
log_level = "DEBUG"Logs include:
- API requests and responses
- Cache hits/misses
- Timing information
- Error stack traces
Enable via CLI:
instancepedia --debugEnable via environment:
export INSTANCEPEDIA_DEBUG=1
instancepediaControl logging verbosity:
log_level = "INFO"Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
Default: INFO
Descriptions:
DEBUG: Everything (very verbose)INFO: General information (default)WARNING: Warnings and errorsERROR: Errors onlyCRITICAL: Critical errors only
Override default cache location:
cache_directory = "/custom/path/to/cache"Default: ~/.instancepedia/cache/
Use cases:
- Shared cache across users
- Network storage
- Custom backup strategy
Override default preset location:
preset_directory = "/custom/path/to/presets"Default: ~/.instancepedia/presets/
Use cases:
- Team-shared presets (network drive)
- Version-controlled presets (git repo)
- Multiple preset collections
Configure API request timeouts:
api_timeout = 30
api_retry_attempts = 3
api_retry_delay = 2Defaults:
api_timeout: 30 secondsapi_retry_attempts: 3 retriesapi_retry_delay: 2 seconds between retries
Increase timeouts if you have slow/unstable internet connection.
Decrease timeouts for faster failure detection in automation.
Just set the region:
default_region = "us-east-1"Balanced settings for most users:
# AWS Settings
default_region = "us-east-1"
# TUI Settings
vim_keys = false
tui_pricing_concurrency = 20
# CLI Settings
cli_pricing_concurrency = 50
default_output_format = "table"
# Cache Settings (defaults)
pricing_cache_ttl = 14400
instance_cache_ttl = 86400
spot_cache_ttl = 900Maximum speed and concurrency:
# AWS Settings
default_region = "us-east-1"
# TUI Settings
vim_keys = true
tui_pricing_concurrency = 40
# CLI Settings
cli_pricing_concurrency = 80
default_output_format = "json"
quiet_mode = true
# Aggressive caching
pricing_cache_ttl = 21600 # 6 hours
instance_cache_ttl = 172800 # 48 hours
spot_cache_ttl = 1800 # 30 minutes
region_cache_ttl = 2592000 # 30 daysFresh data and debug logging:
# AWS Settings
default_region = "us-east-1"
# Debug
debug_mode = true
log_level = "DEBUG"
# Fresh data
pricing_cache_ttl = 3600
instance_cache_ttl = 43200
spot_cache_ttl = 600
# Conservative concurrency
tui_pricing_concurrency = 10
cli_pricing_concurrency = 20Optimized for scripts and pipelines:
# AWS Settings
default_region = "us-east-1"
# CLI optimized
cli_pricing_concurrency = 100
default_output_format = "json"
quiet_mode = true
# Aggressive caching (CI builds)
pricing_cache_ttl = 86400 # 24 hours
instance_cache_ttl = 604800 # 7 days
# Fast failure
api_timeout = 15
api_retry_attempts = 2
api_retry_delay = 1Symptom: Changes to config file have no effect.
Solutions:
- Check config file path:
~/.instancepedia/config.toml - Verify TOML syntax (use a TOML validator)
- Check for trailing whitespace or invalid characters
- Ensure file permissions are readable:
chmod 644 ~/.instancepedia/config.toml
Symptom: "Unable to locate credentials" error.
Solutions:
- Run
aws configureto set up credentials - Verify credentials file exists:
~/.aws/credentials - Check
AWS_PROFILEenvironment variable - Verify IAM permissions (see Required AWS Permissions)
Symptom: "Rate exceeded" or "Throttling" errors.
Solutions:
- Reduce concurrency:
tui_pricing_concurrency = 10 cli_pricing_concurrency = 20
- Increase cache TTL to reduce API calls:
pricing_cache_ttl = 21600 # 6 hours
- Wait a few minutes and retry
- Contact AWS support to increase API limits
Symptom: Stale data or cache corruption.
Solutions:
- Clear all caches:
instancepedia cache clear - Clear specific cache:
instancepedia cache clear --type pricing - Delete cache directory:
rm -rf ~/.instancepedia/cache/ - Restart instancepedia
- QUICKSTART.md - Get started quickly
- CLI_REFERENCE.md - All CLI commands
- FEATURES.md - Complete feature list
- EXAMPLES.md - Real-world scenarios