A version of this post was originally published at davidstamen.com.
Pure Cloud Block Store is a purpose-built block storage system that currently sits in AWS and Azure. It provides many benefits and serves many use cases.
Previously deployments of Cloud Block Store were done through a CloudFormations template that allowed provisioning. Some organizations wanted better ways to streamline deployment, so we introduced the Terraform Provider for AWS. With the Terraform Provider, you can provision a Pure Cloud Block Store instance on AWS in about 14 minutes.
Let’s dive in and take a look at how to utilize the new TerraForm Provider.
Prerequisites for Terraform Provider on AWS
- Hashicorp Terraform: Used to automate the provisioning using a Terraform .TF file.
- Amazon Web Services Account: The infrastructure to run the EC2 virtual machines.
- AWS CLI: Used to create AWS credential file for authentication.
Authentication Setup for AWS
To set up the AWS credential file for the Pure Cloud Block Store Terraform Provider for AWS, open your operating system command-line interface and type the following command:
aws configure
Enter in your AWS Access Key, AWS Secret Access Key, and Default AWS region. Once entered it will be saved in ~/.aws/credential
Deployment Setup for AWS
Note: Download Cloud Block Store Deployment and Configuration Guide for AWS.
Before you can provision Pure Cloud Block Store on AWS, you need to configure a set of AWS prerequisites first by creating:
You’ll use these prerequisites in the Terraform deployment.
Setup: Pure Cloud Block Store Terraform Provider
Note: Access sample Terraform files.
The samples have been variablized for ease of deployment. You should only need to edit the terraform.tfvars
file with your parameters.
The documentation has an explanation for the cbs_array_aws resource parameters for a successful deployment.
Deployment: Pure Cloud Block Store Terraform Provider
Run Terraform initialize to set up provider
terraform init
Run Terraform Plan to validate Terraform module and files.
terraform plan
If successful, it’s now time to deploy!
terraform apply
Once the deployment is complete you can run terraform
show to see the output and identify the controller IP addresses.
Alternatively, you can log to AWS and look up your CloudFormation Stack for the deployment outputs.
Decommission: Cloud Block Store instances
Currently, destroying the Terraform resource will not deactivate the Pure Cloud Block Store instance. You’ll have to deactivate the instance manually once the resource has been destroyed. See the deployment guide for information on how to remove Pure Cloud Block Store instances.
For version 5.3.0.aws0, 5.3.0.aws1, and 5.3.0.aws2, Pure Cloud Block Store can only be removed (terminated) by Pure Support to ensure all the resources in the stack are cleanly removed. If you are on 5.3.3.aws0+ you can perform this without Pure Support involvement
Note: Documentation for Removing Cloud Block Store on AWS.
The Future of the Pure Terraform Provider
Are you using Cloud Block Store or looking to test it out? This Terraform Provider can easily streamline deployment and testing in your environments! Future posts will expand on use cases on how to use Pure Cloud Block Store with AWS, Azure, VMware Cloud on AWS, and who knows what else!
If you have any additional questions or comments, please share them below!