Skip to content

[MAINT]: Replace the various secret patterns implemented in the provider with a more concrete and predictable solution #2913

Closed

Description

@nickfloyd

Describe the need

From #2903

Problem:
We keep getting impacted by Error: Invalid provider configuration resulting from the various ways the provider checks and creates secrets.

This particular issue has plagued our last few deployments and it originated from a very old PR being introduced and released which changed how we handle secrets.

We have about 4 different implementations, that exist in 6 different resources, of how we handle secrets scoped to specific areas. These various implementations have made it difficult to determining what is idiomatic for this provider given it's been done differently in the resources here:

resource_github_actions_environment_secret.go
resource_github_actions_secret.go
resource_github_actions_organization_secret.go
resource_github_dependabot_organization_secret.go
resource_github_codespaces_organization_secret.go
resource_github_codespaces_user_secret.go

The destroy_on_drift pattern is problematic at best - its unpredictable, does not fit our idioms, and the detection is unreliable.

Some of our implementations have Update functions + ForceNew (which are causing InternalValidate errors), some perform recreation ForceNew , some have internalized logic into destroy_on_drift , not to mention that there are different field evaluations and configurations across resources.

@stevehipwell tossed out the idea around having a "secret version field" - that approach seems to fit the provider well and it would let us rip out the convoluted conditional logic around setting and unsetting fields as well as be much more deterministic. This field would control when the secret value is updated and would give user's far more control.

SDK Version

v6.8.3

API Version

No response

Relevant log output

Code of Conduct

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

Activity

  1. added
    Status: Triage
    Type: Maintenance
    on Nov 17, 2025
  2. added theissue type on Nov 17, 2025
  3. added this to the v7.0.0 Release milestone on Nov 19, 2025
  4. stevehipwell commented on Nov 19, 2025

    @stevehipwell
    Collaborator

    It looks like we may be able to use the write only pattern as it was only ephemeral resources that weren't backported to the SDK. This would depend on #2922 as the SDK needs updating for this.

  5. removed
    Status: Triage
    on Jan 15, 2026
  6. moved this from Backlog to In Progress in Terraform Provideron Jan 15, 2026
  7. moved this from In Progress to Done in Terraform Provideron Feb 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type: Maintenance

    Type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions