• Programming: HCL (Terraform)
• Repository: GitHub
• Cloud: AWS
• Database: Jenkins
• Related gist: https://github.com/isaacarnault/terraform-jenkins/tree/master
This gist is part of my Cloud
series and is performed on a Linux
OS.
It focuses on Terraform
and Infrastructure as Code
(IaC).
Make sure to get familiar with Terraform before you take this gist.
You have two ways to deploy Terraform
: either on your local machine, either in a remote virtual machine hosted on a 'Cloud' platform such as AWS
.
Throughout this gist, we will be using Terraform installed on our local machine.
We will learn how to deploy a Terraform
infrastructure integrating with Jenkins
and Ansible
.
| Some useful resources
. https://www.terraform.io/docs/cloud/index.html
. https://www.terraform.io/docs/cloud/paid.html
Important The following gist was performed on `Terraform` v.0.13.3.
If you use older versions, you may encounter interpolations warnings upon commands execution.
These warnings shouldn't affect the infrastructure building.
For easy use of this gist:
- Open your Shell (ctrl + Alt + T)
- Clone this repository on your local machine where you want, could be on your Desktop:
$ cd Desktop
$ git clone https://gist.github.com/isaacarnault/6020ed7a7b177ad8c1ab9a285191669a
}
-
From the command line, go to the folder where the repository is hosted:
-
Perform the below commands.
$ terraform init
}
$ terraform plan
}
$ terraform apply -auto-approve
}
Conclusion In this gist we've got a practical usage of Terraform for deploying a VPC on AWS.
We've learned how to use Terraform with Atom editor for deploying the needed resources. We've also learned how to integrate Jenkins with Terraform to automate this deployment. This other repository that I've uploaded on GitHub contains all files ready for deployment:
• AWS
• AWS Console
• Cloud computing
• Terraform
• Jenkins
• Ansible