Commit Graph
34 Commits
Author SHA1 Message Date
Gavin Frazar 5c752c4df8 Fixup teleport db configure create (#20968)
* add missing flags
* fix config generation bugs
* always wrap generated strings value in quotes
* parse and check generated config
* update tests for db agent config gen
2023-02-11 00:54:07 +00:00
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
STeve (Xin) Huang 33cd984ed3 Fix unknown status type "ACTIVE" for Redshift Serverless Endpoint (#19855) 2023-01-04 21:46:05 +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
Jakub NyckowskiandAlan Parra 9c80f3802e Enable nolintlint linter (#19406)
* Enable nolintlint linter

* Fix nolint comments in the api package

* Fix RDP client comment

* Address review comment

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

* Allow unused for nolintlint linter

* Remove redundant casting

* Add comment on why allowed unused is enabled

Co-authored-by: Alan Parra <alan.parra@goteleport.com>

Co-authored-by: Alan Parra <alan.parra@goteleport.com>
2022-12-16 21:13:58 +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
STeve (Xin) Huang f2cf36a450 AWS Redshift Serverless engine support (#18651) 2022-12-01 15:36:48 +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
Zac Bergquist da7680ad0b Use x/exp/slices instead of home grown utilities (#18524)
We were inconsistent throughout the codebase and would sometimes
use the slices package and other times use our own equivalents
in api/.

This removes our versions in favor of the golang.org/x package that
does the same, which has the added benefit of reducing the surface
area of the public API module.

Note: despite existing uses of the slices package, for some reason
it didn't show up in go.mod or go.sum. Fixed that too.
2022-11-17 15:25:46 +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
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
Krzysztof Skrzętnicki 396d04fa9e Rename teleport.dev/database-name to teleport.dev/database_name to match convention. (#14922) 2022-07-27 16:03:07 +02: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
Noah Stride 02b4f8575f Configure linter to catch British 🇬🇧 spellings 🇺🇸 🦅 📖 (#14363)
* configure golangci-lint misspell to check for anglicized spellings

* Americanize spellings

* fix aws constant value with british spelling 🇬🇧

* update api types with americanized spellings

* use american spellings .cloudbuild/scripts
2022-07-14 10:51:23 +00:00
STeve (Xin) Huang 85016a9a3e MemoryDB support (#13069) 2022-06-14 19:09:31 +00:00
STeve (Xin) Huang e6ad580186 Aurora serverless v2 support (#13154) 2022-06-06 16:31:09 +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
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 fa3387785b skip databases that are not available during auto discovery (#10699) 2022-03-04 20:37:32 +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
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 3410bc8594 Dynamically register/unregister database resources (#7957) 2021-09-01 15:27:02 -07:00
Roman Tkachenko 25aeeae3ac Adding database resource API and tctl commands (#7792) 2021-08-09 07:14:39 -07:00