Terraform should have remained stateless

This page summarizes the projects mentioned and recommended in the original post on news.ycombinator.com

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • libaws

    aws should be easy

    amen! as another commenter here rightly put:

    state or idempotency, pick one.

    hello? how is this even a question. i have a hard time believing that idempotent infrastructure mutations are not the right move almost always.

    shameless plug[1], i’ve been exploring an aws specific approach to infrastructure that is stateless and idempotent for exactly these reason.

    slow, finicky, stateful deploys are about as awful as it gets. add a pinch of lowest common denominator among all providers, and that’s a tough pill to swallow.

    there’s got to be another way, aws should be fun!

    1. https://github.com/nathants/libaws

  • troposphere

    troposphere - Python library to create AWS CloudFormation descriptions

    Wouldn't using troposphere[1] be easier?

    [1] https://github.com/cloudtools/troposphere

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

  • terraformer

    CLI tool to generate terraform files from existing infrastructure (reverse Terraform). Infrastructure to Code

    I haven't found a good way to handle resources that were created outside TF. Like a EC2 instance running in staging to debug an issue, but then forgotten about. They don't exist in TF state or config so TF simply ignores them.

    I've tried terraformer[1], but I can't tell how well maintained that is (it failed to get my creds, I had to modify the code to fix it, and then it crashed with an obscure error).

    Anyone have a good approach?

    1. https://github.com/GoogleCloudPlatform/terraformer

  • terraform-cdk

    Define infrastructure resources using programming constructs and provision them using HashiCorp Terraform

    Did you give a try to https://www.terraform.io/cdktf ?

    Unfortunately, it is not stable yet... but we all used Terraform <1.0 for years, and I'd say the experience was never that bad.

  • terraform-provider-dominos

    The Terraform plugin for the Dominos Pizza provider.

  • kapp

    kapp is a simple deployment tool focused on the concept of "Kubernetes application" — a set of resources with the same label

    i think kubernetes is not a great example in favor of more client state (like tf) since k8s has uniform resource structure (metadata.*) and first class labeling support. but as you point out kubectl doesnt use labels well (at least imho).

    when building https://carvel.dev/kapp (which i think of as "optimized terraform" for k8s) the goal was absolutely to take advantage of those k8s features. we ended up providing two capabilities: direct label (more advanced) and "app name" (more user friendly). from impl standpoint, difference is how much state is maintained.

    "kapp deploy -a label:x=y -f ..." allows user to specify label that is applied to all deployed resources and is also used for querying k8s to determine whats out there under given label. invocation is completely stateless since burden of keeping/providing state (in this case the label x=y) is shifted to the user. downside of course is that all apis within k8s need to be iterated over. (side note, fun features like "kapp delete -a label:!x" are free thanks to k8s querying).

    "kapp deploy -a my-app -f ..." gives user ability to associate name with uniquely auto-generated label. this case is more stateful than previous but again only label needs to be saved (we use ConfigMap to store that label). if this state is lost, one has to only recover generated label.

    imho k8s api structure enables focused tools like kapp to be much much simpler than more generic tool like terraform. as much as i'd like for terraform to keep less state, i totally appreciate its needs to support lowest common denominator feature set.

    common discussion topics:

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts