Skip to content
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

[Bug]: aws_cloudtrail always shows changes due to switching insight_type values #37525

Open
snarky opened this issue May 15, 2024 · 2 comments · May be fixed by #37591
Open

[Bug]: aws_cloudtrail always shows changes due to switching insight_type values #37525

snarky opened this issue May 15, 2024 · 2 comments · May be fixed by #37591
Labels
bug Addresses a defect in current functionality. service/cloudtrail Issues and PRs that pertain to the cloudtrail service.

Comments

@snarky
Copy link

snarky commented May 15, 2024

Terraform Core Version

1.8.3

AWS Provider Version

5.49.0

Affected Resource(s)

  • aws_cloudtrail

Expected Behavior

Terraform should recognize that there are no actual changes in the insight_selector blocks and should not show any updates in the execution plan.

Actual Behavior

Terraform shows an in-place update with the insight_type values switching:

Relevant Error/Panic Output Snippet

~ insight_selector {
    ~ insight_type = "ApiErrorRateInsight" -> "ApiCallRateInsight"
}
~ insight_selector {
    ~ insight_type = "ApiCallRateInsight" -> "ApiErrorRateInsight"
}

Terraform Configuration Files

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudtrail

Steps to Reproduce

Define an aws_cloudtrail resource with insight_selector blocks:

resource "aws_cloudtrail" "cloudtrail" {
  name = "XXX"

  insight_selector {
    insight_type = "ApiErrorRateInsight"
  }

  insight_selector {
    insight_type = "ApiCallRateInsight"
  }
}

Run terraform apply twice.

Debug Output

No response

Panic Output

No response

Important Factoids

No response

References

No response

Would you like to implement a fix?

None

@snarky snarky added the bug Addresses a defect in current functionality. label May 15, 2024
Copy link

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please see our prioritization guide for information on how we prioritize.
  • 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.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

@github-actions github-actions bot added the service/cloudtrail Issues and PRs that pertain to the cloudtrail service. label May 15, 2024
@terraform-aws-provider terraform-aws-provider bot added the needs-triage Waiting for first response or review from a maintainer. label May 15, 2024
@acwwat
Copy link
Contributor

acwwat commented May 20, 2024

Looks like the order in the AWS API response is not deterministic - sometimes the order is OK, sometimes it's not. In any case, it makes sense to make the argument unordered using a Set as a catch-all.

@justinretzolk justinretzolk removed the needs-triage Waiting for first response or review from a maintainer. label May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Addresses a defect in current functionality. service/cloudtrail Issues and PRs that pertain to the cloudtrail service.
Projects
None yet
3 participants