-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
HEREDOC parsing error after updating to 0.6.7 #4065
Comments
If this worked before I'd call it a regression. I'll investigate fixing it. This was likely introduced in the new HCL parser used in Terraform 0.6.7. |
My heredocs also broke in 0.6.7. I am not sure if the use of a numeric in the HEREDOC name is invalid (couldn't quickly find confirmation) but anyway, these don't parse anymore: variable "whitelist-all" { If I change to: variable "whitelist-all" { everything is okay. So not line endings in my case... Looks like the HEREDOC parser has been 'improved' in general... |
This fixes a regression in Terraform where HEREDOCS were previously supported in lists, reported in hashicorp/terraform#4065.
@marekrogala I've fixed the HCL parser and added better test coverage around this in Terraform itself as well as in the HCL library. @mrwilby, there were major changes to the entire HCL parser (it was completely rewritten), and Terraform 0.6.7 is the first release of any HashiCorp product to use it. Your example looks good, so if it's not parsing, that is a bug we should address. I'll open a new issue for it though, since the fix here is unlikely to resolve it. |
Hey folks, this should be fixed with 0.6.8! Please feel free to follow up or file a fresh issue if you still see any HEREDOC problems on 0.6.8. |
Hello Guys, I am receiving a heredoc issue from the following Terraform script: provider "aws"{ #S3_Access resource "aws_iam_instance_profile" "s3_access"{ resource "aws_iam_role_policy" "s3_role_policy"{ { {"Action": "s3:", resource "aws_iam_role" "s3_access"{ { {"Action": "sts:AssumeRole",
] } resource "aws_vpc" "vpc"{ resource "aws_internet_gateway" "internet_gateway"{ resource "aws_route_table" "route_table"{ route { resource "aws_default_route_table" "private"{ resource "aws_subnet" "public"{ resource "aws_subnet" "private1"{ resource "aws_subnet" "private2"{ resource "aws_subnet" "rds1"{ resource "aws_vpc_endpoint" "private-s3"{ {"Version": "2012-10-17", {"Action": "", resource "aws_subnet" "rds2"{ resource "aws_subnet" "rds3"{ resource "aws_subnet_association" "public_assoc"{ resource "aws_subnet_association" "private1_assoc"{ resource "aws_subnet_association" "private2_assoc"{ resource "aws_db_subnetgroup" "rds_subnetgroup" resource "aws_security_group" "public"{ ingress{ ingress { egress { resource "aws_security_group" "private"{ ingress { egress{ resource "aws_security_group" "rds_subnetgroup" ingress{ resource "aws_db_instance" "db" { resource "aws_key_pair" "auth"{ resource "aws_s3_bucket" "code"{ } resource "aws_instance" "dev"{ provisioner "local-exec" { provisioner "local-exec" { } #Load Balancer resource "aws_elb" "prod"{ health_check { cross_zone_load_balancing = true tags { #AMI resource "random_id" "ami"{ resource "aws_ami_from_instance" "golden"{ #!/bin/bash resource "aws_launch_configuration" "lc"{ resource "aws_autoscaling_group" "asg"{ tag {
} resource "aws_route53_zone" "primary"{ resource "aws_route53_record" "www"{ alias { resource "aws_route53_record" "dev"{ resource "aws_route53_record" "db"{ |
Hi @TrentNow! The issue discussed here was fixed and tested several major versions ago, so the error you're seeing here is most likely something separate. If you open a new issue for this, and fill out the new issue template, we can dig into it and see what's going on there. Thanks! |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
I'm using a provisioning step that looks like this (but with more lines):
After upgrading to 0.6.7 it started to fail with the following error:
Error loading config: Error parsing file.tf: At 44:1: unexpected token while parsing list: HEREDOC
Is this expected behavior? Can I use HEREDOC in lists or why not?
The text was updated successfully, but these errors were encountered: