Describe the need
The github_organization_security_configuration and github_enterprise_security_configuration resources are being added in #3284. As @stevehipwell suggested in his review there, it would be valuable to also provide matching data sources so configurations can be looked up/read without managing them:
data "github_organization_security_configuration" — read an organization code security configuration (by name and/or configuration_id)
data "github_enterprise_security_configuration" — read an enterprise code security configuration (by enterprise_slug + name/configuration_id)
This follows the usual provider convention of pairing resources with read-only data sources (e.g. github_actions_organization_permissions recently got a data source in #3465), and enables common workflows like referencing GitHub's built-in preset configurations (e.g. "GitHub recommended") or an externally-managed configuration from Terraform.
The GitHub REST API supports the reads already (GET /orgs/{org}/code-security/configurations, GET /enterprises/{enterprise}/code-security/configurations).
Tracking this separately from #3284 per the maintainer's suggestion to keep the resource PR focused. Happy to open a PR for it once the resources land.
Code of Conduct
Describe the need
The
github_organization_security_configurationandgithub_enterprise_security_configurationresources are being added in #3284. As @stevehipwell suggested in his review there, it would be valuable to also provide matching data sources so configurations can be looked up/read without managing them:data "github_organization_security_configuration"— read an organization code security configuration (by name and/orconfiguration_id)data "github_enterprise_security_configuration"— read an enterprise code security configuration (byenterprise_slug+ name/configuration_id)This follows the usual provider convention of pairing resources with read-only data sources (e.g.
github_actions_organization_permissionsrecently got a data source in #3465), and enables common workflows like referencing GitHub's built-in preset configurations (e.g. "GitHub recommended") or an externally-managed configuration from Terraform.The GitHub REST API supports the reads already (
GET /orgs/{org}/code-security/configurations,GET /enterprises/{enterprise}/code-security/configurations).Tracking this separately from #3284 per the maintainer's suggestion to keep the resource PR focused. Happy to open a PR for it once the resources land.
Code of Conduct