From 0540c213c0f20503ab27358c87a55c3b85e663bc Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Mon, 10 Apr 2017 12:29:20 -0400 Subject: [PATCH] Update template provider --- .../template/d/cloudinit_config.html.markdown | 2 +- .../docs/providers/template/d/file.html.md | 50 +++++++++---------- 2 files changed, 26 insertions(+), 26 deletions(-) diff --git a/website/source/docs/providers/template/d/cloudinit_config.html.markdown b/website/source/docs/providers/template/d/cloudinit_config.html.markdown index 46f3ca3c8d..6e6297a685 100644 --- a/website/source/docs/providers/template/d/cloudinit_config.html.markdown +++ b/website/source/docs/providers/template/d/cloudinit_config.html.markdown @@ -6,7 +6,7 @@ description: |- Renders a multi-part cloud-init config from source files. --- -# template\_cloudinit\_config +# template_cloudinit_config Renders a multi-part cloud-init config from source files. diff --git a/website/source/docs/providers/template/d/file.html.md b/website/source/docs/providers/template/d/file.html.md index e00107acc6..e28094b428 100644 --- a/website/source/docs/providers/template/d/file.html.md +++ b/website/source/docs/providers/template/d/file.html.md @@ -6,7 +6,7 @@ description: |- Renders a template from a file. --- -# template\_file +# template_file Renders a template from a file. @@ -18,11 +18,11 @@ Reference the template path: ```hcl data "template_file" "init" { - template = "${file("${path.module}/init.tpl")}" + template = "${file("${path.module}/init.tpl")}" - vars { - consul_address = "${aws_instance.consul.private_ip}" - } + vars { + consul_address = "${aws_instance.consul.private_ip}" + } } ``` @@ -38,11 +38,11 @@ Option 2: Inline: ```hcl data "template_file" "init" { - template = "$${consul_address}:1234" + template = "$${consul_address}:1234" - vars { - consul_address = "${aws_instance.consul.private_ip}" - } + vars { + consul_address = "${aws_instance.consul.private_ip}" + } } ``` @@ -83,14 +83,14 @@ To access interpolations that are normally available to Terraform configuration (such as other variables, resource attributes, module outputs, etc.) you'll have to expose them via `vars` as shown below: -``` +```hcl data "template_file" "init" { - # ... + # ... - vars { - foo = "${var.foo}" - attr = "${aws_instance.foo.private_ip}" - } + vars { + foo = "${var.foo}" + attr = "${aws_instance.foo.private_ip}" + } } ``` @@ -99,13 +99,13 @@ data "template_file" "init" { Inline templates allow you to specify the template string inline without loading a file. An example is shown below: -``` +```hcl data "template_file" "init" { - template = "$${consul_address}:1234" + template = "$${consul_address}:1234" - vars { - consul_address = "${aws_instance.consul.private_ip}" - } + vars { + consul_address = "${aws_instance.consul.private_ip}" + } } ``` @@ -116,15 +116,15 @@ the template. An example of mixing escaped and non-escaped interpolations in a template: -``` +```hcl variable "port" { default = 80 } data "template_file" "init" { - template = "$${foo}:${var.port}" + template = "$${foo}:${var.port}" - vars { - foo = "${count.index}" - } + vars { + foo = "${count.index}" + } } ```