Skip to content

Latest commit

 

History

History
134 lines (108 loc) · 2.69 KB

alicloud_slb_master_slave_server_group.md

File metadata and controls

134 lines (108 loc) · 2.69 KB

alicloud_slb_master_slave_server_group

back

Index

Terraform

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

top

Example Usage

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

  # delete_protection_validation - (optional) is a type of bool
  delete_protection_validation = null
  # load_balancer_id - (required) is a type of string
  load_balancer_id = null
  # name - (required) is a type of string
  name = null

  servers = [{
    is_backup   = null
    port        = null
    server_id   = null
    server_type = null
    type        = null
    weight      = null
  }]
}

top

Variables

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

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

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

variable "servers" {
  description = "nested block: NestingSet, min items: 0, max items: 2"
  type = set(object(
    {
      is_backup   = number
      port        = number
      server_id   = string
      server_type = string
      type        = string
      weight      = number
    }
  ))
  default = []
}

top

Resource

resource "alicloud_slb_master_slave_server_group" "this" {
  # delete_protection_validation - (optional) is a type of bool
  delete_protection_validation = var.delete_protection_validation
  # load_balancer_id - (required) is a type of string
  load_balancer_id = var.load_balancer_id
  # name - (required) is a type of string
  name = var.name

  dynamic "servers" {
    for_each = var.servers
    content {
      # is_backup - (optional) is a type of number
      is_backup = servers.value["is_backup"]
      # port - (required) is a type of number
      port = servers.value["port"]
      # server_id - (required) is a type of string
      server_id = servers.value["server_id"]
      # server_type - (optional) is a type of string
      server_type = servers.value["server_type"]
      # type - (optional) is a type of string
      type = servers.value["type"]
      # weight - (optional) is a type of number
      weight = servers.value["weight"]
    }
  }

}

top

Outputs

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

output "this" {
  value = alicloud_slb_master_slave_server_group.this
}

top