Skip to content

🐛 Handle DNS resolution errors in ElastiCache discovery#6902

Merged
tas50 merged 1 commit intomainfrom
fix/elasticache-dns-error
Mar 14, 2026
Merged

🐛 Handle DNS resolution errors in ElastiCache discovery#6902
tas50 merged 1 commit intomainfrom
fix/elasticache-dns-error

Conversation

@tas50
Copy link
Copy Markdown
Member

@tas50 tas50 commented Mar 13, 2026

Summary

  • ElastiCache DescribeCacheClusters and DescribeServerlessCaches fail with "no such host" DNS errors in regions where ElastiCache endpoints don't resolve
  • Added IsServiceNotAvailableInRegionError checks to both getCacheClusters and getServerlessCaches, matching the established pattern used by 12+ other AWS resources (memorydb, msk, opensearch, elb, cognito, etc.)
  • Unavailable regions are now gracefully skipped with a debug log instead of failing the entire discovery

Test plan

  • Build and install AWS provider (make providers/build/aws && make providers/install/aws)
  • Run mql run aws -c "aws.elasticache.cacheClusters" — should no longer error on regions where ElastiCache DNS doesn't resolve
  • Verify clusters are still returned from regions where ElastiCache is available

🤖 Generated with Claude Code

ElastiCache endpoints may not resolve in all regions, causing
discovery to fail with "no such host" errors. Use the existing
IsServiceNotAvailableInRegionError helper to gracefully skip
unavailable regions, matching the pattern used by 12+ other
AWS resources (memorydb, msk, opensearch, etc.).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@mondoo-code-review mondoo-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ElastiCache discovery no longer fails when a region's DNS endpoint is unavailable.

@tas50
Copy link
Copy Markdown
Member Author

tas50 commented Mar 13, 2026

Fixes discovery errors we get on the CLI right now:

x error during discovery error="operation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.ap-south-1.amazonaws.com/\": POST https://elasticache.ap-south-1.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.ap-south-1.amazonaws.com/\": dial tcp: lookup elasticache.ap-south-1.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.eu-north-1.amazonaws.com/\": POST https://elasticache.eu-north-1.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.eu-north-1.amazonaws.com/\": dial tcp: lookup elasticache.eu-north-1.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.eu-west-3.amazonaws.com/\": POST https://elasticache.eu-west-3.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.eu-west-3.amazonaws.com/\": dial tcp: lookup elasticache.eu-west-3.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.eu-west-2.amazonaws.com/\": POST https://elasticache.eu-west-2.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.eu-west-2.amazonaws.com/\": dial tcp: lookup elasticache.eu-west-2.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.eu-west-1.amazonaws.com/\": POST https://elasticache.eu-west-1.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.eu-west-1.amazonaws.com/\": dial tcp: lookup elasticache.eu-west-1.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.ap-northeast-3.amazonaws.com/\": POST https://elasticache.ap-northeast-3.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.ap-northeast-3.amazonaws.com/\": dial tcp: lookup elasticache.ap-northeast-3.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.ap-northeast-2.amazonaws.com/\": POST https://elasticache.ap-northeast-2.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.ap-northeast-2.amazonaws.com/\": dial tcp: lookup elasticache.ap-northeast-2.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.ap-northeast-1.amazonaws.com/\": POST https://elasticache.ap-northeast-1.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.ap-northeast-1.amazonaws.com/\": dial tcp: lookup elasticache.ap-northeast-1.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.ca-central-1.amazonaws.com/\": POST https://elasticache.ca-central-1.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.ca-central-1.amazonaws.com/\": dial tcp: lookup elasticache.ca-central-1.amazonaws.com: no such host\noperation error ElastiCache: DescribeCacheClusters, https response error StatusCode: 0, RequestID: , request send failed, Post \"https://elasticache.sa-east-1.amazonaws.com/\": POST https://elasticache.sa-east-1.amazonaws.com/ giving up after 3 attempt(s): Post \"https://elasticache.sa-east-1.amazonaws.com/\": dial tcp: lookup elasticache.sa-east-1.amazonaws.com: no such host"
 /aws/lambda/MondooUpdater                                                                                   ━━━━━━━━━━━━━━━━━━━━━━ 100% score: HIGH

@github-actions
Copy link
Copy Markdown
Contributor

Test Results

5 450 tests  ±0   5 446 ✅ ±0   2m 31s ⏱️ +12s
  412 suites ±0       4 💤 ±0 
   31 files   ±0       0 ❌ ±0 

Results for commit 2dce76c. ± Comparison against base commit e29a520.

@tas50 tas50 merged commit a960199 into main Mar 14, 2026
22 checks passed
@tas50 tas50 deleted the fix/elasticache-dns-error branch March 14, 2026 01:36
@github-actions github-actions bot locked and limited conversation to collaborators Mar 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant