Sensitive Outputs

Last updated

What is Sensitive Outputs?

Terraform sensitive outputs are a feature used to protect sensitive information in Terraform configurations. When an output is marked as sensitive, Terraform obscures its value in the console output, displaying it as <sensitive> instead of the actual value. This is crucial for protecting sensitive data like passwords or API keys.

To mark an output as sensitive, use the sensitive argument in the output block:

output "database_password" {
  value     = aws_db_instance.example.password
  sensitive = true
}

Sensitive outputs are still accessible programmatically and are written to the state in clear text, but their values are hidden in logs and the console to prevent accidental exposure. This feature helps maintain security when sharing Terraform configurations or outputs with team members or in CI/CD pipelines.

Free resources to learn Sensitive Outputs

More in stage 6: Outputs

Sensitive Outputs: common questions

Can I learn Sensitive Outputs in Hindi?

This lesson is written in English. Once you sign in, open it in the interactive course and ask the AI tutor to explain Sensitive Outputs in Hindi or Hinglish. The tutor answers from this lesson’s own text, so it stays on the syllabus, and it runs on your own Google, OpenAI or Anthropic key.

Is this Sensitive Outputs tutorial for beginners?

It is lesson 26 of 110 in the free Terraform roadmap, in stage 6, Outputs. If you are new to Terraform, start from stage 1 and come back here in order; if you already know the earlier stages, this lesson stands on its own.

Still confused? Ask me