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

feat(cfn-custom-resource): Add optional 'reason' field for detailed failure reporting #1758

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

moizsh
Copy link

@moizsh moizsh commented Jan 8, 2025

Issue #, if available:
N/A

Description of changes:

This PR adds an optional 'reason' field to the CloudFormation Custom Resource response model. This enhancement allows users to provide detailed failure reasons for Custom Resource creation/update operations, particularly useful in scenarios where the Lambda function is hosted in a separate account and logs are not directly accessible. The 'reason' field enables better error reporting and debugging for consumers of the Custom Resource.

Checklist

Breaking change checklist

RFC issue #: N/A

  • Migration process documented
  • Implement warnings (if it can live side by side)

Changes made:

  • Added an optional 'reason' field to the Response class for CloudFormation Custom Resources
  • Updated CloudFormationResponse to include the 'reason' in the response JSON when provided
  • Modified the Response builder to allow setting a custom reason
  • Ensured backward compatibility by making the 'reason' field optional
  • Added new test cases to verify the behavior of the new 'reason' field
  • Updated existing tests to include checks for the 'reason' field
  • Added appropriate JavaDoc comments for the new 'reason' field and its usage

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

…ailure reporting in CloudFormation custom resource responses
Copy link

sonarqubecloud bot commented Jan 8, 2025

@phipag phipag self-assigned this Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants