project_job_token_scope should take a list as input
Bug Report
Currently you have to create as many gitlab_project_job_token_scope
ressources as you want project to get access. There is currently no way to configure your Gitlab project using this terraform provider to make sure no other project has access.
Relevant Terraform Configuration
With this configuration I can allow one project to have access to this project.
If I remove this ressource, the access is removed. However I can recreate the token scope manually in UI or using the API, and terraform configuration has no way to know.
resource "gitlab_project_job_token_scope" "allowed_single_project" {
project = "gitlab-org/gitlab"
target_project_id = 123
}
Additional Details
I propose a new API to change this behavior:
resource "gitlab_project_job_token_scope" "token" {
project = "gitlab-org/gitlab"
target_projects = [123]
}
That way, if I want know project to have access I can provide an empty list to the target_projects argument.
Edited by Jeremy T