Terraform patterns for Boundary
Use the official Boundary Terraform provider to deploy and manage Boundary resources: scopes, users, groups, hosts, credentials, session recording, and targets. This page shows how to configure the provider, each linked pattern page covers one resource type.
This page covers provider setup only. For resource-specific patterns, refer to the linked pages below.
Requirements
This document assumes the reader has:
- An understanding of Terraform fundamentals.
- An existing Boundary installation. Refer to Deploy Boundary in a self-managed environment to learn about deploying Boundary.
Terraform provider configuration
To use Terraform to manage your Boundary environment, you must first configure the Terraform Boundary provider.
The following code block provides an example of provider configuration using the userpass authentication method.
You can use any of the available Boundary authentication methods by specifying the appropriate auth_method_id.
terraform {
required_providers {
# Declare the provider
boundary = {
source = "hashicorp/boundary"
}
}
}
# Configure the provider
# This example assumes that you have stored your Boundary cluster address and credentials in Terraform variables
provider "boundary" {
addr = var.boundary_addr
auth_method_login_name = var.boundary_login_name
auth_method_password = var.boundary_password
}
Related Boundary provider documentation
Refer to the Boundary provider documentation for more information on the available authentication methods.
Next steps
The following pages provide examples and patterns for configuring Boundary resources with Terraform.
If you are configuring Boundary resources for the first time, you may want to start by creating a scope. You create scopes to partition resources and then assign ownership of those resources to users and groups.