Skip to content
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

Merged
merged 3 commits into from Aug 3, 2023

Conversation

kimlisa
Copy link
Contributor

@kimlisa kimlisa commented Jul 28, 2023

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:
image

if user encounters error with auto deploy, render a note that it could be b/c changes has not finished taking affect:
image

@ibeckermayer
Copy link
Contributor

Should I wait for #29721 to land to review this?

@kimlisa
Copy link
Contributor Author

kimlisa commented Jul 31, 2023

@ibeckermayer @ryanclark ready for review

@kimlisa kimlisa force-pushed the lisa/iam-policy-status-web-ui branch from 1b4a151 to 099006f Compare August 1, 2023 16:47
@kimlisa
Copy link
Contributor Author

kimlisa commented Aug 2, 2023

friendly ping @ibeckermayer @ryanclark

@kimlisa kimlisa force-pushed the lisa/iam-policy-status-web-ui branch from f4ce632 to 6a01dd5 Compare August 2, 2023 18:17
Copy link
Collaborator

@r0mant r0mant left a 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.

Comment on lines 142 to 153
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;
}
Copy link
Contributor

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:

Suggested change
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

Copy link
Contributor Author

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
@kimlisa kimlisa force-pushed the lisa/iam-policy-status-web-ui branch from f05b5c4 to 99d940b Compare August 3, 2023 14:01
@kimlisa kimlisa enabled auto-merge August 3, 2023 14:05
@kimlisa kimlisa added this pull request to the merge queue Aug 3, 2023
Merged via the queue into master with commit 27b35de Aug 3, 2023
21 checks passed
@kimlisa kimlisa deleted the lisa/iam-policy-status-web-ui branch August 3, 2023 14:25
@public-teleport-github-review-bot

@kimlisa See the table below for backport results.

Branch Result
branch/v13 Failed

kimlisa added a commit that referenced this pull request Aug 3, 2023
* 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
github-merge-queue bot pushed a commit that referenced this pull request Aug 3, 2023
…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
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.

None yet

4 participants