hcl icon indicating copy to clipboard operation
hcl copied to clipboard

Is There a Way to Generate Anonymous Blocks with Variable References

Open SachithKasthuriarachchi opened this issue 5 months ago • 1 comments

Hi, Is there any guide on generating something like the following in go?

data = {
    config.hcl = data.template_file.vault_config.rendered
}

Attempt

dataMap := map[string]cty.Value{
		"config.hcl": cty.StringVal("data.template_file.vault_config.rendered"),
}
body.SetAttributeValue("data", cty.ObjectVal(dataMap))

However this generates the following (with quotes)

data = {
    "config.hcl" = "data.template_file.vault_config.rendered"
}

SachithKasthuriarachchi avatar Aug 29 '24 07:08 SachithKasthuriarachchi