July 2017
Beginner to intermediate
358 pages
10h 54m
English
To run Terraform and to create our infrastructure, we must first set some environment variables:
$ export AWS_SECRET_ID=[your aws secret id] $ export AWS_SECRET_ACCESS_KEY=[your aws access key] $ export AWS_DEFAULT_REGION=[aws region to create resource]
We then need to initialize Terraform to reference the modules and remote data store. We normally only need to perform this step whenever we first clone the repository, or if we make changes to the modules:
$ terraform init
The next step is to run a plan; we use the plan command in Terraform to understand which resources are created, updated, or deleted by the apply command. It will also syntax check our config without creating any resources:
$ terraform plan -out=main.terraform ...
Read now
Unlock full access