Skip to content

Latest commit

 

History

History
170 lines (139 loc) · 3.36 KB

alicloud_cs_kubernetes_autoscaler.md

File metadata and controls

170 lines (139 loc) · 3.36 KB

alicloud_cs_kubernetes_autoscaler

back

Index

Terraform

terraform {
  required_providers {
    alicloud = ">= 1.120.0"
  }
}

top

Example Usage

module "alicloud_cs_kubernetes_autoscaler" {
  source = "./modules/alicloud/r/alicloud_cs_kubernetes_autoscaler"

  # cluster_id - (required) is a type of string
  cluster_id = null
  # cool_down_duration - (required) is a type of string
  cool_down_duration = null
  # defer_scale_in_duration - (required) is a type of string
  defer_scale_in_duration = null
  # use_ecs_ram_role_token - (optional) is a type of bool
  use_ecs_ram_role_token = null
  # utilization - (required) is a type of string
  utilization = null

  nodepools = [{
    id     = null
    labels = null
    taints = null
  }]

  timeouts = [{
    create = null
    delete = null
    update = null
  }]
}

top

Variables

variable "cluster_id" {
  description = "(required)"
  type        = string
}

variable "cool_down_duration" {
  description = "(required)"
  type        = string
}

variable "defer_scale_in_duration" {
  description = "(required)"
  type        = string
}

variable "use_ecs_ram_role_token" {
  description = "(optional)"
  type        = bool
  default     = null
}

variable "utilization" {
  description = "(required)"
  type        = string
}

variable "nodepools" {
  description = "nested block: NestingSet, min items: 0, max items: 30"
  type = set(object(
    {
      id     = string
      labels = string
      taints = string
    }
  ))
  default = []
}

variable "timeouts" {
  description = "nested block: NestingSingle, min items: 0, max items: 0"
  type = set(object(
    {
      create = string
      delete = string
      update = string
    }
  ))
  default = []
}

top

Resource

resource "alicloud_cs_kubernetes_autoscaler" "this" {
  # cluster_id - (required) is a type of string
  cluster_id = var.cluster_id
  # cool_down_duration - (required) is a type of string
  cool_down_duration = var.cool_down_duration
  # defer_scale_in_duration - (required) is a type of string
  defer_scale_in_duration = var.defer_scale_in_duration
  # use_ecs_ram_role_token - (optional) is a type of bool
  use_ecs_ram_role_token = var.use_ecs_ram_role_token
  # utilization - (required) is a type of string
  utilization = var.utilization

  dynamic "nodepools" {
    for_each = var.nodepools
    content {
      # id - (optional) is a type of string
      id = nodepools.value["id"]
      # labels - (optional) is a type of string
      labels = nodepools.value["labels"]
      # taints - (optional) is a type of string
      taints = nodepools.value["taints"]
    }
  }

  dynamic "timeouts" {
    for_each = var.timeouts
    content {
      # create - (optional) is a type of string
      create = timeouts.value["create"]
      # delete - (optional) is a type of string
      delete = timeouts.value["delete"]
      # update - (optional) is a type of string
      update = timeouts.value["update"]
    }
  }

}

top

Outputs

output "id" {
  description = "returns a string"
  value       = alicloud_cs_kubernetes_autoscaler.this.id
}

output "this" {
  value = alicloud_cs_kubernetes_autoscaler.this
}

top