Hi, I use infisical via terraform, but lately I ge...
# infisical-help
a
Hi, I use infisical via terraform, but lately I get this error when trying to apply my infra:
Copy code
│ Error: Error Reading Infisical secret
│
│   with module.common.module.infisical[0].infisical_secret.image_renderer_url[0],
│   on ../../modules/infisical/services.tf line 11, in resource "infisical_secret" "image_renderer_url":
│   11: resource "infisical_secret" "image_renderer_url" {
│
│ Could not read Infisical secret with ID : CallGetSingleSecretByIDV3 Unsuccessful response [GET
│ <https://app.infisical.com/api/v3/secrets/raw/id/>] [status-code=400] [request-id=req-zkEx6DgQmuuFhk]
│ [message="You must provide projectSlug or workspaceId"]
This has never happened before, I am using the following module: registry.terraform.io/providers/Infisical/infisical/latest DId anything change recently around this API? Actually, what happened was • I think there was an API breaking change pushed to the state rep of the provider, • but I wasn't using a pinned version • so the next time I ran
terraform init
I started using a version of the provider which did not work with my remote state (?) • pinning my provider to 0.16 + running
init -upgrade
seems to have resolved this for me
✅ 1
p
Hey Alex! Your read is right. In v0.16.17 of the Infisical Terraform provider we changed how secrets get read: it now looks them up by ID instead of by name/path. Secrets created on older versions have an empty ID stored in state, which is what triggers that 400. To get back on the latest: pin to
0.16.16
, run
terraform apply
once so the IDs backfill into your state, then drop the pin and
init -upgrade
Glad you got it sorted!