First we install choco:
- Launch powershell with administrator rights:
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
Next we install terraform:
choco install terraform
Next, we restart the powershell instance to refresh the environment variables. We can use Terraform now.
-
terraform init
to initialise Terraform -
terraform plan
checks the script -
terraform apply
implements the script -
terraform destroy
to delete everything -
Terraform file/folder structure
-
.tf
extension - e.g.main.tf
-
Apply
DRY
(do not repeat yourself)
AWS_ACCES_KEY_ID
for aws access keyAWS_SECRET_ACCESS_KEY
for aws secret- Click windows key - type
env
- edit the system env variable - New user variable - Create a new one for each of AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY.