-
Notifications
You must be signed in to change notification settings - Fork 708
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
Disabling Remediation Configuration before deleting config rule #1001
Conversation
Hey @Muhammad-Ahmad-Rai, thanks for the PR and sorry for the late reply! Could you resolve the conflict and rebase your changes, ideally without the changes from #993? That would be awesome 🙂 |
64b19e1
to
ef0c468
Compare
@der-eismann Done |
…ttempting deletion of rule
ef0c468
to
419f8ed
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.
I'm starting to wonder if it would make more sense to create a separate RemediationConfiguration
resources, but I don't know how these things interact, so let's follow your approach.
f.svc.DeleteRemediationConfiguration(&configservice.DeleteRemediationConfigurationInput{ | ||
ConfigRuleName: f.configRuleName, | ||
}) |
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.
f.svc.DeleteRemediationConfiguration(&configservice.DeleteRemediationConfigurationInput{ | |
ConfigRuleName: f.configRuleName, | |
}) | |
_, err := f.svc.DeleteRemediationConfiguration(&configservice.DeleteRemediationConfigurationInput{ | |
ConfigRuleName: f.configRuleName, | |
}) | |
if err != nil { | |
return err | |
} |
I think we should catch the error here
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.
There is a chance that no remediation configuration exist for the given config rule, and that will result in NoSuchRemediationConfigurationException
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.
Ah, that makes sense
Fixes the Error:
"ResourceInUseException: The rule{RULE_NAME} currently has a RemediationConfiguration. Please delete the RemediationConfiguration and try again."