-
Notifications
You must be signed in to change notification settings - Fork 9.3k
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
iam_account_alias: Pass awserr in returned error #3590
iam_account_alias: Pass awserr in returned error #3590
Conversation
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.
This would be very helpful for folks! Could you just use err
instead of the custom function fmtAwsError(err)
-- the awserr.Error
type will return the right error message without extra logic.
@bflad Printing |
Some folks need this information for opening AWS support cases when its not possible to reproduce errors again with debug logging enabled. |
This will display helpful error messages like "The account alias ... already exists. (EntityAlreadyExists)"
c07c479
to
b6b999f
Compare
Right, I didn't think about Terraform used in a CI system. If you use it manually, you just could repeat the call with What about the red coloring output? |
Probably worth a separate ticket. 😄 I'd be curious to see your opinion of what the implementation should look like and how it should be controlled. It most likely should be handled in Terraform core though since it sounds like it would apply for all Terraform providers/resources (AWS, GCP, Azure, etc.): https://github.com/hashicorp/terraform/ |
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.
LGTM! 🚀
=== RUN TestAccAWSIAMAccountAlias
=== RUN TestAccAWSIAMAccountAlias/Basic
=== RUN TestAccAWSIAMAccountAlias/Basic/basic
=== RUN TestAccAWSIAMAccountAlias/Import
=== RUN TestAccAWSIAMAccountAlias/Import/import
--- PASS: TestAccAWSIAMAccountAlias (23.34s)
--- PASS: TestAccAWSIAMAccountAlias/Basic (14.92s)
--- PASS: TestAccAWSIAMAccountAlias/Basic/basic (14.92s)
--- PASS: TestAccAWSIAMAccountAlias/Import (8.41s)
--- PASS: TestAccAWSIAMAccountAlias/Import/import (8.41s)
PASS
This has been released in version 1.11.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks! |
This will display helpful error messages like
The error message is not red as it is common and useful in Terraform. Is there a setting for a
resource
that all returnederror
s are displayed in red?Always setting the colorstring's
[red]
, etc. on each error message is unnecessary boilerplate, I think.