Skip to content

Can I see which keys in a kubernetes_secret data will be updated in-place, without revealing the sensitive values?Β #2790

@henrahmagix

Description

@henrahmagix

Terraform version, Kubernetes provider version and Kubernetes version

Terraform version: 1.13.2
Kubernetes Provider version: 2.36.0
Kubernetes version: 1.32.6

Terraform configuration

resource "kubernetes_secret" "db_connection" {
  metadata {
    namespace = "default"
    name = "db_connection"
  }

  data = {
    host                        = some_database_resource.ip_address
    database                    = some_database_resource.my_database.name
    username                    = some_database_resource.my_user.name
    password                    = some_database_resource.my_user.password
  }
}

Question

Is there a way to output which keys specifically are going to change, in the plan output? Or is there a separate command I can run to get such information without revealing sensitive values?

Given a kubernetes_secret resource with data set to a map, when one value in data is going to change but not all of them, the Plan output just says ~ data = (sensitive value). For my uses, the keys aren't sensitive, only the values are.

E.g. if the database resource's IP address changes:

Actual

  # kubernetes_secret.db_connection will be updated in-place
  ~ resource "kubernetes_secret" "db_connection" {
      ~ data                           = (sensitive value)
        id                             = "default/db_connection"
        # (5 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Expected

    # kubernetes_secret.db_connection will be updated in-place
  ~ resource "kubernetes_secret" "db_connection" {
      ~ data {
          ~ host = (sensitive value)
          # (3 unchanged attributes hidden)
        }
        id                             = "default/db_connection"
        # (5 unchanged attributes hidden)

        # (1 unchanged block hidden)
    }

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions