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

add reason to CfnNotStabilizedException #364

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

cortez7
Copy link
Contributor

@cortez7 cortez7 commented Apr 6, 2021

The current stabilization error message "Resource of type '%s' with identifier '%s' did not stabilize." lacks a reason so users may not be able to determine the cause of the stabilization error.

Changes

  • add reason argument to CfnNotStabilizedException constructors with documentation
  • update the corresponding NOT_STABILIZED exception message
  • deprecate the old constructors

Testing

  • added unit tests for new constructors

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@cortez7 cortez7 marked this pull request as ready for review April 15, 2021 00:19
Comment on lines 31 to 35
* @param reason Reason why the resource did not stabilize. This should include the current and
* desired state.
*
* Example: "Exceeded retry limit for DescribeResourceStatus.
* Current Value: IN_PROGRESS. Desired Value: COMPLETE."
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, I like the docs and providing an example. Couple comments:

  • I don't think desired state is necessary
  • For AWS resources, it should include the current state, Api name in iam format (like ec2:DescribeInstances) and the RequestId for that API (for non AWS resources it would be whatever the equivalent debugging info)

The example here is also a little bit confusing. Is this one example or two examples? Here's one

* Instance Status: pending (Api: ec2:DescribeInstances, RequestId: abcd-efgh-ijkl)
* Current Status: modifying (Api: rds:DescribeDBClusters, RequestId: abcd-efgh-ijkl)

Another option here would be to take the apiName and requestid as parameters

@cortez7 cortez7 requested a review from aygold92 April 28, 2021 21:27
@@ -25,14 +25,64 @@ public CfnNotStabilizedException(final Throwable cause) {
super(cause, ERROR_CODE);
}

/**
* @param resourceTypeName
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: can remove this duplicate doc entry

@cortez7 cortez7 requested a review from sungkkim April 28, 2021 22:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants