Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Mark data+raw resource attributes as sensitive. #57

Merged
merged 1 commit into from
Jan 23, 2021

Conversation

samcday
Copy link
Contributor

@samcday samcday commented Dec 14, 2020

This ensures that when data from this plugin is passed around, it's hidden from display no matter what.

https://www.terraform.io/docs/configuration/expressions/references.html#sensitive-resource-attributes

@carlpett
Copy link
Owner

@samcday, I'm very sorry for missing the notification about this!
Thanks a lot for the PR!

@carlpett carlpett merged commit c05e7a4 into carlpett:master Jan 23, 2021
@worldofgeese
Copy link

Is this available in 0.6?

@carlpett
Copy link
Owner

Yes. Is it not working as expected?

@worldofgeese
Copy link

worldofgeese commented Feb 15, 2021

@carlpett well, I may be using it wrong but k8s_manifest.cloudflare_api_token_secret is displaying everything inside the decrypted raw sops yaml I provide it:

  # k8s_manifest.cloudflare_api_token_secret will be created
  + resource "k8s_manifest" "cloudflare_api_token_secret" {
      + content = <<~EOT
            apiVersion: v1
            kind: Secret
            metadata:
                name: cloudflare-api-token-secret
                namespace: cert-manager
            type: Opaque
            stringData:
                api-token: super-secret-api-token
        EOT
      + id      = (known after apply)
    }

Here's the bit of relevant HCL:

resource "k8s_manifest" "cloudflare_api_token_secret" {
  content = data.sops_file.cloudflare_api_token_secret.raw
  depends_on = [
    helm_release.cert_manager,
  ]
}

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants