Increase type safety
See original GitHub issueFeel free to reject this as something out of cloudform
’s scope:
It’d be great if cf.Fn.Ref()
calls failed to compile if the referenced resource doesn’t exist in the template.
I have an example project that deploys an ECS cluster and a service with cloudform: https://github.com/wolverian/ts-ecs-example. From writing it (and from using cloudform in another, private project), one of the biggest pain points I’ve experienced is making sure I give the correct string values to cf.Fn.Ref()
and cf.Fn.GetAtt()
.
I don’t have a concrete suggestion how to implement this, but any ideas are welcome.
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Type Safety in Programming Languages - Baeldung
Type safety in the source code is a programming language control that ensures that any variable access only its authorized memory locations in...
Read more >Achieve Type Safety With TypeScript Magic - Level Up Coding
In this article, we walk through a real-world refactoring example of using advanced types. The result is a concise and well-constrained type.
Read more >Type safety - Wikipedia
In computer science, type safety and type soundness are the extent to which a programming language discourages or prevents type errors. Type safety...
Read more >How to Actually Improve Type Safety with the TypeScript Strict ...
Read on to find out why enabling the strict TypeScript compiler flags “the hard way” is worth it in the long term for...
Read more >Increasing TypeScript Type-Safety - Rasmus Olsson
Even though TypeScript have type-checking and type-safety you can opt out by using the type "any" for a variable or function.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I strongly recommend to add a linter step (we use
cfn-lint
) over the CloudForm result for additional validation. It’s not perfect, but this can grab not only resource reference issues, but some other errors too.LGTM. I think I prefer the latter approach, as it looks simpler. I’ll play around with this approach a bit and see how it works. I’ll report if I bump into problems. I’d be happy to contribute a PR later, though it’s fine if you implement this before I get around to it. 👍