Terraform
You can use our Terraform or OpenTofu provider to automate the configuration of your application on Nexaa.
Both Terraform an OpenTofu have all features we provide on our platform. We made the source code of the provider open source for maximum transparenty. But also to allow you to help us improve the provider. If you found a bug simply report it in our github repo.
Getting started
To start using Terraform/OpenTofu you need to install their binaries on your deployment system. You can consult their docs to read how to do this for your system.
Note
You can select one of the tools, depending on your needs. Terraform is a commercial product provided by Hashicorp. OpenTofu is an opensource alternative compatible with Terraform. The right tool matches with your experience and license needs.
Once you have your tool installed you can start to create your first resources.
Create a file named main.tf in your project directory with the following content.
In this example we use variables to make sure we never commit our secrets, so we need to create a variables.tf file as well.
Once this is done you can initialize the project and create your first resource. Initializing will download the nexaa provider to your system.
Store state
Terraform and OpenTofu use a state file to keep track of the resources it manages. By default, this file is stored locally, but for production use we recommend using a remote backend to store the state file. This allows you to share the state file between team members and also provides better security for your state file.
In Nexaa you can use the s3Proxy to store your state in a bucket. You can use the curl command below to create a container with the s3Proxy image. Or use the portal to create a container.
In your main.tf file you can then add the following backend configuration to use the s3Proxy as a remote backend for your state file.
Now the setup is ready to use. The state file will be stored in the object-storage container.