当前位置:网站首页>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
边栏推荐
- 【接口】看接口路径 查接口
- 自定义Terraform-Providers(Terraform Plugin Framework)-04
- Business practice of volcano engine cloud database VEDB in bytes
- 工作总结之因为笛卡尔积问题写SQL搞了半天[害](附笛卡尔积总结)
- 字节真的是宇宙尽头吗?
- Dbutil auxiliary class, manual commit transaction, metadata
- 怎么管理服务器使网站稳定畅通
- [background interaction] select to bind the data transferred in the background
- Musk says he doesn't like being a CEO, but rather wants to do technology and design; Wu Enda's "machine learning" course is about to close its registration | geek headlines
- 历史上的今天:Apple II 问世;微软收购 GECAD;发明“软件工程”一词的科技先驱出生...
猜你喜欢

Application of pip2pi, pypiserver and Apache in PIP local source configuration

關於分布式鎖的續命問題——基於Redis實現的分布式鎖

UI inspiration analysis Notes 6: feature
![InfoQ geek media's 15th anniversary essay solicitation - dynamic ranking of mobile terminal development [mui+flask+mongodb]](/img/92/50a92eb6b5c2ac3f58c499796a1e8c.png)
InfoQ geek media's 15th anniversary essay solicitation - dynamic ranking of mobile terminal development [mui+flask+mongodb]
Go语言学习之WaitGroup用法详解

详解C语言实参与形参的区别

Ecplise cannot connect to SQL Server

The Tree (AVL, 2-3-, 红黑,Huffman)

Teatalk · online speech record | complete! It is important to select the right data migration strategy for safe cloud deployment

网络信息系统应急响应
随机推荐
jdbctemplate数据后台管理,不知道为什么添加用户的时候显示roleId为空
Chapter V data type (IV)
[clearos] install the clearos system
Hashicopy之nomad应用编排方案08(检测Job)
怎么管理服务器使网站稳定畅通
On the continuing Life of Distributed Locks - - Distributed Locks Based on redis
Hashicopy之nomad应用编排方案07(提交Job)
【201】php异常处理-PHP中的try catch finally异常处理
tf. Data (II) -- parallelization tf data. Dataset generator
JSP实现银柜台业务绩效考核系统
JDBC connection pool is used for batch import. 5million data are run each time, but various problems will occur in the middle
Microsoft exposes another "scandal": watching VR porn in the office, "the father of hololens" is about to leave!
常用字体介绍
添加环境路径
Hashicopy之nomad应用编排方案06(配置task)
长连接简介
【接口】看接口路径 查接口
I have solved a problem that makes me feel guilty: pycharm SSH debug always does not exist
InfoQ geek media's 15th anniversary essay solicitation - dynamic ranking of mobile terminal development [mui+flask+mongodb]
/usr/bin/gzip: 1: ELF: not found /usr/bin/gzip: 3: : not found /usr/bin/gzip: 4: Syntax erro