Skip to content

densify-dev/terraform-null-optimization-as-code

Repository files navigation

Densify

This module is the interface between Densify machine learning analytics and Terraform templates. It enables two operations:

  • auto-tagging of cloud instances and containers based on Densify’s optimization analysis (making them “self-aware”)
  • automated optimization of instance families/sizes, and container resource requests/limits (making them “self-optimizing”)

This integration is based on densify.auto.tfvars, which is automatically generated by Densify and contains operational intelligence, analysis findings, and optimization recommendations for each cloud instance or container in scope. This module unpacks data from this structure, making it available to Terraform as variables, enabling precise specification of resources to optimally match the learned patterns of behavior. The result is next-generation resource optimization with the elimination of hard-coded resource specifications.

Requirements

Usage

module "optimization-as-code" {
  source  = "densify-dev/optimization-as-code/null"
  
  densify_recommendations = "${var.densify_recommendations}"
  densify_fallback = "${var.densify_fallback}"
  densify_unique_id = "${var.name}"
}

Examples

Inputs

Name Description Type Default Required
densify_recommendations Map variable containing recommendations from Densify Map - Yes
densify_fallback The map default values used if Densify recommendations are not available Map - Yes
densify_unique_id The unique identifier of the system to be updated String - Yes

Outputs

Name Description
current_type Current instance size and family.
recommended_type Densify recommended instance size and family.
savings_estimate The potential monthly savings from modifying the current instance to the Densify recommended instance.
predicted_uptime The predicted percentage of CPU utilization hours over the duration of a month.
implementation_method The system configured to allow automated or manual recommendations.
current_cpu_request The current CPU request configured for the Kubernetes container.
recommended_cpu_request The recommended CPU request for the Kubernetes container.
current_cpu_limit The current CPU limit configured for the Kubernetes container.
recommended_cpu_limit The recommended CPU limit for the Kubernetes container.
current_mem_request The current memory request configured for the Kubernetes container.
recommended_mem_request The recommended memory request for the Kubernetes container.
current_mem_limit The current memory limit configured for the Kubernetes container.
recommended_mem_limit The recommended memory limit for the Kubernetes container.
instance_type The instance size and family to be implemented, which is either the current size or the Densify recommendation, depending on the automation policy and the approval status (if approval is enabled).
cpu_request The CPU request to be implemented, which is either the current CPU request or the Densify recommendation, depending on the automation policy and the approval status (if approval is enabled).
cpu_limit The CPU limit to be implemented, which is either the current CPU limit or the Densify recommendation, depending on the automation policy and the approval status (if approval is enabled).
mem_request The memory request to be implemented, which is either the current memory request or the Densify recommendation, depending on the automation policy and the approval status (if approval is enabled).
mem_limit The memory limit to be implemented, which is either the current memory limit or the Densify recommendation, depending on the automation policy and the approval status (if approval is enabled).
min_group_current The current minimum group size of the ASG.
min_group_recommended The recommended minimum group size for the ASG.
max_group_current The current maximum group size of the ASG.
max_group_recommended The recommended maximum group size for the ASG.
min_group The minimum group size to be implemented, which is either the current minimum group size or the Densify recommended minimum group size depending on the automation policy and approval status (if approval is enabled).
max_group The maximum group size to be implemented, which is either the current maximum group size or the Densify recommended maximum group size depending on the automation policy and approval status (if approval is enabled).
avg_inst_count_current The current average number of instances running in the ASG.
avg_inst_count_recommended The predicted average number of instances running in the ASG if the recommendations are implemented.
current_desired_capacity The current desired number of instances running in the ASG.
desired_capacity The desired capacity to be implemented, which is either the current desired capacity or the recommended average instance count (rounded down) depending on the automation policy and approval status (if approval is enabled).
display_name The display name of the container, which is a combination of the pod\service name and the container name.
cluster The name of the cluster with the running container.
namespace The namespace for the running container.
pod_service The pod or service name that the container is running in. If the container is running in a single pod, then the pod name is displayed. If the container is part of a service, such as a Replication Controller or Replica Set, then the service name is displayed.
container The name of the container.
controller_type The type of the controller.
current_size The current number of copies of the controller that are running. The value will be 1 for individual pods.
approval_type The type of approval for this system (NA, All, Specific size).
recommendation_type The type of recommendation (Upsize, Downsize, Resize, Just Right).
effort The effort rating for implementing the recommendation.
policy The policy is used by the analysis.
power_state The power state of the instance.
defer_recommendation Defer recommending an instance type change until reserved instance coverage for this instance expires.
defer_until If deferRecommendation = yes, then the expiry date of the RI providing coverage for the current instance is returned.

License

Apache 2 Licensed. See LICENSE for full details.

About

Module to integrate Terraform with Densify machine learning to enable cloud and container workloads to be self-optimizing

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages