Is your feature request related to a problem? Please describe.
We are using the hashicorp/external provider for Terraform which allows us to run arbitrary scripts as a a data source (input) to a Terraform module. We use this because we have a shell script for retrieving artifacts from a database.
The problem is that the only files that get materialised in the sandbox for the terraform backend to use are file targets and resource targets. This is a bit inconvenient because it means you usually need to add two pants targets for a single file:
shell_sources(name="shell-scripts")
# Duplicate target covered in shell sources above
# to allow Terraform to list it as a dependency.
file(name="get-artifacts-script-file", source="get_artifacts.sh")
terraform_module(dependencies=[":get-artifacts-script-file"])
Describe the solution you'd like
I would like to be able to directly reference (and materialise) shell scripts, python scripts... any other file target like so:
shell_sources(name="shell-scripts")
terraform_module(dependencies=[":shell-scripts"])
You can see a full example (including Terraform code) here.
Describe alternatives you've considered
As described in the problem statement, you can work around this using the file and resource targets, but it means multiple targets referencing the same file.
Additional context
This would make even more sense if Terraform also packaged dependencies (where required). I will keep this issue narrow in scope and open a separate issue for that.
Is your feature request related to a problem? Please describe.
We are using the
hashicorp/externalprovider for Terraform which allows us to run arbitrary scripts as a a data source (input) to a Terraform module. We use this because we have a shell script for retrieving artifacts from a database.The problem is that the only files that get materialised in the sandbox for the terraform backend to use are
filetargets andresourcetargets. This is a bit inconvenient because it means you usually need to add two pants targets for a single file:Describe the solution you'd like
I would like to be able to directly reference (and materialise) shell scripts, python scripts... any other file target like so:
You can see a full example (including Terraform code) here.
Describe alternatives you've considered
As described in the problem statement, you can work around this using the
fileandresourcetargets, but it means multiple targets referencing the same file.Additional context
This would make even more sense if Terraform also packaged dependencies (where required). I will keep this issue narrow in scope and open a separate issue for that.