I am trying to run a simple terraform code using p...
# ask-community
s
I am trying to run a simple terraform code using prefect. the terraform code is a .tf file which creates a storage account. When I am running it as a normal python code (without including prefect, flows etc), it is working fine. But with prefect I am getting error. I am not sure if this is related to prefect, or something else.
k
Not sure but I think it’s because of the
Terraform
outside the task. Can you try moving it inside a task?
c
@Shuchita Tripathi we'll have some Terraform experts on PrefectLive today at 3p Eastern, might be an interesting time to ask some questions
upvote 1
s
Thank you Chris. I'll try to attend.
that worked. Can you please tell me why having Terraform outside is a problem? and does that mean that I have to create that terraform instance in everyflow? We are planning to have multiple flows for terraform in future.
k
I think something in the Terraform object is lost when the flow is serialized. You can leave it outside if you use script based storage like Github or S3 or even Local with
stored_as_script=True
, but this might not work if you use the DaskExecutor which pickles stuff to send to the works. If you use Dask, you might need it inside the task
s
@Kevin Kho
ok. thank you. i'll try that
a
@Shuchita Tripathi it would be great if you don't tag anyone unless this is something urgent, that would be much appreciated πŸ™ Kevin is the fastest person to respond anyway so really there is no need for tagging him, he will respond without having to tag him.
πŸ˜† 1
s
Sure Anna. I'll keep that in mind
πŸ™ 1