cloudposse-archives / tfmask

Terraform utility to mask select output from `terraform plan` and `terraform apply`
https://cloudposse.com/accelerate
Apache License 2.0
202 stars 27 forks source link

mask external provider data #14

Open stempher opened 4 years ago

stempher commented 4 years ago

Hi I use an external provider and in the data block I can’t mask the token

data "external" "sa" {
  program = ["sh", "${path.module}/get_permission.sh"]
  query   = {
    token     = var.token
    url       = var.url
  }
}

Run:

export TFMASK_CHAR="#"
export TFMASK_VALUES_REGEX="(?i)^.*(secret|password|oauth|token|key).*$"
terraform plan -no-color | tfmask

Plan is not mask:

 <= data "external" "sa"  {
       + id      = (known after apply)
       + program = [
           + "sh",
           + "modules/k8s/get_permission.sh",
         ]
       + query   = {
           + "token"     = "eyJhbGci...."
           + "url"       = "https://..."
         }
       + result  = (known after apply)
     }