btp-terraform-mooc-terra1
The code samples for "Getting Started with Terraform on SAP BTP", an SAP learning course that builds up a TerraformTerraformAn infrastructure as code tool that defines cloud and on-premise resources in configuration files and creates or changes them through provider plugins. SAP publishes a plugin for BTP, so Terraform is the CLI a reader installs to run a BTP account's configuration. configuration lesson by lesson.
The repository is structured in line with the layout of the course and follows it unit by unit: a first basic Terraform configuration, applying it to SAP BTP and inspecting Terraform state, then variables, locals, multiple resources and a Cloud Foundry environment, and finally additional providers, handing over to a development team, extracting reusable logic into modules and iterating over lists. Each lesson's walkthrough of the code is in that lesson's own README, with the solution provided as part of the corresponding directory. It needs an SAP BTP trial account whose SAP Universal ID does not enforce two-factor authentication, which the Terraform Provider for SAP BTPTerraform Provider for SAP BTPThe plugin that lets a Terraform or OpenTofu configuration manage the resources of an SAP BTP global account, from directories and subaccounts to entitlements, role collections and subscriptions.sap official, btp does not support, and, depending on the setup chosen in unit 1, either DockerDockerA container engine that packages software with the tools it needs and runs it isolated from the host. Things here that ship as an image need it installed, so the reader installs the engine rather than each of the command line tools inside the container. Desktop with VS Code and the Dev Containers extension or a GitHubGitHubA hosted git service: repositories, pull requests with reviews, and branch rulesets that decide what may reach a branch. Things here that push objects out of an SAP system, or keep a review record outside it, call its API and open their pull requests on it. Codespace.
Facts
Where it sits
Who is behind it
In the atlas: maintains 222@SAP-samplesmaintainerChristian LechnerContributes to this
In the atlas: contributes to 12, wrote 2@lechnerc77Rui NogueiraContributes to this
In the atlas: contributes to 6@rui16102 contributors
What it declares
Every artifact
- Type
- Sample
- Origin
- By SAP
- Use as
- A reference
As a sample
- Form
- A tutorial's companion code
Connections
Setting up cloud accounts, entitlements and access from code
Terraform and OpenTofu provider for SAP BTP global accounts
A container engine that packages software with the tools it needs and runs it isolated from the host. Things here that ship as an image need it installed, so the reader installs the engine rather than each of the command line tools inside the container.
A hosted git service: repositories, pull requests with reviews, and branch rulesets that decide what may reach a branch. Things here that push objects out of an SAP system, or keep a review record outside it, call its API and open their pull requests on it.
Download
README
quoted from SAP-samples/btp-terraform-mooc-terra1 under Apache-2.0, readGetting Started with Terraform on SAP BTP
Description
This repository contains the code samples used throughout the course "Getting Started with Terraform on SAP BTP".
Prerequisites
There are some requirements you must fulfill before being able to start with the coding exercises using the Terraform provider for SAP BTP. The prerequisites are:
- You have an SAP BTP Trial Account. If you don't have one yet, you can get one here.
- Make sure that your SAP Universal ID is configured correctly. You can find the instructions in SAP Note 3085908.
- The Terraform provider does not support 2FA. Make sure that this option is not enforced for your account.
Depending on the setup described in unit 1 lesson 3 further prerequisites are required:
- If you intend to use the recommended 'dev container' tools option you must have Docker Desktop and Visual Studio Code including the Dev Containers extension installed on your machine.
- You want to use A GitHub Codespace you must have a GitHub user. If you don't have one, sign-up on GitHub.
Content Structure
The repository is structured in line with the layout of the course. The walkthrough of the code for every lesson is described in an extensive README.md. We also provide the solution for each lesson as part of the corresponding directory in this repository.
Unit 1 - Getting Started with Infrastructure as Code
Unit 2 - Setting Up a First Terraform Configuration
- Lesson 1 - Configuring the first basic Terraform setup
- Lesson 2 - Applying the Terraform setup to SAP BTP
- Lesson 3 - Inspecting the Terraform state
Unit 3 - Enhancing the Terraform Configuration
- Lesson 1 - Using Variables in a Terraform Configuration
- Lesson 2 - Using Locals in a Terraform Configuration
- Lesson 3 - Adding Multiple Resources to the Terraform Configuration
- Lesson 4 - Setting up a Cloud Foundry Environment via Terraform
Unit 4 - Applying Advanced Terraform Concepts
- Lesson 1 - Enhancing the Setup with Additional Providers
- Lesson 2 - Handing over to the development team
- Lesson 3 - Extracting Reuseable Logic into Modules
- Lesson 4 - Iterating over Lists in Terraform
Support, Feedback, Contributing
❓ - If you have a question you can ask it here in GitHub Discussions or in the SAP Community.
🐞 - If you find a bug, feel free to create a bug report.
Contributing
If you wish to contribute code, offer fixes or improvements, please send a pull request. Due to legal reasons, contributors will be asked to accept a DCO when they create the first pull request to this project. This happens in an automated fashion during the submission process. SAP uses the standard DCO text of the Linux Foundation.
License
Copyright (c) 2026 SAP SE or an SAP affiliate company. All rights reserved. This project is licensed under the Apache Software License, version 2.0 except as noted otherwise in the LICENSE file.
Details
Sources
Sources are graph entities: the same page may back several entries, and an unreachable source flags every row that rests on it.
Compatibility and provenance
Contributors
History in the atlas
- First seen.
For your agent
- Ref
artifact:sap-samples-btp-terraform-mooc-terra1- JSON
- /artifacts/sap-samples-btp-terraform-mooc-terra1.json
- MCP
- Connecting an agent