In this project, we'll be implementing the following infrastructure AWS using Terraform:
There are two ways you could connect Terraform to AWS:
$ export AWS_ACCESS_KEY_ID=<aws access key id>
$ export AWS_SECRET_ACCESS_KEY=<aws secret key>
Install awsclie
and run the following:
$ aws configure
You'll then be provided with step-by-step instructinos to set your aws credentials. Terraform will automatically pick your credentials everytime you use it.
- Initializing a new terraform project via running the following command from the tf dir:
$ tarraform init
- Preview the execution plan and changes (optional):
$ terraform plan
- Apply the changes:
$ terraform apply
The main branch contains modules (i.e. subnet and webserver) customly created by myself. If you want to see an example of using an existing subnet module from Terraform AWS regsitry, please see the existing_modules branch.
Though using provisioners is not reommended, however, if you want to see usage examples, please see the provisioners branch.