AWS Builder Center

Terraform Sensitive Flag

Mask sensitive data in terraform output cli without impacting state file.

Series: AWS and Terraform (4 articles)

  1. 1
    Terraform Sensitive Flag This article
Recently in one of our implementations, we came across a parameter which was display in our GitHub actions log. It was shown because it was one of the output values.

Before masking:

output "token" {
value = token
}
Output in GitHub console after Terraform apply:
Outputs:
token = "abcdefgh"

After masking as sensitive output:

output "token" {
value = token
sensitive = true
}
Output in GitHub console after Terraform apply:
Outputs:
token = <sensitive>

Series: AWS and Terraform (4 articles)

  1. 1
    Terraform Sensitive Flag This article
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article