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

Format verbs for parameter names fail to parse as HCL #47

Closed
gdavison opened this issue Apr 19, 2021 · 0 comments · Fixed by #58
Closed

Format verbs for parameter names fail to parse as HCL #47

gdavison opened this issue Apr 19, 2021 · 0 comments · Fixed by #58
Milestone

Comments

@gdavison
Copy link
Contributor

gdavison commented Apr 19, 2021

When a configuration contains a format verb as a parameter name, it is replaced with a quoted string, which fails HCL parsing.

For example, in https://github.com/hashicorp/terraform-provider-aws/blob/38319aa13aea65d3e946450c1f881d8fef12e734/aws/resource_aws_efs_file_system_test.go#L832-L836

resource "aws_efs_file_system" "test" {
  lifecycle_policy {
    %s = %q
  }
}

Expected Result

The line %s = %q should replace the leading bare string with something compatible with HCL parsing

Actual Result

The line %s = %q is replaced with "@@_@@ TFMT:%s:TFMT @@_@@" = "@@_@@ TFMT:%q:TFMT @@_@@", and terrafmt fmt fails

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

Successfully merging a pull request may close this issue.

2 participants