Announcing Bitbucket Cloud Integration for Terraform Enterprise

Announcing Bitbucket Cloud Integration for Terraform Enterprise

Apr 19 2017 Mary Cutrali

HashiCorp Terraform enables users to define infrastructure as code to safely and predictably codify, plan, and provision any infrastructure. Terraform can provision public cloud resources, private cloud resources, as well as service provider resources like DNS and monitoring to provide a consistent workflow for provisioning.

HashiCorp Terraform Enterprise provides integration with version control systems (VCS) to facilitate collaboration on infrastructure as code. Terraform Enterprise users have been doing version-controlled infrastructure with GitHub and Terraform Enterprise. We are excited to announce the addition of Atlassian Bitbucket Cloud as a VCS integration with Terraform Enterprise. This post will discuss getting started with Terraform Enterprise and the first steps to setting up Bitbucket Cloud for your environment.

Getting Started with Terraform Enterprise

The Terraform CLI works great for individuals, hobby projects, and small teams, but like most CLI tools, it tends to not scale well without a centralized coordination system. The goal of Terraform Enterprise is to simplify using and coordinating Terraform in a team setting. The integration with Bitbucket is part of Terraform Enterprise. Visit the Terraform Enterprise site to get started.

Registering Bitbucket Cloud and Terraform Enterprise

The first part will be to register Terraform Enterprise as an OAuth Application within your Bitbucket Cloud account. Proceed to https://bitbucket.org/account/user/your-username/oauth-consumers/new.

BB GIF 1

You will be redirected to https://bitbucket.org/account/user/your-username/api. Scroll down to OAuth Consumers and click on the application you just created. Copy the Key and Secret. Leave this tab open in your browser as you will need to return to it in a moment.

BB GIF 2

The second part will be creating a Terraform Enterprise OAuth Client. This will be done from the Terraform Enterprise UI. You will need the Key and Secret copied from Bitbucket site to complete this process.

BB GIF 3

Once you have created your client, you will be redirected back to the configurations page for your chosen organization. On that page, find the “OAuth Clients” pane and copy the Callback URL for your Bitbucket Cloud OAuth Client. In the open Bitbucket tab, select the Terraform Enterprise OAuth Application and click edit. Enter the Callback URL you just copied in the field labeled Redirect URI. Save the application.

BB GIF 4

Your OAuth Client should now be enabled for your Organization to use within Terraform Enterprise.

Using Bitbucket Cloud with Terraform Enterprise

To use Terraform Enterprise with Bitbucket Cloud you will need to link to a Terraform Enterprise organization. This will be done from the Terraform Enterprise UI. During authorization, there will be a brief redirect to Bitbucket from the Terraform Enterprise UI in order to authenticate the client.

BB GIF 5

The emphasis of HashiCorp Terraform to codifying infrastructure provides a consistent approach to provision any infrastructure. This is particularly important for organizations adopting cloud or transitioning to a DevOps model for application delivery. Consider a resource group on AWS compared to a set of Virtual Machines on Azure. Or a pool of servers on GCP compared to Virtual Machines on vSphere. Conceptually they are all the same and provide infrastructure. The work required to provision and manage them is actually a bit different. Terraform allows infrastructure to be described using a common template in a high-level configuration syntax. The configuration file is then versioned and treated as you would any other code using a version control system. To learn more about our Terraform Enterprise and request a free trial visit www.hashicorp.com/terraform.html.

Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×