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

(fix): Sub variables only saw References #94

Merged
merged 1 commit into from
Mar 22, 2023
Merged

(fix): Sub variables only saw References #94

merged 1 commit into from
Mar 22, 2023

Conversation

iph
Copy link
Collaborator

@iph iph commented Mar 22, 2023

So, when the Sub parser goes through, you can get a blob like:

"Fn::Sub": "echo ${lol}"

which would transform lol into a variable, as it's surrounded by ${}. It turns out that CFN doesn't need a reference of any kind, and will just output the string inside if it doesn't match any origin. Meanwhile, my system would attempt to topological sort lol off a Logical Id, but not find a Logical Id! So it would crash.

There were a few other bugs in this patch (escaping ticks, simplify the parser) that aren't worth mentioning.

So, when the Sub parser goes through, you can get a blob like:

```
"Fn::Sub": "echo ${lol}"
```

which would transform lol into a variable, as it's surrounded by ${}.
It turns out that CFN doesn't need a reference of any kind, and will just
output the string inside if it doesn't match any origin. Meanwhile, my system
would attempt to topological sort `lol` off a Logical Id, but not find a Logical
Id! So it would crash.

There were a few other bugs in this patch (escaping ticks, simplify the parser) that
aren't worth mentioning.
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.

1 participant