Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
resource/aws_cloudwatch_log_stream: Prevent early state removal
References: * hashicorp#11611 The AWS logs service has eventual consistency considerations. The `aws_cloudwatch_log_stream` resource immediately tries to read a stream after creation. If the stream is not found, the logs service returns a 200 OK with an empty list of streams. Since no streams are present, the `aws_cloudwatch_log_stream` resource removes the created resource from state, leading to a "produced an unexpected new value for was present, but now absent" error. With the changes in this commit, the empty list of streams in the response for the newly created resource will result in a NotFoundError being returned and a retry of the read request. A subsequent retry should hopefully be successful, leading to the state being preserved. Output from acceptance testing: ``` make testacc TEST=./aws TESTARGS='-run=TestAccAWSCloudWatchLogStream_' ... --- PASS: TestAccAWSCloudWatchLogStream_disappears_LogGroup (16.77s) --- PASS: TestAccAWSCloudWatchLogStream_disappears (19.55s) --- PASS: TestAccAWSCloudWatchLogStream_basic (19.91s) ```
- Loading branch information