Skip to content

[FEAT]: Data sources for code security configurations #3505

Description

@casey-robertson-paypal

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

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions