Managing backups as code — Using Veeam with HashiCorp Terraform

As more organizations adopt a multi-platform, service-driven approach to running workloads and storing data, tools that provide centralized management capabilities become a crucial asset in reducing operational complexity and enforcing security policy. Foremost in this category are tools that manage infrastructure as code (IaC for short). As the name implies, IaC tools use text files to define how resources and applications should be configured. Managing infrastructure as code allows developers and administrators to use a common control pane for resources throughout their lifecycle and makes it easier to conduct reviews, perform audits and detect drift since the configurations are represented in text and can be stored in versioned code repositories.

Data protection is no exception to this. Every resource that contains application and configuration data needs to be backed up in accordance with security and governance policies, as well as recovery point and time objectives. As the responsibility for infrastructure ownership shifts left, data protection strategies and solutions must follow suit. If you manage your IaC, why shouldn’t you manage your backups as code?

 

Welcome HashiCorp, Veeam Alliance Partner

Veeam has a broad array of alliance partners to give our products deep integrations with industry-leading platforms and a growing number of services, including Microsoft 365 and Salesforce. Among our partners is now HashiCorp, the company behind tools such as Vault, Consul and Terraform. This new partnership opens the door for many use cases requested by customers to automate their backup solution and manage their backups as code.

Use cases and examples

A common task in large enterprises and service providers is bringing new sites online. Some requirements may vary by site. Core services and platforms — including backup — are typically well-defined and already proven, making them ideal candidates for automation. Deploying Veeam with Terraform is a great way to begin managing your backups as code right from the start.

One example of deploying Veeam with Terraform is available on GitHub from Veeam’s very own Michael Cade, senior technologist in Product Strategy. The objective for the VeeamLAB project was to create a reproducible Veeam lab environment using Terraform. However, the use cases for these templates have broader potential, including deploying Veeam into a new site. 

There is also an example project for deploying Veeam Backup for AWS with Terraform in VeeamHub, Veeam’s curated collection of projects on GitHub. VeeamHub has lots of resources for many use cases, including Terraform, so check it out.

A key benefit of this approach is consistency. No matter how many sites are deployed, if the Veeam configuration in each site is controlled from one template, you can count on your backups to work exactly as intended in your specifications. Furthermore, if changes are made to one location that you want to replicate to all locations, IaC tools like Terraform allow you to apply those changes to every site without human intervention. This provides substantial time savings on top of the consistency and reliability provided by managing your backups as code.

Once you have your server and repositories online, the next step is to start protecting your workloads. Many organizations want to ensure all systems are protected from the moment they are provisioned — you never want to need a backup and not have one.

Many Veeam products, including Veeam Backup & Replication, offer powerful REST APIs that allow you to incorporate Veeam into established API-driven toolchains. Using a REST API provider in Terraform, you can leverage Veeam’s APIs to integrate backup tasks into your provisioning and deployment workflows.

Managing your backups as code this way makes data protection an automatic feature from the moment the resource goes live. Combined with the monitoring and reporting capabilities in Veeam ONE, backup reviews and audits become much simpler throughout the lifecycle of your resources.

Next steps

Managing your backups as code is a powerful way to control not only your backup solution’s physical infrastructure, but also the data protection functions it performs. The examples shared above are applicable to common scenarios, but this is only a small sample and does not cover every use case. 

So, where do you begin this journey of managing backups as code?

You may have noticed that the projects referenced above are hosted on GitHub. That means you don’t have to start from scratch! Download these repos and edit them to your liking, always adhering to the license for the project. If you fix issues or add features, submit a pull request to share your improvements with the community.

Last, but not least, visit the Veeam Community Resource Hub. This is an official, dedicated site where the global community of Veeam practitioners and Veeam employees share an immense amount of knowledge and experience, including projects like those highlighted in this article.

Hint: there’s a user group there called the Automation Desk dedicated to automating Veeam solutions. Set up a free account today and join the vibrant Veeam community.

Get weekly blog updates
By subscribing, you are agreeing to have your personal information managed in accordance with the terms of Veeam’s Privacy Policy
Cheers for trusting us with the spot in your mailbox!
Now you’re less likely to miss what’s been brewing in our blog with this weekly digest.
OK
NEW
V11A

Eliminate Data Loss
Eliminate Ransomware

#1 Backup and Recovery