Files
opentf/website/source/docs/providers/template/index.html.markdown
Martin Atkins 861ac536dd provider/template: convert resources to data sources
The template resources don't actually need to retain any state, so they
are good candidates to be data sources.

This includes a few tweaks to the acceptance tests -- now configured to
run as unit tests -- since it seems that they have been slightly broken
for a while now. In particular, the "update" cases are no longer tested
because updating is not a meaningful operation for a data source.
2016-07-08 17:11:17 +01:00

744 B

layout, page_title, sidebar_current, description
layout page_title sidebar_current description
template Provider: Template docs-template-index The Template provider is used to template strings for other Terraform resources.

Template Provider

The template provider exposes data sources to use templates to generate strings for other Terraform resources or outputs.

Use the navigation to the left to read about the available data sources.

Example Usage

# Template for initial configuration bash script
data "template_file" "init" {
	template = "${file("init.tpl")}"

	vars {
		consul_address = "${aws_instance.consul.private_ip}"
	}
}

# Create a web server
resource "aws_instance" "web" {
    # ...

	user_data = "${data.template_file.init.rendered}"
}