Closed VJftw closed 2 years ago
changes lgtm, will give it a tick when the CircleCI tests pass :)
changes lgtm, will give it a tick when the CircleCI tests pass :)
CircleCI tests are a little unloved. I'm planning to move things out of this repo into their own plugins, a bit like this: https://github.com/please-build/proto-rules
Happy to land this if the code looks good. We can also talk about migtating this to thought-machine/terraform-rules
or something.
I'm planning to move things out of this repo into their own plugins, a bit like this: https://github.com/please-build/proto-rules We can also talk about migtating this to
thought-machine/terraform-rules
or something.
Awesome! I'm keen for this too, really excited to see what we can do with the new plugin style of things too, I can imagine this being much easier to maintain 👌
This PR fixes support for the colocation of Terraform modules that have the same basename. Currently, this Terraform tool only copies the
basename
of the directory name, into the colocated./modules/
folder interraform_root
s. For example, the current behaviour is:terraform_module
at//modules/my_module_a/gcp:gcp
(plz-out/gen/modules/my_module_a/gcp/gcp
)./modules/gcp
.This means that any other modules with the same basename will clash, For example:
terraform_module
at//modules/my_module_a/gcp:gcp
(plz-out/gen/modules/my_module_a/gcp/gcp
)./modules/gcp
.terraform_module
at//modules/my_module_b/gcp:gcp
(plz-out/gen/modules/my_module_b/gcp/gcp
)./modules/gcp
, clashing with the other module.This PR fixes this by changing the behaviour to:
terraform_module
at//modules/my_module_a/gcp:gcp
(plz-out/gen/modules/my_module_a/gcp/gcp
)./modules/modules/my_module_a/gcp/gcp
.terraform_module
at//modules/my_module_b/gcp:gcp
(plz-out/gen/modules/my_module_b/gcp/gcp
)./modules/modules/my_module_b/gcp/gcp
.I've also added another exclusion pattern for
*.tfstate
files to not be removed from/tmp/please/...
so that people can still use non-remote terraform state (with its disadvantages) for demoing/testing purposes.