Is it possible to exclude a .tf file when specifying the source in a module.
Example
foo/bar consists of multiple .tf files:
Is it possible to exclude file1.tf while including it foo/bar in source as below:
module "module1" {
source = "foo/bar"
version = "0.1.0"
}
What you're asking for isn't supported explicitly. You can use some of the workarounds detailed in this Medium post, like setting the count of a resource equal to a variable that you've set to boolean true or false:
file1.tf:
resource "aws_eip" "example" {
count = "${var.create_eip}"
...
}
dependent source:
module "module1" {
source = "foo/bar"
version = "0.1.0"
create_eip = false # set to 'true' to include the resource in file1.tf
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With