Need to run code prior to TF validate in Enterprise

We have been writing a lot of TF against the Akamai provider and I am trying to build a provider for credentialing the executions.

The Akamai provider accepts a path to a credentials file – and fails the run if that file is not found.

In order to create that file on the fly I would need code to execute [in Enterprise] prior to the Akamai provider – and I also would need access to the submitted TF.

How can I confirm in which state/stage the Akamai provider is complaining?

How can I run prior to the Akamai validation step and also have access to the job TF ?


I think it might possibly work, if your custom provider wrote the credentials file as part of a Terraform data source, and returned the path to the file as a result attribute of the data source.

You might be able to test this out by using Terraform Registry, a provider that provides a data source that executes an external program that must return JSON on stdout.

I was unable to get anything running inside the TF - Akamai’s validation that the file is there happens first.

That’s why I’m looking at a provider to run the code prior to Akamai validating the config