Ability to retrieve (via datasource) secure files

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

It would be amazing to be able to retrieve secure_files via a datasource https://docs.gitlab.com/api/secure_files/

data "gitlab_secure_file" "this" {
  project = "123" # ID or Path
  id = "<file-id>" # If known ahead of time
  name = "my-file" # via list, gets ID to then download
}

In the above:

  • project MUST be passed - ID or path
  • id or name MUST be passed

Effectively the behaviour would be as follows:

  • if name is provided, list secure-files to source the id , download file contents and expose it on data.gitlab_secure_file.this.data
  • if id provided, download file contents and expose it on data.gitlab_secure_file.this.data

Optionally, we can expose .name , .id etc aswell (we could make the behaviour for id and name cause a "list" to enable additional information per the linked documentation above.

I'd actually really like to contribute this one if possible as i have a direct need for it in my tofu

Edited by 🤖 GitLab Bot 🤖