github.com/minamijoyo/terraform@v0.7.8-0.20161029001309-18b3736ba44b/website/source/docs/providers/template/index.html.markdown (about) 1 --- 2 layout: "template" 3 page_title: "Provider: Template" 4 sidebar_current: "docs-template-index" 5 description: |- 6 The Template provider is used to template strings for other Terraform resources. 7 --- 8 9 # Template Provider 10 11 The template provider exposes data sources to use templates to generate 12 strings for other Terraform resources or outputs. 13 14 Use the navigation to the left to read about the available data sources. 15 16 ## Example Usage 17 18 ``` 19 # Template for initial configuration bash script 20 data "template_file" "init" { 21 template = "${file("init.tpl")}" 22 23 vars { 24 consul_address = "${aws_instance.consul.private_ip}" 25 } 26 } 27 28 # Create a web server 29 resource "aws_instance" "web" { 30 # ... 31 32 user_data = "${data.template_file.init.rendered}" 33 } 34 ```