-
Notifications
You must be signed in to change notification settings - Fork 602
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
E0002/W1001 Edge Case: Fn::Transform in Fn::Sub.String #2587
Comments
Looks like we might have regressed? #920 |
This seems to be a non-fatal issue here as well: Lines 218 to 225 in f4df1d2
🔍 Stack Trace
|
That PR is a separate rule, but likely regressed in #2525 More generally, tracking transform support in #476. It's been open for a while, but I still think some general solution will be more sustainable than if-statements across all individual rules that could be affected by transforms |
I'm seeing errors across the board. I think what makes sense is to validate that the
with that change:
|
@kddejong Any insights on the documentation discrepancy? (Not sure where/what the source of truth here is.) |
@LaikaN57 I'll look into it |
So talked to @TheDanBlanco and transforms are run before anything else is processed. So Transform can be any place in a template including in a sub. I think the documentation around what is supported in a Sub is meant to represent what is supported once all the Transforms are complete. |
ok I think my doc fix request still stands in that case. Thanks for the quick turn-around on this! |
We will have this fix in the next release. |
CloudFormation Lint Version
0.73.1
What operating system are you using?
macOS 13.1 (22C65)
Describe the bug
Context
W1001
Checks forRef
's to conditional resources inFn::Sub
'sString
parameter (ie. 0th list index).🐛 Bug
Using an
Fn::Transform
breaks this check during a regex scan forRef
tokens in theFn::Sub
'sString
parameter as the regex is expecting a string type.🔍 Stack Trace
Expected behavior
I would expect that
Fn::Sub
's which contain anFn::Transform
as theString
parameter to be evaluated "post-transform" forW1001
.Alternatively, I would expect that using an
Fn::Transform
as theString
parameter in anFn::Sub
would result in a different warning as some type of "bad practice".📖 Doc Findings
AWS CloudFormation User Guide -
Fn::Sub
Supported functionsI believe the doc is making this statement as it applies to "post-transform". I will open a related docfix issue against that page to make this entry more correct.
Reproduction template
Partial
The text was updated successfully, but these errors were encountered: