Skip to content

Web: Add auto enrolling capabilities to RDS discover flow#35646

Merged
kimlisa merged 15 commits intomasterfrom
lisa/rds-auto-discover
Jan 8, 2024
Merged

Web: Add auto enrolling capabilities to RDS discover flow#35646
kimlisa merged 15 commits intomasterfrom
lisa/rds-auto-discover

Conversation

@kimlisa
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa commented Dec 12, 2023

part of #35434

requires

recommend reviewing by commit

  • cloud, RDS flow now defaults to auto-enrolling (the toggler is pretty bad, it blends in with the background, i am working to update the design) (after xmas breka)
  • self-hosted, we show a user a link to start a discovery service on their own for now (in another PR)
  • some tweaks
    • add more disabled state for RDS list
    • auto select integration if integration list has only one item
    • refactoring storybook/test

e2e testing in cloud staging:

https://www.loom.com/share/c68f402633134ca8be089ea01ac809d4?sid=fccb5441-c25c-4384-931e-203cdc166d2a

relevant stories:

http://127.0.0.1:9002/?path=/story/teleport-discover-database-enrollrds--instance-list-for-cloud
http://127.0.0.1:9002/?path=/story/teleport-discover-database-setupaccess--with-traits-aws-postgres-auto-enroll
http://127.0.0.1:9002/?path=/story/teleport-discover-database-deploy-auto--init-with-auto-enroll

changelog: Add auto-enrolling capabilities to RDS discover flow in the web UI

Copy link
Copy Markdown
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass. I will try to test it tomorrow.

Comment thread web/packages/teleport/src/services/discovery/discovery.ts Outdated
Comment thread web/packages/teleport/src/services/discovery/types.ts Outdated
Comment thread web/packages/teleport/src/services/discovery/types.ts Outdated
Comment thread web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx Outdated
Comment thread web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts Outdated
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Dec 13, 2023

@gzdunek this PR isn't ready for testing, ran into some issues (or rather there are some things missing)

i'm debating keeping this PR as is, and create another PR based on this to complete, since this PR is already kinda noisy.

