diff --git a/web/packages/shared/services/databases/databases.ts b/web/packages/shared/services/databases/databases.ts index 4de5794e0f28d..a11ca503cba52 100644 --- a/web/packages/shared/services/databases/databases.ts +++ b/web/packages/shared/services/databases/databases.ts @@ -14,14 +14,34 @@ * limitations under the License. */ -export type DbType = 'redshift' | 'rds' | 'gcp' | 'self-hosted'; +export type DbType = + | 'self-hosted' + | 'rds' + | 'rdsproxy' + | 'redshift' + | 'redshift-serverless' + | 'gcp' + | 'azure' + | 'elasticache' + | 'memorydb' + | 'keyspace' + | 'cassandra' + | 'dynamodb' + | 'opensearch'; export type DbProtocol = | 'postgres' | 'mysql' | 'mongodb' + | 'oracle' + | 'redis' + | 'cockroachdb' | 'sqlserver' - | 'redis'; + | 'snowflake' + | 'cassandra' + | 'elasticsearch' + | 'opensearch' + | 'dynamodb'; const formatProtocol = (input: DbProtocol) => { switch (input) { @@ -35,6 +55,14 @@ const formatProtocol = (input: DbProtocol) => { return 'SQL Server'; case 'redis': return 'Redis'; + case 'oracle': + return 'Oracle'; + case 'cockroachdb': + return 'CockroachDB'; + case 'cassandra': + return 'Cassandra'; + case 'elasticsearch': + return 'Elasticsearch'; default: return input; } @@ -43,12 +71,38 @@ const formatProtocol = (input: DbProtocol) => { export const formatDatabaseInfo = (type: DbType, protocol: DbProtocol) => { const output = { type, protocol, title: '' }; + switch (protocol) { + case 'snowflake': + output.title = 'Snowflake'; + return output; + } switch (type) { case 'rds': - output.title = `RDS ${formatProtocol(protocol)}`; + output.title = `Amazon RDS ${formatProtocol(protocol)}`; + return output; + case 'rdsproxy': + output.title = `Amazon RDS Proxy ${formatProtocol(protocol)}`; return output; case 'redshift': - output.title = 'Redshift'; + output.title = 'Amazon Redshift'; + return output; + case 'redshift-serverless': + output.title = 'Amazon Redshift Serverless'; + return output; + case 'elasticache': + output.title = 'Amazon ElastiCache'; + return output; + case 'memorydb': + output.title = 'Amazon MemoryDB'; + return output; + case 'keyspace': + output.title = 'Amazon Keyspaces'; + return output; + case 'dynamodb': + output.title = 'Amazon DynamoDB'; + return output; + case 'opensearch': + output.title = 'Amazon OpenSearch'; return output; case 'self-hosted': output.title = `Self-hosted ${formatProtocol(protocol)}`; @@ -56,6 +110,9 @@ export const formatDatabaseInfo = (type: DbType, protocol: DbProtocol) => { case 'gcp': output.title = `Cloud SQL ${formatProtocol(protocol)}`; return output; + case 'azure': + output.title = `Azure ${formatProtocol(protocol)}`; + return output; default: output.title = `${type} ${formatProtocol(protocol)}`; return output; diff --git a/web/packages/teleport/src/services/databases/databases.test.ts b/web/packages/teleport/src/services/databases/databases.test.ts index 6cd1b45423f94..333dd54ddca63 100644 --- a/web/packages/teleport/src/services/databases/databases.test.ts +++ b/web/packages/teleport/src/services/databases/databases.test.ts @@ -32,7 +32,7 @@ test('correct formatting of database fetch response', async () => { { name: 'aurora', description: 'PostgreSQL 11.6: AWS Aurora', - type: 'RDS PostgreSQL', + type: 'Amazon RDS PostgreSQL', protocol: 'postgres', names: [], users: [], @@ -64,16 +64,29 @@ test('null response from database fetch', async () => { describe('correct formatting of all type and protocol combos', () => { test.each` - type | protocol | combined - ${'self-hosted'} | ${'mysql'} | ${'Self-hosted MySQL/MariaDB'} - ${'rds'} | ${'mysql'} | ${'RDS MySQL/MariaDB'} - ${'self-hosted'} | ${'postgres'} | ${'Self-hosted PostgreSQL'} - ${'rds'} | ${'postgres'} | ${'RDS PostgreSQL'} - ${'gcp'} | ${'postgres'} | ${'Cloud SQL PostgreSQL'} - ${'redshift'} | ${'postgres'} | ${'Redshift'} - ${'self-hosted'} | ${'sqlserver'} | ${'Self-hosted SQL Server'} - ${'self-hosted'} | ${'redis'} | ${'Self-hosted Redis'} - ${'some other type'} | ${'some other protocol'} | ${'some other type some other protocol'} + type | protocol | combined + ${'self-hosted'} | ${'mysql'} | ${'Self-hosted MySQL/MariaDB'} + ${'rds'} | ${'mysql'} | ${'Amazon RDS MySQL/MariaDB'} + ${'self-hosted'} | ${'postgres'} | ${'Self-hosted PostgreSQL'} + ${'rds'} | ${'postgres'} | ${'Amazon RDS PostgreSQL'} + ${'rdsproxy'} | ${'sqlserver'} | ${'Amazon RDS Proxy SQL Server'} + ${'gcp'} | ${'postgres'} | ${'Cloud SQL PostgreSQL'} + ${'redshift'} | ${'postgres'} | ${'Amazon Redshift'} + ${'redshift-serverless'} | ${'postgres'} | ${'Amazon Redshift Serverless'} + ${'dynamodb'} | ${'dynamodb'} | ${'Amazon DynamoDB'} + ${'elasticache'} | ${'redis'} | ${'Amazon ElastiCache'} + ${'memorydb'} | ${'redis'} | ${'Amazon MemoryDB'} + ${'opensearch'} | ${'opensearch'} | ${'Amazon OpenSearch'} + ${'keyspace'} | ${'cassandra'} | ${'Amazon Keyspaces'} + ${'self-hosted'} | ${'sqlserver'} | ${'Self-hosted SQL Server'} + ${'self-hosted'} | ${'redis'} | ${'Self-hosted Redis'} + ${'self-hosted'} | ${'mongodb'} | ${'Self-hosted MongoDB'} + ${'self-hosted'} | ${'cassandra'} | ${'Self-hosted Cassandra'} + ${'self-hosted'} | ${'cockroachdb'} | ${'Self-hosted CockroachDB'} + ${'self-hosted'} | ${'oracle'} | ${'Self-hosted Oracle'} + ${'self-hosted'} | ${'snowflake'} | ${'Snowflake'} + ${'self-hosted'} | ${'elasticsearch'} | ${'Self-hosted Elasticsearch'} + ${'some other type'} | ${'some other protocol'} | ${'some other type some other protocol'} `( 'should combine type: $type and protocol: $protocol correctly', async ({ type, protocol, combined }) => {