Skip to content

feat: Enhance error messages for hook failures #2270

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

dviryamin
Copy link

@dviryamin dviryamin commented Apr 14, 2025

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for pull request followers and do not help prioritize the request
  • The resources and data sources in this provider are generated from the CloudFormation schema, so they can only support the actions that the underlying schema supports. For this reason submitted bugs should be limited to defects in the generation and runtime code of the provider. Customizing behavior of the resource, or noting a gap in behavior are not valid bugs and should be submitted as enhancements to AWS via the CloudFormation Open Coverage Roadmap.

Description

In the current implementation, when a Terraform deployment fails due to a hook issue, the terraform apply command only returns a status message containing a unique ID for the hook request. This unique ID, however, serves no immediate purpose in resolving the problem because users must manually call the CloudFormation ListHookResults API using that ID to retrieve detailed information on which rule check failed. This extra manual step complicates troubleshooting and delays problem resolution.

Proposed Solution

This PR aims to streamline the debugging process by eliminating the need for manual API calls. The changes include:

  • Enhanced Error Reporting: Detailed information from the HookProgressEvent will be parsed and included in the error message output, providing immediate insight into which rule check failed.

Benefits

  • Improved Usability: Users no longer need to perform a manual API call to get additional details, reducing friction and potential errors.
  • Faster Troubleshooting: Immediate access to detailed error information accelerates the process of identifying and fixing deployment issues.
  • Better Developer Experience: By providing comprehensive error details directly in the Terraform output, this enhancement aids developers in quickly understanding and resolving hook-related failures.

@dviryamin dviryamin requested a review from a team as a code owner April 14, 2025 12:43
@dviryamin dviryamin changed the title feat: Enhance error messages for hook failures [WIP] feat: Enhance error messages for hook failures Apr 14, 2025
@dviryamin dviryamin changed the title [WIP] feat: Enhance error messages for hook failures feat: Enhance error messages for hook failures Apr 14, 2025
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.

1 participant