stakater / bugs

Stakater issue tracker
0 stars 1 forks source link

Investigate and fix makefiles structure for copying .tf files #93

Open hazim1093 opened 7 years ago

hazim1093 commented 7 years ago

Currently we use makefiles to initialize the build directory. Terraform files (.tf) and other files like user-data, policy etc are copied to the build directory via makefiles.

In some scenarios, terraform fails due to no such module or similar error that is usually because the specific tf file is not present in the build directory.

Example scenario:

User A creates an environment on his machine, included storage, network, and various modules.

User B, adds a new module to the environment on his own machine. He calls make for that module only, terraform updates the state file, so user B has the same state as of user A and as of the infrastructure it self, but user B's build directory does not have .tf files for storage, network and etc as he did not call make on those modules (storage, network etc). So terraform fails with error no such module.

Solution: Run make plan_env_name and the make files will copy all the files to the build directory.

Investigate this issue and makefiles structure further to find such issues and solve them