DXE-3244 Multiline note in Activation leads to invalid property.tf
mehanig opened this issue · comments
Hello,
I wanted to report an issue with Multiline comment in activation, which leads to invalid configuration file produced by akamai terraform --section default export-property <property_name>
To repro the issue:
- activate property version with multiline comment:
![image](https://private-user-images.githubusercontent.com/5033274/277514815-efda42ca-8179-4e96-8a37-d012cecc5c8b.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjE2MDM1MjgsIm5iZiI6MTcyMTYwMzIyOCwicGF0aCI6Ii81MDMzMjc0LzI3NzUxNDgxNS1lZmRhNDJjYS04MTc5LTRlOTYtOGEzNy1kMDEyY2VjYzVjOGIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcyMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MjFUMjMwNzA4WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9YjkxNTY0MWI1NzY5Yjc5MGI3ZTgyNzQ5MDlmZWYwYzE0ZThlMGFmNzcyY2QxNTRiZTg3ZDJiOGE0MGY1MTQ2MSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.4_5xGDn-JxeGVr6AVhMrS6tCqaCiEAArqjOV8dTlms4)
resulted property.tf
contains multiline comment, but it's not properly formatted and results in terraform init
not working:
Terraform can determine which modules and providers need to be installed.
╷
│ Error: Invalid multi-line string
│
│ on property.tf line 44, in resource "akamai_property_activation" {{property_name}}:
│ 44: note = "Multiline
│ 45: Comment"
│
│ Quoted strings may not be split over multiple lines. To produce a multi-line string, either use the \n escape to represent a newline character or use the "heredoc"
│ multi-line template syntax.
╵
╷
│ Error: Unterminated template string
│
│ on property.tf line 44, in resource "akamai_property_activation" {{property_name}}:
│ 44: note = "Multiline
│ 45: Comment"
│
│ No closing marker was found for the string.
I can see that the similar issue was reported with #24 but there was no repro provided.
I also searched a bit through the source code, to find if the issue was easy to spot, but wasn't able to find a problem with how configuration is created.
Fix for this was included in end of October release.