Closed killmepete closed 1 year ago
Voting for Prioritization
Volunteering to Work on This Issue
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.
Terraform Core Version
1.5.6
AWS Provider Version
aws v5.0.1
Affected Resource(s)
Cloudtrail
Expected Behavior
The cloudtrail module I have created (based of the example) should be able to deploy without issue.
Actual Behavior
I currently have a simple module created to deploy cloudtrail (using the example provided), I'm running into an error which seems to be intermittent where after running a few deploys (with resources nothing to do with Cloudtrail) I'll encounter the error message:
"reading AWS CloudTrail Trail (dev-test-cloudtrail): not found after creation"
I can confirm that if I log into the console or check via the CLI that the trail does exist and is logging as expected, I haven't been able to find any documentation around this error message and the only way I've managed to get around it is by intercepting my build, running a terraform state rm on cloudtrail and redeploying.
I'm inclined to believe this is a bug with the provider, I've deployed and written similar cloudtrail modules before and I've never encountered this problem. If I'm mistaken and it's an easy fix that would make me happy!
Relevant Error/Panic Output Snippet
Terraform Configuration Files
Steps to Reproduce
Unsure, problem happens intermittently and can happen a long time after the cloudtrail has been deployed.
Debug Output
ERROR
PLANNED CHANGES
Panic Output
No response
Important Factoids
Resource names, IDs and so and so have been changed for the purposes of the bug report.
References
The lines responsible for the logging message...
https://github.com/hashicorp/terraform-provider-aws/blob/8aebcb61aa37f33f47606097cce23e5aa1783121/internal/service/cloudtrail/cloudtrail.go#L366-L385
Not sure if the conditional checks could be too blame.
Would you like to implement a fix?
None