Matt Gowie’s Post

View profile for Matt Gowie, graphic

CEO/CTO @ Masterpoint | Get control of your Infrastructure as Code workflows

Awesome TF functionality that only #OpenTofu supports: **Dynamic Backends** ⚡ With a couple of our clients, we see them utilize different backend state s3 buckets for each instance of their root modules e.g. they have a Dev, Stage, and Prod state bucket and use the `-backend-config=...` CLI arg to determine which state they're working on. This typically requires some script or wrapper for Terraform to do that type of dynamic "init with this backend bucket". But now... with OpenTofu v1.8+ and "Early Evaluation", that is a thing of the past! Check out the code in my screenshot below for what I'm referring to. With Terraform or prior to Tofu v1.8, you can't use variables in your backend config. But now that you can this means that you don't need to think about "did I init against the dev or the prod backend for this run?" -- You can instead just provide variable inputs in your tfvars files that define which backend you want to use. We got to recommend this to a new client recently and it was a BIG reduction to the overall complexity of their vanilla Tofu usage! Love to see new features from the OpenTofu team actually being used 🙌

  • No alternative text description for this image
Matt Gowie

CEO/CTO @ Masterpoint | Get control of your Infrastructure as Code workflows

1d

Want to learn more about early evaluation? Check out the "what's new" post for OpenTofu 1.8: https://opentofu.org/docs/intro/whats-new/#early-variablelocals-evaluation

Perhaps automating the deployment process using CI/CD would make the requirement to switch backend rather irrelevant? Just a thought...🤦♂️

Jordan 🦗 Moore

Senior Software Engineer | Making Flash great again | 6x certified BigData DevOps Engineer | LeanFIRE Investor | 15M+ users reached on StackOverflow; Top voice on apache-kafka tagged content #SOReadyToHelp

7h

Thanks. Would rather use CDKTF

Troy Knapp

Senior DevOps Engineer at SumerSports

1d

This makes so much sense, and the ability to allow fine grain access to state files based on environment access is a huge win.

Rafael Veloso da Silva

@Bradesco | Platform Engineer | Senior Consultant | Azure Solutions Architect | AWS | Terraform | Azure Devops

1d
Jeffrey Landis

Chief Technology Officer @ MVI Ventures | DevOps, SRE, IaC, CI/CD

19h

Exciting to see OpenTofu continuing to innovate with dynamic backends in version 1.8! I’m also looking forward to version 1.9, now in beta, which introduces for_each loops in providers—a game-changing feature that enables configurations to dynamically iterate over a set of regions. While the feature is somewhat limited in its current implementation, it’s great to see progress in this area. https://opentofu.org/blog/opentofu-1-9-0-beta1/

I’ve been wanting this feature since I started. Might have to give Open Tofu a shot!

HashiCorp is so lame it took 10+ years and outside developers to implement VARIABLES where it really counts.

Awesome stuff with the “dynamic “ backend

See more comments

To view or add a comment, sign in

Explore topics