OpenTofu
Overview
OpenTofu is the open source, community-driven fork of Terraform for infrastructure as code, governed by the Linux Foundation. You declare your infrastructure in HCL, and OpenTofu plans and applies the changes across hundreds of providers, including Azure, AWS and Kubernetes. It brings state management, modules and a full plan/apply workflow.
The SecureAnyCloud image installs OpenTofu 1.12.3 system-wide as a ready-to-use command-line workstation and CI runner. A pre-initialised worked example lets you run a plan within seconds of logging in. This is a command-line product with no web UI.
What you get:
- OpenTofu 1.12.3 installed at
/usr/local/bin/tofu - A pre-initialised worked example at
/opt/opentofu/example, using the random and local providers, with the providers cached - A per-user writable copy at
~/opentofu-examplefor every login user unzipandgitfor archives and module sources- A login banner that points to the example and the user guide
- Ubuntu 24.04 LTS with the latest security patches applied at build time
- 24/7 SecureAnyCloud support
Prerequisites
You need an active Azure subscription, an SSH key pair, and a VNet with a subnet in the target region.
Standard_B2s (2 vCPU / 4 GiB RAM) is plenty for a CLI workstation.
Configure the NSG to allow inbound 22/tcp from your management network. OpenTofu reaches the OpenTofu provider registry over HTTPS to fetch any providers that are not already cached.
Step 1 - Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for OpenTofu by SecureAnyCloud, and select Create.
On the Basics tab, pick your subscription, resource group, region and size. Under Administrator account, choose SSH public key and paste your key. Under Inbound port rules, allow SSH (22).
Then select Review + create and Create.
Step 2 - Deploy from the Azure CLI
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn sac1647283583153:opentofu-ubuntu-24-04:default:latest
az vm create \
--resource-group <your-rg> \
--name opentofu \
--image sac1647283583153:opentofu-ubuntu-24-04:default:latest \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--vnet-name <your-vnet> --subnet <your-subnet> \
--public-ip-sku StandardStep 3 - Connect to your VM
Connect as azureuser, using the public IP address of your VM:
ssh azureuser@<vm-public-ip>Step 4 - Confirm OpenTofu is installed
Print the installed version:
tofu versionThe output shows OpenTofu v1.12.3 and the provider platform.
Step 5 - Initialise the worked example
Every login user gets a writable copy of the example at ~/opentofu-example. Initialise it. The providers are pre-cached, so this is instant and works offline:
[ -d ~/opentofu-example ] || cp -r /opt/opentofu/example ~/opentofu-example cd ~/opentofu-example && tofu initOpenTofu reports OpenTofu has been successfully initialized!.
Step 6 - Plan
Preview what OpenTofu would create:
cd ~/opentofu-example && tofu planThe plan shows two resources to add, a random_pet name and a local_file. It ends with Plan: 2 to add, 0 to change, 0 to destroy.
Step 7 - Apply
Create the resources:
cd ~/opentofu-example && tofu apply -auto-approve && cat hello.txtOpenTofu reports Apply complete! Resources: 2 added and prints the pet_name output. The file hello.txt contains a greeting with the random resource name.
Step 8 - Tear the example down
Destroy the example resources:
cd ~/opentofu-example && tofu destroy -auto-approveOpenTofu reports Destroy complete! Resources: 2 destroyed.
Step 9 - Manage real infrastructure
Replace main.tf with your own configuration and add a provider. For Azure, add the azurerm provider and authenticate the VM with a managed identity or az login. Then run tofu init to download the provider:
terraform { required_providers { azurerm = { source = "registry.opentofu.org/hashicorp/azurerm" version = "~> 4.0" } } } provider "azurerm" { features {} } resource "azurerm_resource_group" "example" { name = "rg-opentofu-demo" location = "eastus" }For team use, store state remotely, for example in an Azure Storage backend. To drive OpenTofu from CI, run tofu init, tofu plan and tofu apply non-interactively.
Maintenance
- Reference template: the read-only example lives at
/opt/opentofu/example. Your writable copy is~/opentofu-example. - Upgrades: download a newer OpenTofu release and replace
/usr/local/bin/tofu. - Providers:
tofu initfetches and caches providers for each project. Pin versions inrequired_providers. - Security patches: unattended-upgrades remains enabled, so the OS continues to receive security updates automatically.
Support
SecureAnyCloud provides 24/7 expert support for this image. Contact sales@secureanycloud.com.
Deploy on Azure
Launch OpenTofu on Ubuntu 24.04 LTS on Azure with 24/7 support from SecureAnyCloud.
View this image
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com
Overview
OpenTofu is the open source Infrastructure-as-Code engine: a community-driven, MPL-2.0 licensed fork of Terraform. You declare your cloud and on-premises infrastructure in HCL configuration files and apply it predictably with a plan-and-apply workflow.
This image is a ready-to-use Infrastructure-as-Code workstation. Connect over SSH and start managing infrastructure with the tofu command line immediately, with no setup.
What you get:
- A headless command-line image with no web interface, no service to log into and no credentials. You run the
tofuCLI against your own infrastructure-as-code configurations. - The
tofubinary on the system path at/usr/local/bin/tofu, verified against the official OpenTofu release checksum at build time. - A provider plugin cache on a dedicated, independently resizable EBS data volume mounted at
/var/lib/tofu. The login profile exportsTF_PLUGIN_CACHE_DIR=/var/lib/tofu/plugin-cachefor every login shell, so provider plugins download once and are shared across all your workspaces. They persist on durable storage rather than on the operating system disk. - A self-contained offline demo configuration, read-only at
/opt/opentofu/demo, so you can exercise the toolchain end to end with no cloud credentials the moment you log in.
Prerequisites
Before you deploy this image, make sure you have:
- An Amazon Web Services account where you can launch EC2 instances
- IAM permissions to launch instances, create security groups, and subscribe to AWS Marketplace products
- An EC2 key pair in the target Region for SSH access to the instance
- A VPC and subnet in the target Region, with a security group that allows inbound port 22 from your management network
- The AWS CLI (version 2) installed locally, if you plan to deploy from the command line
Launch the instance from the AWS Marketplace
Sign in to the AWS Management Console, open the EC2 service, and select Launch instance. Under Application and OS Images, choose AWS Marketplace AMIs and search for OpenTofu. Select the SecureAnyCloud listing and choose Select, then choose Continue on the subscription summary.
Pick an instance type of t3.small or larger. Choose your EC2 key pair under Key pair (login). Under Network settings, select your VPC and subnet, and create or select a security group that opens port 22 from your management network. Leave the root volume at the default size or larger.
Select Launch instance. First-boot initialisation takes a few seconds after the instance state becomes Running and the status checks pass.
Launch the instance from the AWS CLI
The command below launches an instance from the SecureAnyCloud OpenTofu Marketplace AMI into an existing subnet and security group. Replace the values in angle brackets:
- <ami-id>: the AMI ID shown on the Marketplace listing
- <key-name>: your EC2 key pair name
- <subnet-id>: your subnet ID
- <security-group-id>: a security group that opens port 22 from your management network
aws ec2 run-instances \
--image-id <ami-id> \
--instance-type t3.small \
--key-name <key-name> \
--subnet-id <subnet-id> \
--security-group-ids <security-group-id> \
--tag-specifications 'ResourceType=instance,Tags=[{Key=Name,Value=opentofu}]'When the instance reaches the Running state and its status checks pass, note its public IP address or DNS name. You can find it in the EC2 console or with aws ec2 describe-instances.
Connect to your instance
Connect over SSH using your key pair. The login user for Ubuntu 24.04 is ubuntu.
ssh -i <key-name>.pem ubuntu@<public-ip>Verify the install
Confirm that the toolchain is installed and on the system path by printing the OpenTofu version:
tofu versionThe output shows OpenTofu v1.12.2, running on linux_amd64.
The same tofu command exposes the full Infrastructure-as-Code workflow. Run tofu -help to list the subcommands. The most important are init, validate, plan and apply.
Run the demo configuration
A self-contained offline demo configuration ships read-only at /opt/opentofu/demo. It uses only the null and local providers, so tofu init, tofu validate, tofu plan and tofu apply all work offline with no cloud credentials.
The demo writes a hello file with a local_file resource and runs a trivial null_resource. You can use it to confirm that the toolchain works end to end before you point it at your own providers.
Copy the demo somewhere writable and initialise it. The first tofu init downloads the null and local providers into the shared plugin cache on the data disk:
cp -r /opt/opentofu/demo /tmp/opentofu-demo cd /tmp/opentofu-demo tofu initOpenTofu reports the providers it installed and finishes with OpenTofu has been successfully initialized!.
Now preview the changes the configuration would make. tofu plan describes the local_file and null_resource it will create, without making any change:
cd /tmp/opentofu-demo tofu planThe plan ends with Plan: 2 to add, 0 to change, 0 to destroy. This confirms that the toolchain reads the configuration, talks to the providers and computes a change set correctly.
To converge the configuration, apply it. This writes the demo hello.txt and runs the null_resource, with no cloud credentials needed:
cd /tmp/opentofu-demo tofu apply -auto-approve cat hello.txt tofu state listtofu apply ends with Apply complete! Resources: 2 added, 0 changed, 0 destroyed. The cat command prints the greeting that the demo wrote, and tofu state list shows the two resources now tracked in state.
Use your own configuration
To manage your own infrastructure, create a working directory and write your HCL configuration there. Then run the same tofu init, tofu plan and tofu apply workflow against your real providers, for example the aws provider.
Configure provider credentials the way you would anywhere else: attach an IAM instance role to this EC2 instance, set the standard AWS_* environment variables, or use a shared credentials file.
OpenTofu uses the same provider and module ecosystem that engineers already know. It supports remote state backends, including the native S3 backend with state locking, so you can wire this workstation into CI and pull-request automation.
The provider plugin cache lives on the dedicated data volume at /var/lib/tofu/plugin-cache and is exported as TF_PLUGIN_CACHE_DIR for every login shell. The first tofu init in any workspace downloads each provider once, and every later workspace reuses the cached copy. Repeated initialisation is fast, and the providers stay on durable, resizable storage rather than the operating system disk.
The data volume
The provider plugin cache and your workspace scratch space live on a dedicated EBS volume mounted at /var/lib/tofu. This keeps the cache and state off the operating system disk and lets you resize or snapshot the volume independently. Confirm the mount:
df -h /var/lib/tofuTo grow the volume, expand the EBS volume in the AWS console. Then grow the filesystem on the instance by running sudo resize2fs on the underlying device.
The plugin cache directory is group-writable by the ubuntu login user, so providers downloaded by any workspace are shared across the whole instance.
Support
This image is published and supported by SecureAnyCloud. Support covers deployment, provider and backend configuration, remote state and native S3 state locking, module structure, migrating from Terraform to OpenTofu, CI integration and upgrade planning.
Contact SecureAnyCloud through the support channel listed on the AWS Marketplace listing.
All product and company names are trademarks or registered trademarks of their respective holders. Use of them does not imply any affiliation with or endorsement by them.
Deploy on AWS
Launch OpenTofu on AWS with 24/7 support from SecureAnyCloud.
View on Marketplace
Need Help?
Our support team is available 24/7.
sales@secureanycloud.com