Commit Graph
29 Commits
Author SHA1 Message Date
Gavin Frazar ef43b4cef9 azure mysql and postgresql flex server discovery (#19759)
* Move GCP cloud clients into a separate interface
* Add azure mysql/postgresql flex server support
* Add teleport db configure create support for azure postgres/mysql flex servers
* discover both single and flexi server with 'mysql' and 'postgres' db types.
* go doc gcp interface
* Add is_flexi_server to database Azure config
2023-01-09 18:48:08 +00:00
Gavin Frazar 5bb0ef15db add dynamodb database access (#18843)
* Add a new db engine
* Add tests for new engine
* Update tsh db subcommands
* Refactor error message and suggestions for unsupported tsh commands
* Add dynamodb to test plan
* Add AWS external ID to db config and update protos
2022-12-30 18:22:30 +00:00
Marco André Dinis 6286488be3 Database: validate AWS Account ID (#19638)
When the AWS Account ID is provided, we must check that it is a valid
one.

AWS Account ID is a well documented field: 12-digit string

This check is meant to prevent typos when creating Databases mainly from
the Web UI in the context of Teleport Discover.
2022-12-28 12:42:39 +00:00
STeve (Xin) Huang be77dadd55 Move database fetchers to discovery service (#19510) 2022-12-26 20:46:25 +00:00
STeve (Xin) Huang 43529b2653 AWS Redshift Serverless auto-discovery (#18974) 2022-12-09 21:23:56 +00:00
STeve (Xin) Huang d74ae4ee64 Downgrade DNS errors to a warning log when creating MongoDB databases (#18942) 2022-12-01 19:53:14 +00:00
Gabriel Corado fa15a7c4c4 Azure SQL Server auto discovery (#17745) 2022-11-28 15:02:49 +00:00
STeve (Xin) Huang 72b5a2f81f Add extra database validations to CreateDatabase (#18776) 2022-11-25 16:12:53 +00:00
STeve (Xin) Huang 1b0a083b9d Database access AWS RDS Proxy support (#17005) 2022-10-31 15:21:31 +00:00
Jakub Nyckowski 0ee91f6c37 Enable GCI linter (#17894) 2022-10-28 20:20:28 +00:00
STeve (Xin) Huang d319ee2734 Azure Cache for Redis auto discovery (#16755) 2022-10-03 20:54:44 +00:00
STeve (Xin) Huang aabced42dc Azure Cache for Redis engine support (#16551) 2022-09-29 18:25:53 +00:00
Gavin FrazarandMarek Smoliński f02b30b18e Azure MySQL and PostgreSQL DB Discovery (#15745)
* Add Azure auto-discovery configuration fields

* Init databases if azure matchers are in config

* Use AzureMatchers in db service

* Use all azure subscriptions/resource groups if omitted in matcher

* Add azure config tests

* Go mod tidy to update dependencies

* Add azure response error conversion

* Check for azure access denied and give a helpful error message

* Add azure subscriptions api

* Add azure mysql/postgresql api and wrappers

* Test generic db server for azure

* Make server properties its own type

* Convert server types manually instead of via json

* Move server list method selection logic out of api client

* Update azure db server tests

* Fixup merge

* Update comments

* Update more comments and remove junk code

* Move all azure api into lib/cloud/azure

* Update state and version checks

* Convert Azure DB Server into database

* Add mutex to subscription client for caching, just in case

* Test database conversion from azure db server

* Refactor common code

* Add azure matchers to watch config

* Remove unused imports

* Use common max pages in memorydb users

* Add azure clients to cloud clients

* Add azure fetchers to watcher

* Skip fetcher NotFound errors

* Add azure watcher tests

* Fix test comment

* Add wildcard region matching

* Remove redundant import

* Update lib/srv/db/cloud/watchers/azure.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Move db server listing logic into separate func

* Refactor some db conversion code

* Use local var to cache sub IDs

* Rename azure subscription client

* Rename azure subscription client and remove sub ID caching

* Move azure cloud clients into separate embedded interface

* Update watcher test for 'NotFound' handling

* Embed azureClients struct

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/subscriptions_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/cloud/azure/db_server_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Rename azure subscription client and remove sub ID caching

* Add reference links for azure db ports

* Move indirect dep into group

* Wrap all converted azure response errors

* Remove unreachable panic

* Godoc DBServer

* Remove maxPages arg to azure client funcs

* Gofmt

* Spacing between copyright and package

* import order

* Update lib/srv/db/cloud/watchers/azure.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Fix import order

* Refactor region matching

* Fix usage of azure clients to remove max pages arg

* Query azure subscriptions in fetcher.Get if matching wildcard subscription

* Fix azure matcher construction

* Test azure fetcher discovers new subscriptions

* Remove unused test helper func

* Set azure database resource id metadata

* Log errors when fetching from azure subscription fails

* Use more readable protocol in azure db description

* Get azure mysql engine version from labels

* Update lib/srv/db/cloud/watchers/watcher_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

* Update lib/srv/db/cloud/watchers/watcher_test.go

Co-authored-by: Marek Smoliński <marek@goteleport.com>

Co-authored-by: Marek Smoliński <marek@goteleport.com>
2022-08-30 23:21:36 +00:00
Zac Bergquist d1c6b0618e Fix lint warnings (#15312)
Mostly duplicated imports and redundant types in struct literals.
2022-08-08 20:20:29 +00:00
Krzysztof Skrzętnicki 229ef5992c Allow to override db name using AWS tag. (#14740)
* Allow to override db name using AWS tag `teleport.dev/database-name`.
* If a single AWS DB maps to several Teleport DB entries, the override will become part of the name.
2022-07-22 17:49:37 +00:00
STeve (Xin) Huang 85016a9a3e MemoryDB support (#13069) 2022-06-14 19:09:31 +00:00
STeve (Xin) Huang 5c6deb7d9d ElastiCache support - the basics (#12209) 2022-05-13 15:09:20 +00:00
d5d2a72ace Advertise correct MySQL server version (#12196)
Teleport now will try to extract MySQL server version from initial handshake package instead of sending `8.0.0-Teleport` every time. This string can be overridden by new configuration option `mysql.server_version`. On DB service start Teleport will also try to fetch the current version from MySQL/MariaDB instance. After that the server version will be updated on every successful connection to keep it up to date.

Co-authored-by: STeve (Xin) Huang <xin.huang@goteleport.com>
Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
2022-04-29 22:22:11 +00:00
Alex McGrath cf0d569067 Update IsValidLabelKey to include ':' (#11384) 2022-03-28 12:25:17 +00:00
STeve (Xin) Huang fd12e934ee RDS & Redshfit support for AWS China regions (part 1?) (#10560) 2022-03-25 17:40:51 +00:00
6eebe8dfa7 Add MariaDB to AWS RDS auto discovery (#10333)
Add support for MariaDB AWS RDS with IAM authentication version 10.6+.

Co-authored-by: Paul Gottschling <paul.gottschling@goteleport.com>
Co-authored-by: Alan Parra <alan.parra@goteleport.com>
Co-authored-by: Roman Tkachenko <roman@goteleport.com>
2022-03-09 16:32:44 +00:00
STeve (Xin) Huang 6e49a3f343 Fix crash when AWS Redshift does not have Endpoint info (#10597) 2022-02-28 18:43:58 +00:00
STeve Huang 47bc1b780c support for redshift auto discovery (#9851) 2022-01-27 17:11:30 +00:00
STeve Huang 09d049ba58 Auto discovery aurora reader and custom endpoints (#9668) 2022-01-24 17:38:14 -05:00
JoelandZac Bergquist 62173e096b use google/uuid instead of pborman/uuid (#9793)
* replace imports

* use google/uuid

* fix test

* reverse changelog changes

* update gomod

* zac steps

* tidy

Co-authored-by: Zac Bergquist <zac.bergquist@goteleport.com>
2022-01-19 23:44:48 +00:00
STeve Huang 730352c3b0 omit invalid aws tags in rds autodiscovery (#9742) 2022-01-12 10:52:52 -05:00
STeve Huang 1be9e81bf1 do not register Aurora serverless db clusters (#9386) 2022-01-06 21:30:47 +00:00
Roman Tkachenko ce547953db Automatically import RDS databases (#8481) 2021-10-15 11:03:10 -07:00
Roman Tkachenko 25aeeae3ac Adding database resource API and tctl commands (#7792) 2021-08-09 07:14:39 -07:00