"unknown keys: secrets" when trying to use Vault Secrets with Terraform template in a gitlab-ci.yml

I’m following the guide on how to incorporate Vault secrets in a CI job, but the pipelines are failing with
jobs:validate config contains unknown keys: secrets. I’m not sure what I’m doing wrong.

This is a self-hosted gitlab-ce install running version 16.4.1, gitlab-runner 16.5.0

include:
  - template: Terraform/Base.gitlab-ci.yml  # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Terraform/Base.gitlab-ci.yml
  - template: Jobs/SAST-IaC.gitlab-ci.yml   # https://gitlab.com/gitlab-org/gitlab/blob/master/lib/gitlab/ci/templates/Jobs/SAST-IaC.gitlab-ci.yml

stages:
  - validate
  - test
  - build
  - deploy
  - cleanup
      
fmt:
  extends: .terraform:fmt
  needs: []

validate:
  extends: .terraform:validate
  needs: []
  id_tokens:
    VAULT_ID_TOKEN:
      aud: https://mygitlab.example.com
  secrets:
    TF_VAR_my_secret:
      vault: project/my-secret@kv
      token: $VAULT_ID_TOKEN

build:
  extends: .terraform:build
  environment:
    name: $TF_STATE_NAME
    action: prepare

deploy:
  extends: .terraform:deploy
  dependencies:
    - build
  environment:
    name: $TF_STATE_NAME
    action: start

Did you have any luck with that? I’m running into the exact same issue.