当前位置:网站首页>Terraformer importing cloud resources
Terraformer importing cloud resources
2022-06-11 13:18:00 【Hua Weiyun】
One background
For the needs of Terraform Managed stock resources , although terraform Provides import Command to import into terraform Unified management , But the process is complicated , And easy to make mistakes , You need a tool to quickly import stock resources to terraform.
Two Terraformer brief introduction
2.1 Tool introduction
Regarding this Terraformer Is based on an existing infrastructure ( reverse Terraform) Generate tf/json and tfstate Of documents CLI Tools , Help users quickly import stock resources .
2.2 Ability
- Generate... From existing infrastructure for all supported objects based on resources tf/json + tfstate file .
- Remote status can be uploaded to GCS bucket .
- Use terraform_remote_state( Local and bucket ) Connect resources .
- Use custom folder tree mode to save tf/json file .
- Import by resource name and type .
- Support terraform 0.13( about terraform 0.11 Use v0.7.9).
Terraformer Use Terraform Provider , Designed to easily support newly added resources . To upgrade resources with new fields , All you need to do is upgrade the related Terraform Provider .
3、 ... and install
3.1 Source code compilation and installation
- Run
git clone <terraformer repo> && cd terraformer/ - Run
go mod download - Run
go build -vfor all providers OR build with one providergo run build/main.go {google,aws,azure,kubernetes,etc} - Run
terraform initagainst aversions.tffile to install the plugins required for your platform. For example, if you need plugins for the google provider,versions.tfshould contain:
terraform { required_providers { google = { source = "hashicorp/google" } } required_version = ">= 0.13"}3.2 Mac install
brew install terraformerperhaps
export PROVIDER={all,google,aws,kubernetes}curl -LO https://github.com/GoogleCloudPlatform/terraformer/releases/download/$(curl -s https://api.github.com/repos/GoogleCloudPlatform/terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/terraformer-${PROVIDER}-darwin-amd64chmod +x terraformer-${PROVIDER}-darwin-amd64sudo mv terraformer-${PROVIDER}-darwin-amd64 /usr/local/bin/terraformer3.3 Binary installation
export PROVIDER={all,google,aws,kubernetes}curl -LO https://github.com/GoogleCloudPlatform/terraformer/releases/download/$(curl -s https://api.github.com/repos/GoogleCloudPlatform/terraformer/releases/latest | grep tag_name | cut -d '"' -f 4)/terraformer-${PROVIDER}-linux-amd64chmod +x terraformer-${PROVIDER}-linux-amd64sudo mv terraformer-${PROVIDER}-linux-amd64 /usr/local/bin/terraformerFour Perform the operation
$ terraformer -hUsage: [command]Available Commands: help Help about any command import Import current state to Terraform configuration plan Plan to import current state to Terraform configuration version Print the version number of TerraformerFlags: -h, --help help for this command -v, --version version for this command$ terraformer import -hImport current state to Terraform configurationUsage: import [command]Available Commands: alicloud Import current State to terraform configuration from alicloud auth0 Import current state to Terraform configuration from Auth0 aws Import current state to Terraform configuration from AWS azure Import current state to Terraform configuration from Azure azuread Import current state to Terraform configuration from Azure Active Directory azuredevops Import current state to Terraform configuration from Azure DevOps cloudflare Import current state to Terraform configuration from Cloudflare commercetools Import current state to Terraform configuration from Commercetools datadog Import current state to Terraform configuration from Datadog digitalocean Import current state to Terraform configuration from DigitalOcean fastly Import current state to Terraform configuration from Fastly github Import current state to Terraform configuration from GitHub gitlab Import current state to Terraform configuration from GitLab gmailfilter Import current state to Terraform configuration from Gmail google Import current state to Terraform configuration from Google Cloud grafana Import current state to Terraform configuration from Grafana heroku Import current state to Terraform configuration from Heroku ibm Import current state to Terraform configuration from ibm keycloak Import current state to Terraform configuration from Keycloak kubernetes Import current state to Terraform configuration from Kubernetes launchdarkly Import current state to Terraform configuration from LaunchDarkly linode Import current state to Terraform configuration from Linode logzio Import current state to Terraform configuration from Logz.io mackerel Import current state to Terraform configuration from Mackerel metal Import current state to Terraform configuration from Equinix Metal mikrotik Import current state to Terraform configuration from RouterOS newrelic Import current state to Terraform configuration from New Relic ns1 Import current state to Terraform configuration from NS1 octopusdeploy Import current state to Terraform configuration from Octopus Deploy okta Import current State to terraform configuration from okta openstack Import current state to Terraform configuration from OpenStack opsgenie Import current state to Terraform configuration from Opsgenie pagerduty Import current state to Terraform configuration from PagerDuty panos Import current state to Terraform configuration from a PAN-OS plan Import planned state to Terraform configuration rabbitmq Import current state to Terraform configuration from RabbitMQ tencentcloud Import current state to Terraform configuration from Tencent Cloud vault Import current state to Terraform configuration from Vault vultr Import current state to Terraform configuration from Vultr xenorchestra Import current state to Terraform configuration from Xen Orchestra yandex Import current state to Terraform configuration from Yandex CloudYou can use --resources Parameter to tell you which service to import resources from . To import resources from all services , Please use --resources="*" . If you want to exclude certain services , You can associate this parameter with --excludes Composition to exclude resources from services you do not want to import , for example –resources="*" --excludes=“iam”.
utilize Terraformer Import CVM resources
terraformer import tencentcloud -r "*"5、 ... and other
- The tool requires read-only permission to list service resources .
Reference link
边栏推荐
- 【增加功能】select下拉多选 显示选中的人员
- 【201】php异常处理-PHP中的try catch finally异常处理
- [the path of system analyst] collection of wrong topics of system analyst
- China's SaaS development lags behind that of the United States for 10 years, and it still needs to rely on innovation, open source, M & A and other strategies | archsummit
- Unity 检测对象是否在相机的视锥体范围内
- C language - data storage
- Live share experience
- Tawang food industry insight | China's dairy market analysis, competition pattern, development trend and thinking
- shader着色器
- 【bug解决】上传图片后,取消这次上传 再次执行上传,上次的图片还存在
猜你喜欢

