-
Notifications
You must be signed in to change notification settings - Fork 9.7k
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
provider/aws aws_kinesis_stream recreates stream when shard_count changes #11816
Comments
Thanks for this request, @chaliy. It looks like there's a reasonable "default way" to do this via the UpdateShardCount API function, avoiding the complexities of manual resharding. But it has some constraints and best-practices that I guess we'd need to document to help users avoid apply-time errors or unexpected costs. |
Also, regarding this issue, by requiring If such an external system begins splitting and merging shards, the relevant Terraform file has to be updated to reflect the change. Otherwise, as described above, Terraform will delete the stream and recreate it, causing data loss. Since the I think the To allow for explicit shard control through Terraform, the |
This is blocking me as well. Shard_count + manual scaling of shards are not happy when re-applying terraform |
Note that you can already make
And when #13562 is available, you can manually resize the stream with the UpdateShardCount API and still access the current number of shards in other parts of the Terraform config. As @apparentlymart noted, UpdateShardCount has limitations (like only being able to be used twice per 24 hours per stream) which may not be suitable for the default behavior if |
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 Version
Terraform v0.8.6
Affected Resource(s)
aws_kinesis_stream
Debug Output
https://gist.github.com/chaliy/683eb59c1bfc415d8b890aabedb92963
Expected Behavior
Shard count changed on AWS (shards spitted or merged). Items under retention period are safe.
Actual Behavior
Kinesis stream recreated. Effectively all items in stream is wiped out.
Steps to Reproduce
Any change to
shard_count
.@stack72
The text was updated successfully, but these errors were encountered: