github.com/atsaki/terraform@v0.4.3-0.20150919165407-25bba5967654/website/source/docs/providers/template/r/file.html.md (about)

     1  ---
     2  layout: "template"
     3  page_title: "Template: template_file"
     4  sidebar_current: "docs-template-resource-file"
     5  description: |-
     6    Renders a template from a file.
     7  ---
     8  
     9  # template\_file
    10  
    11  Renders a template from a file.
    12  
    13  ## Example Usage
    14  
    15  ```
    16  resource "template_file" "init" {
    17      filename = "${path.module}/init.tpl"
    18  
    19      vars {
    20          consul_address = "${aws_instance.consul.private_ip}"
    21      }
    22  }
    23  
    24  ```
    25  
    26  ## Argument Reference
    27  
    28  The following arguments are supported:
    29  
    30  * `filename` - (Required) The filename for the template. Use [path
    31      variables](/docs/configuration/interpolation.html#path-variables) to make
    32      this path relative to different path roots.
    33  
    34  * `vars` - (Optional) Variables for interpolation within the template.
    35  
    36  ## Attributes Reference
    37  
    38  The following attributes are exported:
    39  
    40  * `filename` - See Argument Reference above.
    41  * `vars` - See Argument Reference above.
    42  * `rendered` - The final rendered template.
    43  
    44  ## Template files syntax
    45  
    46  The syntax of the template files is [documented here](/docs/configuration/interpolation.html), under the "Templates" section.