hamburger icon close icon

Intro to Infrastructure Automation With Terraform and Cloud Volumes Service for Google Cloud

In today’s world, rapidly bringing business solutions to market within the cloud-connected world requires that application owners and cloud teams use as much automation as possible to quickly develop, iterate, and deliver those solutions. Hashicorp’s Terraform provider repository provides a consistent centralized configuration management tool that allows large-scale infrastructure to be deployed, versioned, and managed in a reliable and repeatable manner. In this blog, we’ll take a closer look at the new Terraform provider support available for NetApp Cloud Volumes Service for Google Cloud, and how it can help you deploy enterprise grade storage within your cloud infrastructure to develop faster business solutions at lower costs. Since this blog will dive into details, you’ll want to

  • Have at least a working knowledge of Terraform, the different provisioners and providers that come out-of-the-box, its configuration files, among other attributes.
  • Be comfortable with the Go language and its code organization.

Introduction to Cloud Volumes Service for Google Cloud

Cloud Volumes Service for Google Cloud is a fully managed file storage service that lets you run enterprise apps in the cloud without compromising performance or flexibility. Leveraging over 25 years of data management expertise, NetApp® Cloud Volumes Service enables businesses to migrate high-performance file workloads to cloud without refactoring applications. By unlocking the power of your data with tightly integrated data solutions that are optimized and validated for Google Cloud, NetApp Cloud Volume Service for Google Cloud empowers you to deliver projects more rapidly. Cloud Volumes Service offers NFS and SMB protocol support and allows you to match the storage and throughput against your workload dynamically, offering performance that scales with your needs and with your data over its lifetime. In addition, Cloud Volumes Service offers advanced data management in the form of snapshots, providing application users with a convenient and easy way to clone and test their workloads, recover files in the event of accidents, and restore volumes in the event of a disaster or outage.

Getting Started

Terraform is provided in uncompiled form through the NetApp repository, with instructions provided on how to clone and build (compile) the provider available in this readme file.

Once you’ve cloned the repository from Github to your environment, the Go build command for the Terraform provider will look like this:


Once compiled, the terraform-provider-netapp-gcp binary needs to be placed in your binary directory (for example, /usr/local/bin):


Next, you need to configure environment variables that will allow Terraform to access the CVS deployment in your project. For this, you’ll need your Google Cloud project number and the service account. Enter these details into the terraform.tfvars file within Go. We provide an example terraform.tfvars.example file with the fields you need to provide. Simply fill and copy this file to terraform.tfvars.

Terrraform 4




Using the Cloud Volumes Service Terraform Provider to Provision Storage

With the configuration complete, you can now configure the file to execute the various modules of the Cloud Volumes Service and create, review, update, and destroy:

  • Volumes (using the netapp-gcp_volume module)
  • Snapshots (using the netapp-gcp_snapshot module)
  • Active Directory connections (using the netapp-gcp_active_directory module)


Example scripts for each are provided within the NetApp repository on github.

resource “netapp-gcp_volume” “gcp-volume” {
  provider = netapp-gcp
  name = “myCVSvolume1”
  region = “us-west2”
  protocol_types = {“NFSv3”}
  network = “my-CVS-vpc”
  size = 2048
  service_level = “premium”
In the following video, you can see how to perform example actions with the Cloud Volumes Service Terraform provider. 


The NetApp repository on github for the Cloud Volume Service Terraform provider provides a wealth of details and examples. In addition, you can leverage the full API to understand what other potential options are available for use with the volumes, snapshots, and active directory modules. For questions on utilizing the Terraform provider, you can also communicate with the NetApp team at thePub using the #configurationmgmt channel.


The Cloud Volumes Service Terraform provider for Google Cloud unlocks powerful enterprise-level file storage features and capabilities for organizations leveraging infrastructure-as-a-service automation with Hashicorp Terraform. With Cloud Volumes Service, you can improve your solution development in use cases such as financial analytics, video rendering pipelines, geological analysis, among others. With NetApp and Google Cloud, you can deploy reliable dynamic enterprise grade solutions that offer the ease of use and consumption of the cloud with the performance, reliability, and security you expect from your data center solutions.

For more information and to try Cloud Volumes Service for Google Cloud, visit us at:



Product Manager, Cloud Volumes Service & Cloud Backup Service