UCL-CloudLabs / user-portal

Front end user portal for CloudLabs
0 stars 0 forks source link

Store terraform-related files in local directory #54

Open ageorgou opened 6 years ago

ageorgou commented 6 years ago

At the moment, the files (.tf and .tfstate) that Terraform creates are put into a temporary directory, which is deleted after deployment. It would be good to store these so they can be examined if required. This would also eliminate the need to do terraform init every time, and would simplify destroying a host (#43). The file name, which can reuse the unique name scheme when available (#50), can then be stored in the database instead of its contents.

Note that terraform apply can take a state argument, to save the state in a non-default path (https://www.terraform.io/docs/commands/apply.html)

ageorgou commented 6 years ago

A better alternative might be to use Terraform's remote state feature with Azure (some info here and here). It seems that Terraform will then access the files as and when needed automatically. To view the files ourselves, we can use Azure Storage Explorer.