-
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
resource/aws_instance: Ignore empty user_data SHA1 sum #4991
Conversation
I've tested this on three of our affected environments and it resolves it each time. I tested by: ...then confirm that instances are scheduled for I then replace my
...and verify it shows |
TeamCity acceptance test output updated above, no surprises. |
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 👍
This has been released in version 1.25.0 of the AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. |
DiffSuppressFunc: func(k, old, new string, d *schema.ResourceData) bool { | ||
// Sometimes the EC2 API responds with the equivalent, empty SHA1 sum | ||
// echo -n "" | shasum | ||
if old == "da39a3ee5e6b4b0d3255bfef95601890afd80709" && new == "" { |
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.
@bflad can we also do the check on the other direction?
If my plan used to omit the user_data
field but now has to include it with values that are sometimes empty, I would like the diff to be suppressed, too.
if (old == "da39a3ee5e6b4b0d3255bfef95601890afd80709" && new == "") ||
(old == "" && new == "da39a3ee5e6b4b0d3255bfef95601890afd80709") {
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.
could not wait and created #5467
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! |
Fixes #4954
Changes proposed in this pull request:
aws_instance
resource to ignore when EC2 API returns empty stringuser_data
Output from acceptance testing: (test failure unrelated)