Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree that state can be removed in Terraform.

But I do not believe leveraging tags and/or metadata is the right approach - configuration for these resources could potentially be large (e.g. GKE resources) and most providers will have a size constraint on their metadata and tag values. Creating a metadata/tag key for each configuration key would also get messy, but solves the value size problem.

Why wouldn’t it be possible to not store the previous state at all? Terraform’s job is to reconcile what exists with what is declared - we should be able to rely on the provider’s APIs to understand what exists, perform the diff, and reconcile the changes.



How would TF work without state and without tags?

Let's say your TF config declares a database Foo. Your AWS account has databases Foo and Bar. How does TF know whether it's responsible for database Bar and whether to delete it?


Resource is tagged with “terraform stack x created this”?


Interesting. Disregarding for a moment that not all cloud resources supporting tags on all cloud providers (and let's not get started with all the non-cloud stuff Terraform is capable to manage), how does tf know that `stack x` is the thing that's currently running?


By the time the tag has enough information to be useful, you are storing a TF state file in a tag. Anyway, I don't think people complaining about a s3 bucket for tf state actually has experience creating tools like tf.


The parent said he thinks tags aren't the right approach. I wanted to know what he proposes instead.


"should be able to rely on the provider’s APIs to understand what exists" is the crux of it. Provider APIs, in praxis, are insufficient / impractical.


If you deleted a resource block from a previously applied terraform declaration and reapplied it, how would the provider know that the resource in the environment needed to be deleted verses accepting it as an object not managed by terraform?

Where would it store it's history to make the diff against it?


Well, you can just delete/remove/clean everything visible and create only the things based on the configuration. Then you can't store any state in your Terraform-managed infrastructure, but for people that don't want state anyways, that is a blessing I guess?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: