-
-
Notifications
You must be signed in to change notification settings - Fork 90
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
Added the output instance_class #111
base: main
Are you sure you want to change the base?
Conversation
outputs.tf
Outdated
|
||
output "instance_class" { | ||
description = "The instance calss used by the DocumentDB Cluster. For more details, see https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-classes.html#db-instance-class-specs" | ||
value = distinct([for instance in aws_docdb_cluster_instance.default : instance.instance_class])[0] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Faris96Hub how is this different from var.instance_class
? Or is not different and you're using the default of that value, so you need it as an output? If the latter... can we just output var.instance_class
instead of adding this looping logic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im not using the default but using var.instance_class would be an option too, to avoid the loop. Ill change it
@Faris96Hub if we have input |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes looks useless
what
Added the output instance_classwhy
Needed for monitoring reasons. Enables you to set the threshold of the CloudWatch alarm for FreeableMemory to a percentage value instead of Bytes. Because if you know the instance type, you know the RAM of it and you can set the threshold of the alarm to for example 70% of that. Unfortunately there is no data ressource to get the instance_class from otherwise (it gives just general information about available instance_classes)references
Data Ressource: https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/docdb_orderable_db_instance#:~:text=X%2DRay-,Data%20Source,-%3A%20aws_docdb_orderable_db_instance
Freeable Memory: https://docs.aws.amazon.com/documentdb/latest/developerguide/cloud_watch.html#cloud_watch-metrics_list:~:text=one%2Dminute%20period.-,FreeableMemory,-The%20amount%20of
Instance_classes: https://docs.aws.amazon.com/documentdb/latest/developerguide/db-instance-classes.html#db-instance-class-specs