forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
externalconn,backupccl: add KMS support to External Connections
In cockroachdb#84931 we taught the `ExternalStorage` infrastructure to recognize the `external` URI scheme. In this change we do the same but for the `KMS` infrastructure. Concretely, a user is now able to create an external storage object that represent a gcp KMS URI. This can be done using the `CREATE EXTERNAL CONNECTION` syntax. The user is then able to point an operation in CockroachDB such as BACKUP,RESTORE,SHOW BACKUP to that KMS using an `external` URI. For example: ``` CREATE EXTERNAL CONNECTION backup AS 'nodelocal://1/foo'; CREATE EXTERNAL CONNECTION backupkms AS 'gs:///cmk?AUTH=implict'; BACKUP INTO 'external://foo' WITH kms='external://backupkms'; ``` Under the hood, we implement the `ConnectionDetails` interface for gcp KMS. This allows us to persist a row in the `external_connections` table when the object is created, and to `Dial` the underlying resource when the object is being used. The interfaces had to be tweaked slightly to accomodate for the fact that they are now being implemented by two different infrastructures `ExternalStorage` and `KMS`. This is an expected evolution, and will pave the way for our third and final support for changefeed `Sinks`. A large portion of this diff is just plumbing the appropriate environments throught the backup/restore code. This diff also adds KMS specific tests to `pkg/ccl/cloudccl/gcp` and tweaks our nightly job to run these tests with the configured credentials. Informs: cockroachdb#84753 Release note (sql change): GCP KMS can be represented as an External Connection object, that can be used during a backup or restore using the `external` URI.
- Loading branch information
1 parent
7c7baeb
commit 9df1e7c
Showing
48 changed files
with
1,035 additions
and
163 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.