I'm using an external data source in order to perform a cURL command using the program argument :
data "external" "curl_zip" {
program = ["bash", "-c", "curl", ...]
}
I'm running the Terraform in a pipeline so I need to retrieve the data on every terraform plan.
It seemed to work well until I created a new resource requiring the curl to be performed. But it looks like Terraform is only refreshing and so doesn't do the program command after the first plan:
data.external.curl_zip["something.json"]: Refreshing state... [id=-]
My question is : is there a way to re-run the program argument on every plan even during refresh ?
PS : I already tried to use a null_resource
instead with a local-exec
, turned out to not be the solution here because (for some reason) I also need to use a archive_file data source to create zips files so my GCP app engines resource can read them, and the local-exec
is being executed after the terraform apply, which doesn't work since the data source is being refreshed or created during the plan.