Terraform-provider-aws: cloudtrail provider keeps reapplying event_selector

Created on 22 Jan 2020  ·  10Comments  ·  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 v0.12.19

  • provider.aws v2.44.0

Affected Resource(s)

  • aws_cloudtrail

Terraform Configuration Files

resource "aws_cloudtrail" "cloudtrail" {
  name                  = var.name
  s3_bucket_name        = var.s3_bucket
  is_multi_region_trail = true
  is_organization_trail = true
  event_selector {
    include_management_events = true
    read_write_type           = "WriteOnly"
  }
}

Debug Output

https://gist.github.com/tl-adrian-bridgett/3b9371e77fd1ae00c33123d1190e1521

Expected Behavior

Nothing (the event selector is already setup this way according to AWS console (and rerunning TF doesn't make a difference).

Actual Behavior

It "changes".

Steps to Reproduce

  1. terraform apply
  2. terraform apply once more - this shows the change wants to be done again (but has actually succeeded)

Important Factoids

bug serviccloudtrail

Most helpful comment

I'm seeing this on the 2.47.0 version of the provider.aws version as well.

All 10 comments

I'm seeing this on the 2.47.0 version of the provider.aws version as well.

ETA on this?

Still seeing this with the latest provider 2.61.0

Hi folks 👋 The fix for this issue should be merged and will release with version 2.68.0 of the Terraform AWS Provider, likely later today. Thanks to @ts-tek for the implementation. 👍

This has been released in version 2.68.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!

@bflad I am using provider 2.68.0 and this issue persists. I still need to use the lifecycle workaround to avoid this change on every apply.

For anyone looking here is the workaround I am using

  # TODO: remove lifecycle once above linked issue is resolved. lifecycle is a temporary workaround
  lifecycle {
    ignore_changes = [event_selector]
  }

@rossmckelvie can you please open a new bug report and include your configuration? Thanks.

@bflad sure but it is same as this ticket, as well as #3697. Can this ticket be reopened?

@rossmckelvie below is the test configuration we are using, which does not display any event_selector differences after apply:

https://github.com/terraform-providers/terraform-provider-aws/blob/3f12b61ae5c088a57eb5e3e21977c64bc04cec25/aws/resource_aws_cloudtrail_test.go#L1348-L1356

This seems to resemble the original issue configuration above other than enabling multi-region/organization support. If these two settings are influencing the perpetual difference, then we will need to capture those as a separate test case and fix the issue separately.

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