I'm troubleshooting trying to include an `python_a...
# general
t
I'm troubleshooting trying to include an
python_aws_lambda_function()
in my Terraform deployment. but I'm unable to get pants to keep the deployment sandboxes even with
--keep-sandboxes=always
enabled. Is there some regression that's preventing the keeping of sandboxes with
experimental-deploy
?
I've got all other sandboxes, including up to the
terraform init
, but after that there's no sandbox.
c
Could be. What version of pants are you using? And is the step that's failing the one that would execute
terraform apply
?
t
@careful-address-89803 I'm on
2.21.01
, and the step would be the
terraform plan
via the
--dry-run
Another weird behavior is that any dependency placed on the
terraform_module()
or
terraform_deployment()
isn't actually executed or included.
I've tried
file()
,
resource()
,
shell_command()
, among others.
It looks like the
dependencies
of Terraform targets only process backend or vars files and all others are ignored.
c
Confirming that we don't keep sandboxes for the deployment itself. I've got a fix in for that
t
I had to audible for the time being and currently just using
run_shell_command()
to get the behavior I need. It's not ideal, but I get that Terraform is still in early development.
c
I'm able to pull in
file
targets when they're marked as dependencies on
terraform_deployment
or
terraform_module
, at least on latest, will retry on 2.21.1
Copy code
terraform_deployment(name="deploy0", root_module=":r")
terraform_var_files(name="vars", sources=["a.tfvars"])
terraform_module(name="r", dependencies=[":f"])
file(name="f", source="f.txt")
t
Oooo. Ok. Maybe this can work. And by latest, do you mean
2.22.X
?
c
literally
main
lol, which is slightly ahead of
release_2.23.0.dev2
. But it also looks like it works on
2.21.0
t
Looks like the main issue is that the Lambda Zip is placed in the
dist/
dir and pants will ignore it no matter what I do.
c
ohhh, that makes sense. And normally you'd do
pants package my_aws_lambda
. Seems we haven't added
package_dependencies
for deps that need to be packaged first. I thought that maybe
experimental_wrap_as_resources
would work, but alas, seems we don't get resources either. I've added both of those to the stability tracker. For now, you can escape the deployment sandbox and grab the packaged object by absolute path. But
run_shell_command
probably makes more sense.
t
Yeah. For now I'll stick with
run_shell_command
. It'll be sweet when
package_dependencies
are supported with Terraform!