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

Handle nested interpolations #61

Merged
merged 8 commits into from
Feb 22, 2022

Conversation

arielkru
Copy link
Contributor

@arielkru arielkru commented Mar 4, 2021

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}"))}"
}

Copy link
Member

@aoskotsky-amplify aoskotsky-amplify left a comment

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

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

@matt-land
Copy link

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
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