feat: ElastiCache

This commit is contained in:
Zakaria
2026-10-05 16:03:05 -04:00
parent c0d3e5f402
commit c86b4554c0
27 changed files with 2454 additions and 5 deletions
@@ -25,4 +25,11 @@ describe('dataExplorerPath', () => {
test('does not expose unsupported RDS engines as SQL explorers', () => {
expect(dataExplorerKind(rdsInstance('mariadb'))).toBeUndefined()
})
test('enables the Redis explorer only for Redis and Valkey ElastiCache resources', () => {
const cache = (engine: string): CloudResource => ({...rdsInstance(engine), service: 'elasticache', type: 'replication-group'})
expect(dataExplorerKind(cache('redis'))).toBe('redis')
expect(dataExplorerPath({...cache('valkey'), type: 'cache-cluster'})).toBe('/cloud-explorer/aws/elasticache/orders-db/data')
expect(dataExplorerKind(cache('memcached'))).toBeUndefined()
})
})
+4 -1
View File
@@ -1,12 +1,15 @@
import type {CloudResource} from '@/types/resource'
export function dataExplorerKind(resource: CloudResource): 'dynamodb' | 'cosmos' | 'sql' | undefined {
export function dataExplorerKind(resource: CloudResource): 'dynamodb' | 'cosmos' | 'sql' | 'redis' | undefined {
if (resource.cloud === 'aws' && resource.service === 'nosql' && resource.type === 'dynamodb-table') return 'dynamodb'
if (resource.cloud === 'azure' && resource.service === 'nosql' && resource.type === 'cosmos-database') return 'cosmos'
if (resource.cloud === 'azure' && resource.service === 'database' &&
(resource.type === 'sql-server' || resource.type === 'postgres-flexible-server')) return 'sql'
if (resource.cloud === 'aws' && resource.service === 'database' && resource.type === 'db-instance' &&
(resource.engine === 'postgres' || resource.engine === 'mysql')) return 'sql'
if (resource.cloud === 'aws' && resource.service === 'elasticache' &&
(resource.type === 'replication-group' || resource.type === 'cache-cluster') &&
(resource.engine === 'redis' || resource.engine === 'valkey')) return 'redis'
}
export function dataExplorerPath(resource: CloudResource): string | undefined {