-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
Add support for Kinesis enhanced monitoring #7679
Comments
Hi @cbroglie Thanks for opening the issue here. You proposal sounds correct - it's similar to what i did for enabled_metrics in autoscaling groups. Have a look there at how that is constructed thanks Paul |
Thanks @stack72, I got started on this with #7684. The basic functionality is working, but I'm not sure how to best handle the special |
Sorry @stack72, I didn't explain the issue well enough. The problem is that if you call enable-enhanced-monitoring with the value ALL, and then call describe-stream to see which metrics are enabled, it doesn't return ALL. It instead returns the list of individual metrics that ALL expands to. And this leads to tests failures like:
Is there any other precedent for how to best handle this? |
Hey I would be tempted to have a small if statement - and if the value was "all" then create a []string of all of the shard_level_metrics to pass in That way we are dealing with it locally rather than letting AWS transform the list for us P. |
@stack72 I don't think that would entirely solve it, since Terraform core would still see that the config has "ALL" and detect a diff compared to what was read back from the API. For this sort of problem we've usually taken one of two approaches:
The best idea I have right now is to make Terraform reject the "ALL" value altogether and encourage the user to explicitly list them all out. That way Terraform will be able to understand the user's intent better (e.g. it won't drift if AWS adds new values to the set) and produce reasonable diffs, at the expense of a slightly-more-annoying user interface. |
Thanks @apparentlymart, those were the same paths I had considered and rejected for the same reasons. Disallowing ALL sounds like a reasonable solution to me, and I'll implement that unless there are any other objections. |
@stack72 @apparentlymart Took another look at this and I can't see how to have Terraform actually reject the value ALL since That said, it does seem fairly trivial to add support for lists by making this change to schema.go:
But I don't know enough to say whether it's really that simple or if there are other considerations to account for. Thoughts? |
Hi @cbroglie You are indeed correct, we do not have list validation. Personally, I would just add some good documentation around the allowed values for now. When List validation drops (at some point in the future) then we can revisit! Paul |
@cbroglie will get this reviewed and merged in the morning (I am UK timezone) P. |
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. |
Kinesis enhanced monitoring enables shard-level CloudWatch metrics for Kinesis streams. More information is available here.
I wasn't able to find any existing issue open for this feature, and am happy to provide a PR for it. My proposal is to add a new optional field to the
aws_kinesis_stream
resource calledshard_level_metrics
, which would be an array of shard level metrics to enable (see http://docs.aws.amazon.com/kinesis/latest/APIReference/API_EnableEnhancedMonitoring.html).Let me know if this sounds reasonable, and if so I can implement it. Thanks.
The text was updated successfully, but these errors were encountered: