Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token Token(DECIMAL, '0') when loading terraform file #72

Open
Ozymandiiaz opened this issue Jul 8, 2021 · 3 comments
Open

Comments

@Ozymandiiaz
Copy link

Hello,

I have this error when trying to load a terraform output file :

Unexpected token Token(DECIMAL, '0') at line 3, column 75.
Expected one of:
        * __ANON_3

My terraform output file

output "webapp_site_credential_user_name" {
  description = "Credentials of Webapp"
  value       = join("", azurerm_app_service.appservice.*.site_credential.0.username)
}

It's seems the hcl2.load(file) does not like the "site_credential.0" even if this code is working in terraform.
How can i fix this without changing my terraform code ?

@M-Rushabh
Copy link

#####################################################################

Terraform module to create web tier for web-tier

#####################################################################

output "instances_ips" {
value = join(",", concat(ibm_is_instance.instance_az1..primary_network_interface.0.primary_ipv4_address,ibm_is_instance.instance_az2..primary_network_interface.0.primary_ipv4_address))
}

output "instances_names" {
value = concat(ibm_is_instance.instance_az1..name, ibm_is_instance.instance_az2..name)
}

Getting same issue for above block in terraform
Can some one please look into it

@M-Rushabh
Copy link

M-Rushabh commented Sep 2, 2021

@aoskotsky-amplify @ahlinc @pbchekin @greut @mariusvniekerk @stpierre
we are using this pakcage for hcl to json conversion ..can you please look into it on priority ?

@aoskotsky-amplify
Copy link
Member

I don't believe that is valid hcl2. You should be doing join("", azurerm_app_service.appservice.*.site_credential[0].username). See https://github.com/hashicorp/hcl/blob/main/hclsyntax/spec.md#attribute-access-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants