Terraform-provider-aws: Unexpected diffs on aws_ses_event_destination as of v2.63.0

Created on 22 May 2020  ·  7Comments  ·  Source: hashicorp/terraform-provider-aws

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.14
+ provider.aws v2.63.0

Affected Resource(s)

  • aws_ses_event_destination

Terraform Configuration Files

resource "aws_ses_event_destination" "sns-static-ip" {
  name                   = "event-destination-sns-static-ip${local.name_suffix}"
  configuration_set_name = "${aws_ses_configuration_set.config_set_static_ip.name}"
  enabled                = true

  matching_types = ["bounce", "complaint", "delivery"]

  sns_destination {
    topic_arn = "${aws_sns_topic.mail_feedback_topic.arn}"
  }
}

Expected Behavior

No diff should be generated.

Actual Behavior

A diff after upgrading to v2.63.0, released today:

~ aws_ses_event_destination.sns-static-ip
    sns_destination.0.topic_arn:   "" => "arn:aws:sns:ap-southeast-2:xxxxx:portalmail-feedback-prod"

(the event destination is still set in AWS - we haven't touched this resource for some time, and the diff was generated by CI today after upgrading the provider, where the same run yesterday generated no diff)

References

There's nothing in the CHANGELOG for v2.63.0 about this, but looking at the commit diff, I think it's caused by https://github.com/terraform-providers/terraform-provider-aws/pull/13344, which is part of https://github.com/terraform-providers/terraform-provider-aws/issues/9956

bug regression servicses

All 7 comments

@tdmalone Thanks for raising this issue.
It may be that this is caused by the fact that the resourceAwsSesEventDestinationRead() function

https://github.com/terraform-providers/terraform-provider-aws/blob/2cc9c47a4f152c250609a88351dd72da3c2368e8/aws/resource_aws_ses_event_destination.go#L188-L191

doesn't actually read the resource back 😄.
Usually when the schema changes slightly, such as in the linked change, the resource's Read function run during terraform plan (or the first part of terraform apply) will overwrite the schema read from state and all would look fine. That doesn't happen for this resource and hence the visible diff.

The SES DescribeConfigurationSet API with the eventDestinations option set should return the relevant event destination.

@ewbankkit Thanks for looking into it so quickly, and for prepping a patch! That makes sense.

It sounds like a quick fix then would be applying these changes, which would result in no functional change but which should correct the state?

Actually - it looks like the resource doesn't support updating either:

Error: Error applying plan:

1 error occurred:
        * aws_ses_event_destination.sns-static-ip: 1 error occurred:
        * aws_ses_event_destination.sns-static-ip: doesn't support update

I've worked around this for now by tainting and re-applying.

Not for the faint of heart, but you could also manipulate the state file.

The fix for this has been merged and will release with version 2.64.0 of the Terraform AWS Provider, later this week. Thanks to @ewbankkit for the quick implementation. 👍

This has been released in version 2.64.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

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!

Was this page helpful?
0 / 5 - 0 ratings