Home SAP BTP SAP BTP Terraform Provider 1.0.0 : An Ultimate Guide

SAP BTP Terraform Provider 1.0.0 : An Ultimate Guide


Are you tired of manually managing your SAP BTP infrastructure, sacrificing precious time and risking human error? The recently released SAP BTP Terraform Provider 1.0.0 can be your savior! This powerful tool unlocks effortless automation, freeing you to focus on strategic tasks and accelerating your innovations to market. Dive into this blog to discover how this game-changer can simplify your SAP BTP deployments and streamline your entire infrastructure and application management process.


SAP Business Technology Platform (SAP BTP) is a cloud-based platform-as-a-service (PaaS) offering from SAP that empowers you to build and extend business applications. Managing SAP BTP involves tasks like overseeing directories, global accounts, subaccounts, and services. These activities can be performed through the SAP BTP cockpit, the BTP Command Line Interface (BTP CLI), or APIs. While the BTP cockpit allows navigation across various sections, the BTP CLI often necessitates utilizing multiple commands. This workload can become particularly cumbersome when managing numerous subaccounts, directories, and applications.

To effectively manage infrastructure on SAP BTP, Terraform has emerged as a leading infrastructure as code (IaC) solution that allows administrators to automate the provisioning and management of resources. Terraform enables consistent, predictable infrastructure deployments using code instead of manual processes.

What is Terraform?

Terraform is this amazing tool that’s open for everyone to use, created by the folks over at HashiCorp. It’s all about making life easier when you’re working with cloud infrastructure. Think of it as a magic wand that helps you set up and manage everything you need in the cloud, without all the hassle. It’s built to work with pretty much any cloud service out there – whether you’re team AWS, all about Azure, or a Google Cloud fan, Terraform has got your back.

The cool part? You don’t need to be a tech wizard to use it. Terraform lets you describe what you need in a way that’s easy to understand, almost like writing a to-do list. This is great because it means everyone on the team, from developers to operations folks, can figure out what’s happening and work together more smoothly. It’s all about ditching those old-school, manual setups that can turn into a real headache and moving to something a lot more streamlined.

But here’s where it gets really interesting – Terraform is designed to grow with you. It can handle everything from a small project to the kind of complex setups big organizations need. It’s like the Swiss Army knife of cloud computing, empowering companies to be more agile and embrace the best practices of using infrastructure as code. Basically, if you’re looking to manage your cloud resources efficiently and make your life a whole lot easier, Terraform is the way to go.

What is SAP BTP Terraform Provider?

SAP BTP Terraform Provider allows Terraform to interact with the SAP BTP to provision and manage resources. Rather than needing manual processes, users can define SAP BTP infrastructure in Terraform configuration files that can be shared and version controlled. The provider is essential for any development team wanting to apply infrastructure as code best practices to SAP BTP. For example:

# Create a parent directory without features enabled
resource "btp_directory" "parent" {
  name        = "my-parent-directory"
  description = "This is a parent directory."

# Create a child directory underneath a parent directory without features enabled
resource "btp_directory" "child" {
  parent_id   = btp_directory.parent.id
  name        = "my-child-directory"
  description = "This is a child directory."

# Create a directory with ENTITLEMENT and AUTHORIZATIONS features enabled
resource "btp_directory" "dir_with_features" {
  name        = "my-feat-directory"
  description = "This is a directory with features."

The recent release of the SAP BTP Terraform Provider 1.0.0 marks an important milestone that brings enterprise-grade stability and support to managing SAP BTP environments with Terraform. This opens the door to increased efficiency, scalability, and collaboration for teams leveraging SAP BTP. In this post, we’ll take a closer look at exploiting the power of Terraform and the SAP BTP provider release to optimize SAP BTP infrastructure operations.

Install SAP BTP Terraform Provider

Buckle up, installing SAP BTP Terraform Provider is just the beginning. It’s an invitation to a world of streamlined operations, efficient deployments, and empowered teams. So, are you ready to experience the magic for yourself? Let’s get started!


  • Download terraform from the Terraform website.
  • Roles are assigned to your user in SAP BTP.

Step-by-Step Process

To work with Terraform configuration files, we would need a IDE. Open any IDE of your choice, here I am using VS Code.

1. Create a directory sapbtp-terraform on your machine and launch VS code pointing this directory.

SAP BTP Terraform Installation Step 1

2. Create a new .tf file of your choice and copy below code. For example setup-provider.tf

terraform {
  required_providers {
    btp = {
      source  = "SAP/btp"
      version = "~>1.0.0"

provider "btp" {
  globalaccount = "4a59ddebctrial-ga" //replace with your Global Account Subdomain

3. Open the terminal with in the folder and run following command to install necessary dependencies.

terraform init

4. After successful installation, you will see following output in the terminal.

SAP BTP Terraform Installation Step 3

5. Congrats! you have successfully installed the terraform provider for SAP BTP. Last but not least, you need to pass credentials to the provider to authenticate and interact with your BTP environments. There two different options to pass the credentials:

Option 1: Set the environment variables BTP_USERNAME and BTP_PASSWORD by running following commands in the terminal.

export BTP_USERNAME=<your_username>
export BTP_PASSWORD=<your_password>

Option 2: Add username & password in the terraform configuration file (setup-provider.tf) like below.

SAP BTP Terraform Installation Step 4

Note: Username and password should not be SAP Universal ID credentials. Use your S-User ID or its associated email address as username and password for the same.


Gone are the days of manually configuring and managing your SAP Business Technology Platform (BTP) infrastructure. Embrace the future with the SAP BTP Terraform Provider, a game-changer that simplifies and streamlines BTP deployments and application maintenance. This powerful tool transforms your infrastructure management from a tedious chore into an efficient, automated process.

Ready to transform your BTP experience? Embrace the power of Terraform and unlock the full potential of your SAP Business Technology Platform. Start automating your infrastructure today and see the difference for yourself!