Skip to content

Web: Add auto discover capability to EC2 enrollment#40243

Merged
kimlisa merged 1 commit into
masterfrom
lisa/auto-discover-eice
Apr 16, 2024
Merged

Web: Add auto discover capability to EC2 enrollment#40243
kimlisa merged 1 commit into
masterfrom
lisa/auto-discover-eice

Conversation

@kimlisa
Copy link
Copy Markdown
Contributor

@kimlisa kimlisa commented Apr 5, 2024

resolves #35435

New additions related to auto discover:

  • add discover toggler
    • self-hosted gets instructions on how to add one by themselves
    • cloud has a discovery service already running so just the toggler is required
  • when ready to enroll (click next), we gather all the required vpc and its subnets and than query for existing ec2 instsance connection endpoint with the vpc filter
    • if the queried results == to the vpc filter we sent it, that means all the endpoints has already been deployed (skips the deployment step, goes straight to set up access screen)
      • we poll only if the queried endpoints status is create-in-progress and poll until create-complete
    • if queried results != to the vpc filter we sent it, that means we need to deploy some endpoints (takes user to deployment step)
      • we poll until all the endpoints we deployed comes back as create-complete status

Demo
https://www.loom.com/share/4b5a6ac44c53452a9c05c946cc69ba0c

changelog: Add auto discover capability to EC2 enrollment in the web UI

@kimlisa kimlisa requested a review from rudream April 5, 2024 05:47
@github-actions github-actions Bot requested review from avatus and ibeckermayer April 5, 2024 05:48
@kimlisa kimlisa removed the request for review from ibeckermayer April 5, 2024 05:49
Comment on lines +250 to +252
.then(resp => {
return resp ?? [];
});
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

what would make this resp null or undefined?

Copy link
Copy Markdown
Contributor Author

@kimlisa kimlisa Apr 9, 2024

Choose a reason for hiding this comment

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

it's not guaranteed that the backend will return an empty array, as an empty array, it can come back as null/undefined

i think it's when you define something like this:

var someSlice []string

if this gets sent as is, it's undefined. i don't remember where but it bit us before, so anytime i expect an array, i just check for undefined/null

@kimlisa kimlisa force-pushed the lisa/auto-discover-eice branch from 95847cf to 84fbe3e Compare April 10, 2024 08:48
@kimlisa
Copy link
Copy Markdown
Contributor Author

kimlisa commented Apr 10, 2024

@rudream @avatus ok i finished writing tests, PTAL! 🙏

@kimlisa kimlisa requested a review from avatus April 10, 2024 08:48
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
This may take a few minutes..
This may take a few minutes.

or "..."?

@public-teleport-github-review-bot public-teleport-github-review-bot Bot removed the request for review from rudream April 12, 2024 16:33
@kimlisa kimlisa force-pushed the lisa/auto-discover-eice branch from 84fbe3e to d1bccb3 Compare April 16, 2024 19:46
@kimlisa kimlisa enabled auto-merge April 16, 2024 19:47
@kimlisa kimlisa added this pull request to the merge queue Apr 16, 2024
Merged via the queue into master with commit 99d715a Apr 16, 2024
@kimlisa kimlisa deleted the lisa/auto-discover-eice branch April 16, 2024 20:04
@public-teleport-github-review-bot
Copy link
Copy Markdown

@kimlisa See the table below for backport results.

Branch Result
branch/v15 Failed

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.

UI for Discover EC2 auto-discovery support

3 participants