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

Support Template Substitutions in YAML files, regardless #312

Closed
2 tasks
zaus opened this issue Apr 29, 2024 · 6 comments
Closed
2 tasks

Support Template Substitutions in YAML files, regardless #312

zaus opened this issue Apr 29, 2024 · 6 comments
Labels
feature-request A feature should be added or improved. module/cli-ext needs-review

Comments

@zaus
Copy link

zaus commented Apr 29, 2024

Describe the feature

Just like #116 would like to use template substitutions with YAML configuration files.

Use Case

Specifically trying to transclude Step Function State Machine DefinitionString which just needs to smush the contents of a separate JSON file into the YAML, no special processing necessary.

Proposed Solution

Remove the templatebody type check, and just warn if it's not JSON. i.e. make it obvious enough to the user that it's their own fault for trying it.

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Targeted .NET platform

.NET 6+

CLI extension version

Package Id                      Version      Commands
------------------------------------------------------------------------
amazon.lambda.testtool-3.1      0.10.0       dotnet-lambda-test-tool-3.1
amazon.lambda.tools             5.10.4       dotnet-lambda
dotnet-xscgen                   2.0.662      xscgen

Environment details (OS name and version, etc.)

Windows 10

@zaus zaus added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2024
@ashishdhingra
Copy link
Contributor

@zaus Good afternoon. Could you please advise if this is a duplicate of #116 or if your scenario is different? Or is it to provide some kind of warning in the output?

Thanks,
Ashish

@ashishdhingra ashishdhingra added response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. and removed needs-triage This issue or PR still needs to be triaged. labels Apr 29, 2024
@zaus
Copy link
Author

zaus commented May 3, 2024

Slight nuance differs from #116 -- rather than properly support it with whatever that entails, I'm just looking for it to stuff the contents of another file (verbatim is fine?) into the main template. I'm hoping that current functionality will be sufficient for my purposes -- just get the JSON string from another file into the YAML, although being able to transclude other YAML snippets would be nice too.

@ashishdhingra
Copy link
Contributor

@zaus Good morning. Discussed the issue with the team. Could you please advise if the issue #314 is fixed, then this issue could be closed!

@zaus
Copy link
Author

zaus commented May 3, 2024

Yes that would solve my specific issue.

I still think transclusion regardless of template format would be a neat feature. Ideally something like how Serverless Framework variables can pull from other files, but without bothering to parse the external file for specifics, just embed the file contents where requested.

With this you could split deployment files into separate components (like reusing a file declaring all the Powertools environment variables instead of copy-pasting each time)

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to "closing-soon" in 7 days. label May 4, 2024
@ashishdhingra
Copy link
Contributor

For YAML parsing, we are relying on Yaml.NET and that package doesn't have support for JSONPath or it's equivalent. Hence, closing this issue.

@ashishdhingra ashishdhingra closed this as not planned Won't fix, can't repro, duplicate, stale May 10, 2024
Copy link

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved. module/cli-ext needs-review
Projects
None yet
Development

No branches or pull requests

2 participants