Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Handle nested interpolations#61

Merged
aoskotsky-amplify merged 8 commits into
amplify-education:masterfrom
arielkru:patch-4
Feb 22, 2022
Merged

Handle nested interpolations#61
aoskotsky-amplify merged 8 commits into
amplify-education:masterfrom
arielkru:patch-4

Conversation

@arielkru

@arielkru arielkru commented Mar 4, 2021

Copy link
Copy Markdown
Contributor

Nested interpolations are raising errors.
The fix lets interpolations contain other interpolations inside them, like this example:

resource "example" "example" {
tags = "${merge(var.common_tags, map( "name", "dependency", "${var.input_dependency_value}"))}"
}

@aoskotsky-amplify aoskotsky-amplify left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. Thanks for the PR!

Could you update the unit tests to add an example that covers this case?

@matt-land

Copy link
Copy Markdown

I will add unit tests, this is an issue I was facing and unable to solve.

@matt-land

Copy link
Copy Markdown

I created the tests, and PR'ed against the repo that opened the PR.
However, one of the test cases isn't working. I believe the test is correct, and that the parser is not able to process the string interpolation correctly, even with the new functionality.

arielkru#1

The test cases I added are representative of actual TF string interpolations I am encountering/using. I was unable to extend the Lark functionality to handle them.

@aoskotsky-amplify

Copy link
Copy Markdown
Member

@matt-land I had to update the tests 7020ee0 to include the fixed list handling that was added in 3.0.0 but otherwise the tests look fine to me. Let me know which one was failing for you

@aoskotsky-amplify aoskotsky-amplify merged commit b4d8760 into amplify-education:master Feb 22, 2022
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 this pull request may close these issues.

4 participants