-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[POC] BTP Terraform Exporter #740
Comments
Thanks for the feature request. We evaluate it and update the issue accordingly. Community NoteVoting for Prioritization
Volunteering to Work on This Issue
|
Hi @CHERIANS, For a while now since i started using/looking at terrafom for BTP, I have been looking for ways to import already created resources into the terraform memory similar to what terraformer does(with GCP) instead of having to import each resource individually, as tis would be cumbersome and error prone like you highlighted for a customer account that has been running for instance more than 5 years ago. It would be really nice if the terraformer would be incorporated for the BTP. |
Hi. I'm working on a shell script that uses btp cli to export all the information and format as a terraform code and the terraform import command. I can share it in the next days. |
@ikenna-okeke Thanks for the feedback. If you would like to see this it would also help us if you can vote up the feature request per se (if not already done): #724 From a technical perspective the plan is to develop something that is conceptually closer to the Azure Terraform Exporter than to the terraformer project. |
@danilobovo service instances are indeed a challenge and some might not be importable as they do not expose the parameters when fetching the data depending on their settings in the corresponding service offering. |
@lechnerc77 Thanks for the confirmation. |
@danilobovo That's the parameter. Be aware that even if the parameter is set to true some configuration data, namely the sensitive one (like admin password for HANA Cloud) won't be returned |
Hi, Whai is missing, is a feature (written around btp cli?) that loops on an existing subaccount, collect ALL resources and related ids, and generate an import.tf file to be used as I describe above... Roberto |
Hi @rkapoz-tech , thanks for your input. We also took a look into this Terraform functionality. Although this is already a better starting point than the usual import, it still has some shortcomings that you outline:
As you are using |
As discussed with @lechnerc77 , we decided to look into pulumi first to understand how the mapping is done by simply looking into the source code of terraform provider. Currently raised an issue due to package reference in their guide. |
For the PoC we focus in a a first iteration on creating the import blocks for a subaccount and the entitlements of a subaccount. The result would be a We do not need to create a |
As mentioned before, I'm using a shell script with btp cli to export some BTP resources in tf code. |
@danilobovo thanks for bringing your repository to our attention. However, due to the license you are using (GPL-3.0) and our internal Open Source guidelines on licenses, we are not allowed to use this in this project |
I removed the license, my intention is to share the code to anyone who might find it useful. |
@danilobovo thanks, however as we have these corporate restrictions we must follow some governance:
Sorry for being this picky as any help is appreciated, but we also must make sure to be in sync with our OPSO governance. |
Initial assessment and feasibility analysis completed. Closing this issue and will start development through #724 |
What area do you want to see improved?
other
Is your feature request related to a problem? Please describe.
This is a PoC for Feature Request: #724
The Terraform Provider for SAP BTP currently supports the import of resources via the standard functionality of Terraform namely
import
blocks (link).This allows our customers to import resources, but the process is quite cumbersome and error-prone.
It would be great to have a dedicated functionality to execute that export in an automated and streamlined way like:
btpexport --subaccount `name of the subaccount`
Describe the solution you would like
I would like to have a solution that fulfills the following requirements:
There will be gaps as some resources might not support the import or the configuration might not be accessible (like for some service instances). This is acceptable as long as it is logged/tracked by the tool in a machine-readable manner e.g. by a dedicated JSON file that highlights the resources that could not be imported.
Describe alternatives you have considered
The Terraformer project initiated by GCP SRE might be an alternative. It is not clear how well maintained this project is and there is no governance described in the repository that outlines contribution and review flows.
Additional context
As a blueprint for the requirement the Microsoft Azure Export for Terraform CLI can be used, as it covers exactly the same requirements, but is of course restricted to Azure:
The text was updated successfully, but these errors were encountered: