LoginSignup
0
0

terraformerでlambdaの設定をimportしようとしたら404になる

Posted at

terraformer 使ってますか?

既存のクラウド構成からterraformの定義ファイルを生成してくれる便利なヤツです。

terraformerのimportでリソースにAWS Lambdaを指定すると次のようなエラーになります。MacのHomebrewでのエラー解消方法メモです。

  • terraformer 0.8.24 (Homebrewでインストール。2024年1月時点で最新)
$ terraformer import aws -r=lambda
2024/01/10 23:02:30 aws importing default region
2024/01/10 23:02:33 aws importing... lambda
2024/01/10 23:02:34 aws error initializing resources in service lambda, err: operation error Lambda: GetPolicy, https response error StatusCode: 404, RequestID: da938aca-5ec3-4c77-a108-b854aa062ad1, ResourceNotFoundException: The resource you requested does not exist.
2024/01/10 23:02:34 aws Connecting.... 

バグチケットは対応されてmasterブランチにマージされています。

Error: Import AWS Lambda ends w/ an error #1599
https://github.com/GoogleCloudPlatform/terraformer/issues/1599

Homebrewでインストールされる最新バージョンには修正が含まれないため、リポジトリのmasterブランチ最新を取得してインストールします。

$ brew unlink terraformer
$ brew install --HEAD --force terraformer

これでimportできるようになりました😇

$ terraformer import aws -r=lambda
2024/01/10 23:27:08 aws importing default region
2024/01/10 23:27:11 aws importing... lambda
2024/01/10 23:27:15 aws done importing lambda
2024/01/10 23:27:15 Number of resources for service lambda: 1
2024/01/10 23:27:15 Refreshing state... aws_lambda_function.tfer--test
2024/01/10 23:27:17 Filtered number of resources for service lambda: 1
2024/01/10 23:27:17 aws Connecting.... 
2024/01/10 23:27:17 aws save lambda
2024/01/10 23:27:17 aws save tfstate for lambda
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0