You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: released/import/README.md
+9-2Lines changed: 9 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,10 @@ In a nutshell we will:
12
12
13
13
We will now walk through this process in detail in the following sections.
14
14
15
+
> [!NOTE]
16
+
> The following description covers the *manual* process of an import using [import blocks](https://developer.hashicorp.com/terraform/language/import). Terraform as well as OpenTofu offer an [experimental feature](https://developer.hashicorp.com/terraform/language/import/generating-configuration) to generate the resource configuration. While this removes the burden of manually crafting the configuration code, manual rework is required to introduce dependencies between resources as well as making the code more reusable via variables or local values.
17
+
18
+
15
19
## Prerequisites
16
20
17
21
To have resources that need to be imported we first need to create a subaccount and a service entitlement on SAP BTP using the SAP BTP Cockpit.
@@ -203,7 +207,7 @@ terraform plan
203
207
204
208
The result should display that two resources get imported. No additions, changes or deletions should be planned. The output should look like this:
@@ -256,7 +260,7 @@ To execute the import, we run:
256
260
terraform apply
257
261
```
258
262
259
-
As a result we see a `terraform.tfstate` file in our filesystem.
263
+
As a result we see a `terraform.tfstate` file in our filesystem.
260
264
261
265
To validate that we have brought the manually created resources under the control of Terraform we execute a `terraform plan` which should state that:
262
266
@@ -271,3 +275,6 @@ The import was successful, and you can manage the imported resources via Terrafo
271
275
## Additional Information
272
276
273
277
You find more information about the Teraform import functionality in the [Terraform documentation](https://www.terraform.io/docs/cli/import/index.html).
278
+
279
+
> [!TIP]
280
+
> To simplify the state import, we offer a SAP BTP specific CLI called [Terraform Exporter for SAP BTP](https://sap.github.io/terraform-exporter-btp/). This CLI streamlines the process of the import so that you can e.g., import one subaccount via one single command. For details please check the [documentation](https://sap.github.io/terraform-exporter-btp/).
0 commit comments