Comment thread web/packages/teleport/src/Discover/Shared/Aws/RadioCell.tsx Outdated
function onProceed(traitOpts: Partial<Record<Trait, Option[]>>) {
switch (props.resourceSpec.kind) {
function onProceed(
traitOpts: Partial<Record<Trait, Option[]>>,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is Partial needed here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah for each case we are partially (depending on resource) updating the fields defined here:

// UserTraits contain fields that define traits for local accounts.
export interface UserTraits {
  // logins is the list of logins that this user is allowed to
  // start SSH sessions with.
  logins: string[];
  // databaseUsers is the list of db usernames that this user is
  // allowed to open db connections as.
  databaseUsers: string[];
  // databaseNames is the list of db names that this user can connect to.
  databaseNames: string[];
  // kubeUsers is the list of allowed kube logins.
  kubeUsers: string[];
  // kubeGroups is the list of allowed kube groups for a kube cluster.
  kubeGroups: string[];
  // windowsLogins is the list of logins that this user
  // is allowed to start desktop sessions.
  windowsLogins: string[];
  // awsRoleArns is a list of aws roles this user is allowed to assume.
  awsRoleArns: string[];
}

@gzdunek
Copy link
Copy Markdown
Contributor

gzdunek commented Dec 13, 2023

(or rather there are some things missing)
i'm debating keeping this PR as is, and create another PR based on this to complete, since this PR is already kinda noisy.

In that case, I think it makes sense to create another PR.

@kimlisa kimlisa force-pushed the lisa/rds-auto-discover branch from 637f7ad to b29558c Compare December 19, 2023 05:02
@gravitational gravitational deleted a comment from github-actions Bot Dec 19, 2023
@kimlisa kimlisa changed the base branch from master to lisa/discover-preserve-selected-region December 19, 2023 08:10
@kimlisa kimlisa force-pushed the lisa/rds-auto-discover branch from bbc4604 to 66c1518 Compare December 19, 2023 08:12
@gravitational gravitational deleted a comment from github-actions Bot Dec 19, 2023
@gravitational gravitational deleted a comment from github-actions Bot Dec 19, 2023
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Dec 19, 2023

@ryanclark @gzdunek this is ready for another look. i decided to keep it all in one PR (it wasn't that much extra work, but maybe i'm just kidding myself...)

it's not ready to test yet since the backend portion is still WIP

and i'm so sorry that this PR became so noisy 😓

new parts starts with this commit: 4d4a30d

@kimlisa kimlisa marked this pull request as draft December 20, 2023 04:47
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Dec 20, 2023

drafted, another iteration requires changing some things again

Base automatically changed from lisa/discover-preserve-selected-region to master December 22, 2023 04:45
@gravitational gravitational deleted a comment from github-actions Bot Dec 22, 2023
@gravitational gravitational deleted a comment from github-actions Bot Dec 22, 2023
@gravitational gravitational deleted a comment from github-actions Bot Dec 22, 2023
@gravitational gravitational deleted a comment from github-actions Bot Dec 22, 2023
@kimlisa kimlisa force-pushed the lisa/rds-auto-discover branch from d4731ab to 145144a Compare December 22, 2023 05:51
@kimlisa kimlisa changed the base branch from master to lisa/collect-required-vpcs December 22, 2023 05:51
@kimlisa kimlisa marked this pull request as ready for review December 22, 2023 05:52
@kimlisa kimlisa requested review from gzdunek and ryanclark December 22, 2023 05:53
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Dec 22, 2023

Copy link
Copy Markdown
Contributor

@gzdunek gzdunek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code generally looks good.

this is finally read for review. if you are interested in e2e testing, i have a cluster set up for it just ping me

Yeah, I'd like to test it!

Comment thread web/packages/teleport/src/Discover/Database/SetupAccess/SetupAccess.tsx Outdated
Base automatically changed from lisa/collect-required-vpcs to master December 22, 2023 16:48
- Existing traits is not made editable
- Minor refactor: pull data from useDiscover context
Refactor setup access story
- When enrolling and opting for auto discovery,
  we need to first collect all missing vpcs to determine
  if its required to deploy database agents, and then
  create a discovery config for a discovery service
- When auto deploying and opting for auto discovery,
  it is out scope for this iteration to allow user to
  define custom labels, select security groups, and
  "wait" for deploying all services to finish. Instead
  after deploy request is finished, we render a box
  that tells user it will take a minute to finish deploying
  and give a AWS dashboard link to view progress
- Setup access screen is the final step (skip test connection)
  and we render how to setup access for both mysql and postgres
  since auto discovery discovers all supported engine types.
@kimlisa kimlisa force-pushed the lisa/rds-auto-discover branch from 5e744a4 to 13f4b14 Compare December 22, 2023 17:10
@kimlisa kimlisa force-pushed the lisa/rds-auto-discover branch from 13f4b14 to f4b4bcb Compare December 22, 2023 17:12
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Jan 5, 2024

ping @ryanclark

@kimlisa kimlisa enabled auto-merge January 8, 2024 17:11
@kimlisa kimlisa added this pull request to the merge queue Jan 8, 2024
Merged via the queue into master with commit c0d11f2 Jan 8, 2024
@kimlisa kimlisa deleted the lisa/rds-auto-discover branch January 8, 2024 17:37
@public-teleport-github-review-bot
Copy link
Copy Markdown

@kimlisa See the table below for backport results.

Branch Result
branch/v14 Failed

kimlisa added a commit that referenced this pull request Jan 8, 2024
* Add discovery config endpoint

* Add autoDiscoveryConfig field to meta

* Hide custom label for auto discover

* Pull out re-usable parts for storybook fixture

* Only allow adding new traits when auto-enrolling

- Existing traits is not made editable
- Minor refactor: pull data from useDiscover context

* Auto select integration if only one result

* Skip test connection when auto enrolling

Refactor setup access story

* Add auto enroll toggler

* Create finish component for auto discover

* Add more disabled row states

* Add clarifying notes

* Address CRs

* Finish auto discovery

- When enrolling and opting for auto discovery,
  we need to first collect all missing vpcs to determine
  if its required to deploy database agents, and then
  create a discovery config for a discovery service
- When auto deploying and opting for auto discovery,
  it is out scope for this iteration to allow user to
  define custom labels, select security groups, and
  "wait" for deploying all services to finish. Instead
  after deploy request is finished, we render a box
  that tells user it will take a minute to finish deploying
  and give a AWS dashboard link to view progress
- Setup access screen is the final step (skip test connection)
  and we render how to setup access for both mysql and postgres
  since auto discovery discovers all supported engine types.

* Address CR
github-merge-queue Bot pushed a commit that referenced this pull request Jan 9, 2024
…) (#36434)

* Web: Add auto enrolling capabilities to RDS discover flow (#35646)

* Add discovery config endpoint

* Add autoDiscoveryConfig field to meta

* Hide custom label for auto discover

* Pull out re-usable parts for storybook fixture

* Only allow adding new traits when auto-enrolling

- Existing traits is not made editable
- Minor refactor: pull data from useDiscover context

* Auto select integration if only one result

* Skip test connection when auto enrolling

Refactor setup access story

* Add auto enroll toggler

* Create finish component for auto discover

* Add more disabled row states

* Add clarifying notes

* Address CRs

* Finish auto discovery

- When enrolling and opting for auto discovery,
  we need to first collect all missing vpcs to determine
  if its required to deploy database agents, and then
  create a discovery config for a discovery service
- When auto deploying and opting for auto discovery,
  it is out scope for this iteration to allow user to
  define custom labels, select security groups, and
  "wait" for deploying all services to finish. Instead
  after deploy request is finished, we render a box
  that tells user it will take a minute to finish deploying
  and give a AWS dashboard link to view progress
- Setup access screen is the final step (skip test connection)
  and we render how to setup access for both mysql and postgres
  since auto discovery discovers all supported engine types.

* Address CR

* Update straggling test

* Web: Support auto discovery for self-hosted (#36027)

* Web: Support auto discovery for self-hosted

* Move doc instructions into web UI

* fix test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants