Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

SLB example

This is the example of creating SLB/ECS, and binding ECS to SLB. This will create following resources. Architecture overview is here.

  1. Create VPC
  2. Create Vswitch
  3. Create Security Group and set some rules
  4. Create two ECS instances in Vswitch
    • Httpd and index.html including hostname will be provisioned
  5. Create EIP and bind it to ECS instance
  6. Create SLB instance
  7. Configure listener and binding to ECS instances

How to use

First you need to chnage configuration to yours.

$ cp terraform.tfvars.sample terrafrom.tfvars
$ vim terraform.tfvars
 => Edit variables with your favorite editor.

Deploy to Alibaba Cloud

$ terraform apply
...
Apply complete! Resources: 9 added, 0 changed, 0 destroyed.

Outputs:

slb = xx.xx.xx.xx

Please access slb ip address many times by web browser. You will find change html output.