melodic-butcher-43231
02/10/2023, 12:38 PMenough-analyst-54434
02/10/2023, 2:48 PMjsirois@Gill-Windows:~/dev/pantsbuild/jsirois-pants (main) $ git grep -A5 "TerraformProcess("
src/python/pants/backend/terraform/goals/check.py: TerraformProcess(
src/python/pants/backend/terraform/goals/check.py- args=("validate", directory),
src/python/pants/backend/terraform/goals/check.py- input_digest=source_files.snapshot.digest,
src/python/pants/backend/terraform/goals/check.py- output_files=tuple(files),
src/python/pants/backend/terraform/goals/check.py- description=f"Run `terraform fmt` on {pluralize(len(files), 'file')}.",
src/python/pants/backend/terraform/goals/check.py- ),
--
src/python/pants/backend/terraform/lint/tffmt/tffmt.py: TerraformProcess(
src/python/pants/backend/terraform/lint/tffmt/tffmt.py- args=("fmt", directory),
src/python/pants/backend/terraform/lint/tffmt/tffmt.py- input_digest=request.snapshot.digest,
src/python/pants/backend/terraform/lint/tffmt/tffmt.py- output_files=request.files,
src/python/pants/backend/terraform/lint/tffmt/tffmt.py- description=f"Run `terraform fmt` on {pluralize(len(request.files), 'file')}.",
src/python/pants/backend/terraform/lint/tffmt/tffmt.py- ),
So you'd want to start by filing an issue with your Pants version, full command line and output. If you're interested in contributing a fix we can use that ticket as the rally point and you can ask questions in #C0D7TNJHL / read up starting here: https://www.pantsbuild.org/docs/plugins-overviewenough-analyst-54434
02/10/2023, 3:04 PMexcept for an old issue that claims to have solved that (or something similar).What issue is that?
happy-kitchen-89482
02/10/2023, 5:08 PMmelodic-butcher-43231
02/10/2023, 6:35 PMenough-analyst-54434
02/10/2023, 6:46 PMenough-analyst-54434
02/10/2023, 6:47 PMresource { ... }
blocks are removed from the .tf to avoid the need for init.enough-analyst-54434
02/10/2023, 6:48 PMenough-analyst-54434
02/10/2023, 6:49 PMmelodic-butcher-43231
02/10/2023, 6:59 PMfast-nail-55400
02/10/2023, 9:24 PMI think the intent was just to plant a seed for terraform support as is the case with early experimental contribs. This one just never had anyone's time to circle back and continue the work.Indeed, that is the case.
fast-nail-55400
02/10/2023, 9:25 PMfmt
. plan
and apply
are both inherently stateful and don't really fit with the "hermetic build" model of Pants.fast-nail-55400
02/10/2023, 9:26 PMinit
is also stateful since technically it can and does update the lockfiles used by Terraform (.terraform.lock.hcl
)fast-nail-55400
02/10/2023, 9:26 PMfast-nail-55400
02/10/2023, 9:27 PMvalidate
wants access to the .terraform.lock.hcl
and so it must be present and so the Pants Terraform backend would need to be taught how to copy that into the execution sandbox.fast-nail-55400
02/10/2023, 9:28 PMterraform init
if it just becomes a custom Pants goal, maybe like ./pants tf-init ::
fast-nail-55400
02/10/2023, 9:29 PMterraform init
directlyfast-nail-55400
02/10/2023, 9:35 PMtf-run
goal in https://github.com/pantsbuild/pants/pull/13023 back in 2021, but there did not seem to be much appetite to include it in Pants. That PR actually knew how to deal with the .terraform
directory and .terraform.lock.hcl
file.fast-nail-55400
02/10/2023, 9:53 PMmelodic-butcher-43231
02/10/2023, 10:12 PMhappy-kitchen-89482
02/10/2023, 10:18 PMhappy-kitchen-89482
02/10/2023, 10:19 PM./pants deploy path/to/binary
would not just package the thing but actually provision infrastructure for it and deploy it to that infrastructurehappy-kitchen-89482
02/10/2023, 10:19 PMmelodic-butcher-43231
02/10/2023, 10:20 PMmelodic-butcher-43231
02/10/2023, 10:21 PMmelodic-butcher-43231
02/10/2023, 10:24 PMhappy-kitchen-89482
02/10/2023, 10:49 PMhappy-kitchen-89482
02/10/2023, 10:49 PMhappy-kitchen-89482
02/10/2023, 10:50 PMhappy-kitchen-89482
02/10/2023, 10:50 PMmelodic-butcher-43231
02/12/2023, 5:41 PMmelodic-butcher-43231
02/12/2023, 5:45 PMenough-analyst-54434
02/12/2023, 6:07 PMmelodic-butcher-43231
02/13/2023, 12:40 PMmelodic-butcher-43231
02/13/2023, 4:08 PMmelodic-butcher-43231
02/13/2023, 4:10 PMenough-analyst-54434
02/13/2023, 4:12 PMAnd there currently is no "proper" backend to deploy to MS Azure, as there is for AWS and Google Cloud, correct?I am not aware of any backend that deploys to anywhere. We have support for packaging AWSLambda and Google Cloud Function zip files, but you have to deploy those yourself.
happy-kitchen-89482
02/13/2023, 4:54 PM./pants experimental-deploy
goal that (AFAIK) currently publishes dists to PyPI (by running Twine), and pushes Docker images and Helm charts to registries. But these are relatively straightforward since they require very little extra metadata to know where to deploy to, and they're just pushing files to, essentially, storage. I think doing AWS and GCP might also be fairly straightforward. Terraform seems like a much bigger kettle of fish...melodic-butcher-43231
02/14/2023, 10:20 AMmelodic-butcher-43231
02/14/2023, 10:21 AM