Feature Request - Data Source for handling Gitlab security-policies as code

New Data Source

Taken from @mpapadopoullos original submission:

  • Currently, if you want to have the security policies defined in TF, the only way is to include the content of the YAML file as a multiline string.
  • It would be nice to have a resource designed to generate the final YAML content written with TF constructs.

New Data Source that can be used to create and manage policies:

  • Pipeline Execution Policy
  • Scan Execution Policy
  • Vulnerability Management Policy
  • Merge Request Approval Policy

End Result will be used like:

data "gitlab_security_policy_document" "scan" {
  scan_execution_policy {
    rules { ... }
    actions { ... }
  }
}

resource "gitlab_repository_file" "policy" {
  content = data.gitlab_security_policy_document.scan.yaml
}

API documentation:

Existing Terraform Provider docs:

Additional Details

Edited by Carlos Corona