hcledit
hcledit copied to clipboard
Unable to get/set attributes more than 4 levels deep
Hi, I'm trying to set attribute in the following file
data "terraform_remote_state" "state" {
config = {
workspaces = {
name = "tt-test"
}
}
}
but without the luck. No output there. The command I used was
cat ./remote-states.tf | /scripts/hcledit attribute get data.terraform_remote_state.state.config.workspaces.name
The only thing I could get is
> cat ./remote-states.tf | /scripts/hcledit attribute get data.terraform_remote_state.state.config
{
workspaces = {
name = "tt-test"
}
}
Is it possible to do by hcledit?
Any response will be appreciated
I think this is answered here:
https://github.com/minamijoyo/hcledit/issues/44#issuecomment-1040292871
In the HCL specification, foo {} is a block and foo = {} is an attribute with an object type. Note that = means the attribute syntax. With that in mind, a hypothetical address notation could be terraform.required_providers.aws["version"]
However, the address index reference notation has not been implemented yet due to technical limitations of the hclwrite package in the upstream hcl library we depends on.
Looking for the same thing.
Closed this as duplicate of #44, which is also closed as duplicate of #28.