-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: aws_ses_receipt_rule: fix off-by-one errors #12961
provider/aws: aws_ses_receipt_rule: fix off-by-one errors #12961
Conversation
In function `resourceAwsSesReceiptRuleRead` the position of the receipt rules in the rule set was taken directly from the index of the rule's position in the slice returned by the AWS API call. As the slice is zero-based and the ruleset is one-based, this results in an incorrect representation. This manifests as `aws_ses_receipt_rule` resources always showing a diff during plan or apply.
Hi @dougneal Thanks for the work here - is it possible to post a config that shows the error manifesting itself? I'd like to understand if there is a potential issue for users who upgrade Thanks Paul |
Hi @stack72, yeah sure, I'll put something together. |
<3 for this :) |
With the following configuration:
Then applying from a blank state:
And running apply again immediately afterwards, showing that the state of the resource as read from the API doesn't match the representation as computed from the config:
|
Awesome! Thanks for this @dougneal :) This is exactly what I needed LGTM |
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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
In function
resourceAwsSesReceiptRuleRead
the position of the receipt rules in the rule set was taken directly from the index of the rule's position in the slice returned by the AWS API call. As the slice is zero-based and the ruleset is one-based, this results in an incorrect representation.This manifests as
aws_ses_receipt_rule
resources always showing a diff during plan or apply.