question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Increase type safety

See original GitHub issue

Feel 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:open
  • Created 5 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
fhewittcommented, Jun 11, 2018

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.

1reaction
wolveriancommented, Apr 19, 2018

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

Read more comments on GitHub >

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

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found