Master da Web
Infrastructure as code

Terraform provider for Master da Web

Declare servers, firewalls, VPCs, DNS, serverless apps, databases and buckets in HCL. Review the plan, apply it and version your infrastructure alongside your code.

  • Official provider on the Terraform Registry
  • Imports what already exists in your account
  • Signed releases
  • Token from the MW_TOKEN variable

main.tf

terraform {  required_providers {    masterdaweb = {      source = "masterdaweb/masterdaweb"    }  }} # The token comes from MW_TOKEN when it is left out.provider "masterdaweb" {} resource "masterdaweb_ssh_key" "laptop" {  name       = "laptop"  public_key = file("~/.ssh/id_ed25519.pub")} resource "masterdaweb_instance" "web" {  name        = "web-1"  region_id   = 1  plan        = "c2m4"  image       = "ubuntu-24-04"  ssh_key_ids = [masterdaweb_ssh_key.laptop.id]}
Features

Infrastructure as code: reviewable, repeatable and versioned

The same terraform plan and apply workflow you already use on other clouds.

Official Registry

Declare source = "masterdaweb/masterdaweb" and terraform init downloads and verifies the provider.

Import what exists

Servers, databases and records created in the console join your state with terraform import.

VPS and serverless together

One codebase describes the server, the firewall, DNS, the app, the database and the bindings between them.

Deletion protection

Protected databases, projects and services are only destroyed after you turn protection off.

Signed releases

Every release is published with a signature that Terraform verifies on install.

Same token as the API

The provider uses public API v1 with a narrowly scoped token, read from MW_TOKEN.

Provider resources

What the provider manages

Resources and data sources for every part of the platform.

Servers

  • masterdaweb_instance
  • masterdaweb_ssh_key
  • masterdaweb_snapshot
  • masterdaweb_backup_schedule

Networking and DNS

  • masterdaweb_firewall
  • masterdaweb_vpc
  • masterdaweb_vpc_attachment
  • masterdaweb_dns_zone
  • masterdaweb_dns_record
  • masterdaweb_reverse_dns

Serverless

  • masterdaweb_project
  • masterdaweb_project_resource
  • masterdaweb_serverless_service
  • masterdaweb_serverless_variable
  • masterdaweb_serverless_domain
  • masterdaweb_serverless_binding
  • masterdaweb_serverless_log_drain

Data

  • masterdaweb_database
  • masterdaweb_object_storage_bucket
  • masterdaweb_object_storage_key

Security and account

  • masterdaweb_security_settings
  • masterdaweb_security_exception
  • masterdaweb_vpn_gateway_settings
  • masterdaweb_vpn_user
  • masterdaweb_webhook
Example

An app with a database, in a few lines

A project, a web service built from Git, PostgreSQL and the binding that delivers DATABASE_URL.

app.tf

Every apply that changes the service starts a deployment; the gradual rollout protects the new version.

app.tf

resource "masterdaweb_project" "loja" {  name = "loja"} resource "masterdaweb_serverless_service" "web" {  project_id = masterdaweb_project.loja.id  name       = "web"  kind       = "WEB"   git = {    repo_url = "https://github.com/ana/loja"    branch   = "main"  }   size            = "small"  min_instances   = 0  max_instances   = 5  rollout_percent = 10  rollout_minutes = 15} resource "masterdaweb_database" "db" {  name   = "loja-prod"  engine = "postgres"  size   = "pg-1-1"} # DATABASE_URL in the service, with a login of its ownresource "masterdaweb_serverless_binding" "db" {  service_id    = masterdaweb_serverless_service.web.id  resource_kind = "POSTGRES"  resource_name = masterdaweb_database.db.name}
Developers

Other tools

REST

Public API v1

The foundation of it all: every console resource has an endpoint, with JSON responses and errors that tell you what to do.

  • An OpenAPI spec to generate clients in any language
  • Scoped tokens, such as vm:read or dns:write
  • Long-running actions return an operation you can track
Explore the API
Terminal

mw CLI

Everything the console does, in your terminal or pipeline: tables to read and JSON for scripts.

  • Installs with curl, Homebrew, npm, PowerShell or Docker
  • Browser sign-in, no token to copy
  • Asks for confirmation before anything irreversible
Explore the CLI
AI

MCP server

Connect Claude, Cursor or another MCP client and manage your account by chatting.

  • OAuth sign-in with the permissions you choose
  • Destructive or billable actions wait for your confirmation
  • Everything goes into the activity log
Explore the MCP server
FAQ

Frequently asked questions about Terraform

Automate your infrastructure today

Create your account, generate a token and make your first call in minutes.