Explain in detail the differences between real participation formal parameters in C language
![[interface] view the interface path and check the interface](/img/b2/8c7645c8f915a9c8cec21bf2937298.png)
[interface] view the interface path and check the interface

Introduction to long connection

NFT市场怎么样 为什么NFT能如此火爆 怎么搭建NFT平台

How about NFT market? Why is NFT so popular? How to build NFT platform

Can't understand kotlin source code? Starting with the contracts function~
![[bug resolution] the form is paged to display the total data res.data total](/img/92/1ddde16d35465f8dd53ebf90e249b8.png)
[bug resolution] the form is paged to display the total data res.data total

Gb28181 protocol has become the mainstream in the market. How to choose the appropriate security monitoring video solution?

Will Apple build a search engine?

@How to resolve controller and requestmapping
随机推荐
启牛商学院给的券商账户是安全的吗?开户收费吗
How does go reduce supply chain attacks?
2022 年,捕捉这 12 个数据和分析趋势!
第五章 数据类型(四)
Condition debug of pycharm
Shader shader
一个时代的终结!十年了吴恩达经典《机器学习》课程本月关闭注册,上线新课!...
深度学习与CV教程(14) | 图像分割 (FCN,SegNet,U-Net,PSPNet,DeepLab,RefineNet)
网络信息系统应急响应
[backtrader source code analysis 46] cerebro Py code comments (boring, one of the core backtrader codes, recommended for reading, comments for reference only)
如何写出高性能代码(四)优化数据访问
31W contest question bonus! When AI for Science collides with the "pilot Cup", what sparks will be generated?
Terraformer导入云上资源
Some transformation thoughts of programmers after they are 35 years old
怎么管理服务器使网站稳定畅通
[arcgis] City relevance analysis
Add function drop-down multiple selections to display the selected personnel
TeaTalk·Online 演讲实录 | 圆满完结!安全上云,选对数据迁移策略很重要
kubernetes 二进制安装(v1.20.15)(六)部署WorkNode节点
【backtrader源码解析46】cerebro.py代码注释(枯燥,backtrader核心代码之一,推荐阅读,注释仅供参考)