terraform/examples/alicloud-ecs-nat
demonwy ffc5a06cb5 provider/alicloud: change create ecs postpaid instance API (#12226)
* change create ecs postpaid instance API form createInstance to runInstances, support BusinessInfo and userdata

* update sdk vendor
2017-03-15 16:50:17 +02:00
..
README.md provider/alicloud: change create ecs postpaid instance API (#12226) 2017-03-15 16:50:17 +02:00
main.tf provider/alicloud: change create ecs postpaid instance API (#12226) 2017-03-15 16:50:17 +02:00
outputs.tf provider/alicloud: change create ecs postpaid instance API (#12226) 2017-03-15 16:50:17 +02:00
userdata.sh provider/alicloud: change create ecs postpaid instance API (#12226) 2017-03-15 16:50:17 +02:00
variables.tf provider/alicloud: change create ecs postpaid instance API (#12226) 2017-03-15 16:50:17 +02:00

README.md

Configure NAT instance Example

In the Virtual Private CloudVPC environment, to enable multiple back-end intranet hosts to provide services externally with a limited number of EIPs, map the ports on the EIP-bound host to the back-end intranet hosts.

Get up and running

  • Planning phase

      terraform plan 
    
  • Apply phase

      terraform apply 
    
      Get the outputs:
      + nat_instance_eip_address = 123.56.19.238
      + nat_instance_private_ip = 10.1.1.57
      + worker_instance_private_ip = 10.1.1.56
    
  • Apply phase

      + login the vm: ssh root@123.56.19.238|Test123456
      + Run the "iptables -t nat -nvL" command to check the result
    
        | prot | in |   source    |  destination   |                          |
        | ---- | -- | ----------- | -------------- | ------------------------ |
        | tcp  | *  | 0.0.0.0/0   |  10.1.1.57     |  tcp dpt:80 to:10.1.1.56
        | all  | *  | 10.1.1.0/24 |  0.0.0.0/0     |  to:10.1.1.57
    
  • Destroy

      terraform destroy