16.03.2017 Views

The Terraform Book

TheTerraformBook_sample

TheTerraformBook_sample

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 3: Building an application stack with <strong>Terraform</strong><br />

Outputs can also be marked as containing sensitive material by setting the<br />

sensitive attribute.<br />

Listing 3.49: <strong>The</strong> vpc module outputs<br />

output "public_subnet_id" {<br />

value = "${aws_subnet.public.id}"<br />

sensitive = true<br />

}<br />

When outputs are displayed—for instance, at the end of the application of a plan—<br />

sensitive outputs are redacted, with displayed instead of their value.<br />

NOTE This is purely a visual change. <strong>The</strong> outputs are not encrypted or<br />

protected.<br />

We’ll see how to use these outputs inside our stack configuration shortly.<br />

NOTE We recommend using a naming convention for <strong>Terraform</strong> files inside<br />

modules. This isn’t required but it makes code organization and comprehension<br />

easier. We use interface.tf for variables and outputs and main.tf for resources.<br />

With that our module is complete. Now let’s see it at work.<br />

Version: v1.1.1 (e771e4d) 39

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!