invalid characters in heredoc anchor

562 views
Skip to first unread message

venkatra...@gmail.com

unread,
May 10, 2018, 1:23:55 AM5/10/18
to Terraform

Hi,
Iam new to Terraform
Getting error while deploy : invalid characters in heredoc anchor (line 6:14) (data = <<EOF)
Syntax:

resource "camc_bootstrap" "Hostname_chef_bootstrap_comp" {
	name = "Hostname_chef_bootstrap_comp"
	camc_endpoint = "http://${var.ibm_pm_service}:5443/v1/bootstrap/"  
	access_token = "${var.ibm_pm_access_token}"
	trace = "true"
	data = <<EOF 
	{
		"os_admin_user" = "${var.os_admin_user}",
		"stack_id" = "${var.ibm_stack_id}",
		"environment_name" = "_default",
		"host_ip" = "${var.ipv4_address}",
		"node_name" = "${var.name}",
		"node_attributes" = {
			"ibm_internal" = {
				"stack_id" = "${var.ibm_stack_id}",
				"stack_name" = "${var.name}",
				"vault" = {
					"item" = "secrets",
					"name" = "${var.ibm_stack_id}"
				}
			}
		}
	}
	EOF
}
========================================================================================================
I have try to validate with tf (https://www.hcl2json.com/) 
Kindly guide me to fix this issue
Thanks

Clint Shryock

unread,
May 14, 2018, 5:25:20 PM5/14/18
to terrafo...@googlegroups.com
Hello –

I believe your JSON and HEREDOC needs to be anchored on the left, not indented:

```
data = <<EOF 
{
[...]

--
This mailing list is governed under the HashiCorp Community Guidelines - https://www.hashicorp.com/community-guidelines.html. Behavior in violation of those guidelines may result in your removal from this mailing list.
 
GitHub Issues: https://github.com/hashicorp/terraform/issues
IRC: #terraform-tool on Freenode
---
You received this message because you are subscribed to the Google Groups "Terraform" group.
To unsubscribe from this group and stop receiving emails from it, send an email to terraform-tool+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/terraform-tool/6410e155-9007-4700-875c-31b44c275334%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages