ASaiun / terraform-alicloud-slb

Terraform module which creates Load balancer and attach ECS instances in it on Alibaba Cloud.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Alicloud Load Balancer (SLB) Terraform Module

Terraform module which creates SLB resources on Alibaba Cloud.

These types of resources are supported:

Root module calls these modules which can also be used separately to create independent resources:

NOTE:

  • If vswitch_id is set, the internal only is true
  • If slb instance network is internal, the internet_charge_type only is "PayByTraffic".

Usage

You can use this in your terraform template with the following steps.

  1. Adding a module resource to your template, e.g. main.tf

      module "tf-slb" {
         source = "alibaba/slb/alicloud"
    
         vswitch_id = "${var.vswitch_id}"
    
         name = "tf-module-slb"
         vswitch_id = "vsw-3fin3c4"
         internal = true
         bandwidth = 5
         spec = "slb.s1.small"
    
         instances = ["i-fqefvdfbec9d", "i-fn39g3v93h89br"]
    
      }
    
  2. Setting values for the following variables through environment variables:

    • ALICLOUD_ACCESS_KEY
    • ALICLOUD_SECRET_KEY

Authors

Created and maintained by He Guimin(@xiaozhu36 heguimin36@163.com)

Reference

About

Terraform module which creates Load balancer and attach ECS instances in it on Alibaba Cloud.

License:Mozilla Public License 2.0


Languages

Language:HCL 100.0%