Here is Terraform example. To launch an ec2 instance using linux amazon ami, create security group with inbound and outbound rule.
To successfully use this script, You need access_key, secret_key, subnet id, your system IP address and your system private key.
To try any example, clone this repository and run the following commands from within the example's directory:
$ terraform init $ terraform apply