Switching from Terraform: Integrate with OpenTofu in Walrus
Tags: infrastructureascode, tutorial, terraform, opensource
Published: 2023-12-28 15:21:00

## What is OpenTofu?

[OpenTofu](https://opentofu.org/) is an open-source Infrastructure as Code (IaC) framework presented as an alternative to Terraform and managed by the Linux Foundation. It was developed in response to [HashiCorp's decision](https://www.hashicorp.com/blog/hashicorp-adopts-business-source-license) to change Terraform's licensing from the Mozilla Public License v2.0 (MPLv2) to a Business Source License v1.1. The aim of OpenTofu is to offer a dependable and impartial option for infrastructure as code management, ensuring it remains truly open-source under a stable license.

Under the guidance of the Linux Foundation, OpenTofu seamlessly replaces Terraform v1.6.x while ensuring complete backward compatibility with Terraform v1.5.x and its predecessors.

Since its inception, it has instantly sparked considerable interest. As of the time of this writing, the OpenTofu project has over 16K GitHub stars, while the OpenTofu Manifesto project has over 36K GitHub stars.

## Integrating OpenTofu in Walrus

By default, [Walrus](https://github.com/seal-io/walrus) uses Terraform as its deployment engine. Since OpenTofu is a drop-in replacement for Terraform, you can seamlessly set up OpenTofu in the Walrus system without any code changes.

Start by following the [Quick Start](https://seal-io.github.io/docs/quickstart) guide to deploy the Walrus Server and set up a container service in a Kubernetes cluster.

First, let's check the deployment log for the service.

![deployment-log](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a2wv317km09rozfhxk2b.png)

It's evident that the deployment was executed using Terraform.

![deployment-details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7ipwur7l37i722cfqhcv.png)

Now, let's switch to OpenTofu by following these steps:

1. Click on `System Settings` in the left navigation menu.
2. Click on the `Deployment Management` tab.
3. Press the edit button next to `Basic Settings`.
4. Change the `Deployer Image` to `sealio/opentofu-deployer:v1.6.0-beta5-1`.
5. Click the Save button.


![basic-settings](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/q7ayce4p1tbg4tm1l4qh.png)

That's it! Walrus will now use OpenTofu as the deployment engine. Let's create another service by following these steps:

1. Click on `Application Management` in the left navigation menu.
2. Enter the `dev` environment detail page by clicking on it.
3. Press the `New` button and select `Service`.
4. Enter the name `myapp-tofu`.
5. Choose the `containerservice` template.
6. Fill in `nginx` in the `Image` field.
7. Click Save and Deploy.



After the deployment finishes, let's take a look at the deployment log again.


![opentofu-deployment](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iv7igrzkdam3bjrelrmh.png)

This instance showcases OpenTofu's presence in the log. Walrus executed the deployment using OpenTofu. However, in the CLI arguments, as depicted in the image, terraform is aliased to tofu.

## What's Next?
At the time of writing this article, OpenTofu is gearing up for [its first stable release](https://opentofu.org/blog/opentofu-release-candidate-is-out) set for the upcoming month. The switch from Terraform to OpenTofu for end-users is not about adopting a new name that sounds more fragile  :-). Rather, we're poised to witness innovative solutions from OpenTofu addressing tangible challenges in our landscape.

### Welcome to Seal community!

- Discord: https://discord.gg/fXZUKK2baF
- Twitter: https://twitter.com/Seal_io
- LinkedIn: https://www.linkedin.com/company/seal-io