github.com/hobbeswalsh/terraform@v0.3.7-0.20150619183303-ad17cf55a0fa/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 resources to use templates to generate 12 strings for other Terraform resources or outputs. 13 14 The template provider is what we call a _logical provider_. This has no 15 impact on how it behaves, but conceptually it is important to understand. 16 The template provider doesn't manage any _physical_ resources; it isn't 17 creating servers, writing files, etc. It is used to generate attributes that 18 can be used for interpolation for other resources. Examples will explain 19 this best. 20 21 Use the navigation to the left to read about the available resources. 22 23 ## Example Usage 24 25 ``` 26 # Template for initial configuration bash script 27 resource "template_file" "init" { 28 filename = "init.tpl" 29 30 vars { 31 consul_address = "${aws_instance.consul.private_ip}" 32 } 33 } 34 35 # Create a web server 36 resource "aws_instance" "web" { 37 # ... 38 39 user_data = "${template_file.init.rendered}" 40 } 41 ```