New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WebDiscover] Determine if IAM policy setup step can be skipped #29724
Conversation
Should I wait for #29721 to land to review this? |
@ibeckermayer @ryanclark ready for review |
web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.test.tsx
Show resolved
Hide resolved
web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.test.tsx
Show resolved
Hide resolved
web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/Discover/Database/CreateDatabase/useCreateDatabase.ts
Outdated
Show resolved
Hide resolved
web/packages/teleport/src/Discover/Database/DeployService/AutoDeploy/AutoDeploy.tsx
Show resolved
Hide resolved
1b4a151
to
099006f
Compare
friendly ping @ibeckermayer @ryanclark |
f4ce632
to
6a01dd5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving just so you're not blocked on waiting for 2nd approval as we need to ship this.
const dbServer = res.agents[0]; | ||
if ( | ||
!isAws || | ||
!dbServer.aws?.iamPolicyStatus || | ||
dbServer.aws?.iamPolicyStatus === IamPolicyStatus.Unspecified | ||
) { | ||
return dbServer; | ||
} | ||
|
||
if (dbServer.aws.iamPolicyStatus !== IamPolicyStatus.Pending) { | ||
return dbServer; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe these are equivalent:
const dbServer = res.agents[0]; | |
if ( | |
!isAws || | |
!dbServer.aws?.iamPolicyStatus || | |
dbServer.aws?.iamPolicyStatus === IamPolicyStatus.Unspecified | |
) { | |
return dbServer; | |
} | |
if (dbServer.aws.iamPolicyStatus !== IamPolicyStatus.Pending) { | |
return dbServer; | |
} | |
const dbServer = res.agents[0]; | |
if ( | |
!isAws || // If not AWS, then we return the first thing we get back. | |
dbServer.aws?.iamPolicyStatus !== IamPolicyStatus.Pending // If AWS and aws.iamPolicyStatus is undefined or non-pending, we return the dbServer. | |
) { | |
return dbServer; | |
} | |
// Otherwise continue polling |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
An error can return if a user tried to deploy before the changes are fully propagated. Notify the user that this can be a reason why an error returned and try again.
Clarify poller callback with comment Make IAMPolicy screen optional
f05b5c4
to
99d940b
Compare
* Prevent going back from access screen if deploying got skipped * Configuring perms for the user can take some time An error can return if a user tried to deploy before the changes are fully propagated. Notify the user that this can be a reason why an error returned and try again. * Check if IAM policy already configured with new dbs Clarify poller callback with comment Make IAMPolicy screen optional
…ondition (#29978) * WebDiscover: Finish auto deploy screen (iam configure script) (#28621) * Define the return type * Add endpoint for config script * Store the entire integration object instead of just the name * Build the correct script string, renames, emit event * Enable auto deploy as default * Fix script endpoint and update story * Add regex check, update story * Touch ups, add test * Address CR * Remove sudo from bash command * Make into ui friendly object * [WebDiscover] Determine if IAM policy setup step can be skipped (#29724) * Prevent going back from access screen if deploying got skipped * Configuring perms for the user can take some time An error can return if a user tried to deploy before the changes are fully propagated. Notify the user that this can be a reason why an error returned and try again. * Check if IAM policy already configured with new dbs Clarify poller callback with comment Make IAMPolicy screen optional
depends on #29721
Checks if the registered database has a configured IAM policy or not (it's a screen where you create and attach an policy to the ec2 instance you deployed the db service in). Depending on this state, a user can skip both the deploy service screen AND the IAM policy screen.
Relevant screenshots
make it apparent user can skip this screen:
if user encounters error with auto deploy, render a note that it could be b/c changes has not finished taking affect: