Skip to content

Latest commit

 

History

History

basic_sample_with_ansible

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

Basic example (with ansible)

This is most basic example. This will create following resources. Architecture overview is here. This example use Ansible for server provisioning.

  1. Create VPC
  2. Create Vswitch
  3. Create Security Group and set some rules
  4. Create an ECS instance in Vswitch
  5. Create EIP and bind it to ECS instance
  6. Provision httpd to ECS instance with Userdata function

Advantege of using Ansible for server provisioning

Userdata code supports shell script and cloud-init. But both isn't suitable for complex provisioning. When you provision complex and many configuration, I reccomend using provisioning tools like Ansible, Chef, Puppet and so on.

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: 7 added, 0 changed, 0 destroyed.

Outputs:

eip = xx.xx.xx.xx

Access eip address with web browser.
http_output

Reference(Japanese)

http://qiita.com/mosuke5/items/a65683ce6569bffd7ef0