Add datasource gitlab_compliance_framework
New Data Source
The datasource for gitlab_compliance_framework.
Definition of a compliance framework on a project using the gitlab_project_compliance_framework resource requires the ID of the framework and not its name.
When association to a framework is done in another terraform stack than the one creating the framework, the ID needs to be hard coded or retrieved from remote states.
Related GitLab APIs
API documentation:
Requires the use of GraphQL (provider has a pattern for this), and would need to query using Namespace and Framework Name:
- GraphQL query: https://docs.gitlab.com/ee/api/graphql/reference/#querynamespace
- Using field arguments: https://docs.gitlab.com/ee/api/graphql/reference/#namespacecomplianceframeworks
The query would have to paginate through all potential pages of the compliance frameworks to determine if the name matches any. It could short-circuit on the first name match, but if none match it would have to iterate through all the pages.
Additional Details
-
GitLab REST API resources available (read for data sources, crud for resources) -
go-gitlab
does support the related GitLab API already -
I'd like to contribute it myself
Edited by Patrick Rice