docs icon indicating copy to clipboard operation
docs copied to clipboard

Add docs on when to use data sources

Open osterman opened this issue 5 years ago • 0 comments

Quoting from slack:

Hi All, got sort of an opinion question here. Does anyone have a preference on using remote state for looking up resources, or using data sources to look them up at runtime? Been trying to research, and not having much luck finding which is recommended or preferred

Rhawnk 13 minutes ago I assume it might be related to a size thing, that is size of terraform repos, or amount of resources under management

Erik Osterman (Cloud Posse) 7 minutes ago I don't think there's a black/white rule on this. Off the cuff, here's my recommendation: Use SSM for sharing values across toolchains (e.g. #terraform and helmfile) or where you need to access the values outside of terraform Use remote state between terraform projects. E.g. everything you provision that you are in control over. Use data sources for things which you might not have control over but depend on. New

Rhawnk 3 minutes ago Thanks @Erik Osterman (Cloud Posse), this pretty much aligns with at least my personal opinion. Though i never thought about the first bullet, that is a really cool idea

osterman avatar Aug 11 '20 21:08 osterman