Skip to content

Commit a960199

Browse files
tas50claude
andauthored
🐛 Handle DNS resolution errors in ElastiCache discovery (#6902)
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>
1 parent e29a520 commit a960199

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

providers/aws/resources/aws_elasticache.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ func (a *mqlAwsElasticache) getCacheClusters(conn *connection.AwsConnection) []*
6767
log.Warn().Str("region", region).Msg("error accessing region for AWS API")
6868
return res, nil
6969
}
70+
if IsServiceNotAvailableInRegionError(err) {
71+
log.Debug().Str("region", region).Msg("elasticache service not available in region")
72+
return res, nil
73+
}
7074
return nil, err
7175
}
7276
for _, cluster := range clusters.CacheClusters {
@@ -205,6 +209,10 @@ func (a *mqlAwsElasticache) getServerlessCaches(conn *connection.AwsConnection)
205209
log.Warn().Str("region", region).Msg("error accessing region for AWS API")
206210
return res, nil
207211
}
212+
if IsServiceNotAvailableInRegionError(err) {
213+
log.Debug().Str("region", region).Msg("elasticache service not available in region")
214+
return res, nil
215+
}
208216
return nil, err
209217
}
210218
for _, cache := range caches.ServerlessCaches {

0 commit comments

Comments
 (0)