Redundant ignore_changes element: in resource "aws_lambda_function" "this"
まだ誰も着手していません。
評価
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 初心者へのやさしさ
- 55/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- aws, terraform
- 領域
- cloud, infrastructure
調査の方向性
main.tf の 93–95 行目付近にある lifecycle ブロックから始め、aws_lambda_function リソースに対する Terraform の警告を確認してください。Terraform v1.5.6、AWS provider v5.19.0、および報告で説明されている s3_bucket/s3_key モジュール構成を使って問題を再現してください。terraform plan または apply が冗長な ignore_changes 警告なしで完了すれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Describe the Bug
When running terraform plan (or apply), a declaration of this module throws the following warning:
│ Warning: Redundant ignore_changes element
│
│ on .terraform/modules/foo.lambda_changes/main.tf line 21, in resource "aws_lambda_function" "this":
│ 21: resource "aws_lambda_function" "this" {
│
│ Adding an attribute name to ignore_changes tells Terraform to ignore future changes to the argument in configuration after the object has been created, retaining the value originally configured.
│
│ The attribute last_modified is decided by the provider alone and therefore there can be no configured value to compare with. Including this attribute in ignore_changes has no effect. Remove the attribute from ignore_changes to quiet this
│ warning.
│
│ (and one more similar warning elsewhere)
The error is coming from the lifecycle block at https://github.com/cloudposse/terraform-aws-lambda-function/blob/0.5.1/main.tf#L93-L95
lifecycle {
ignore_changes = [last_modified]
}
Expected Behavior
When running terraform plan (or apply), a declaration of this module does not throw a "Redundant ignore_changes element" warning
Steps to Reproduce
In my case, I declared this module with s3_bucket and s3_key:
module "lambda_responses" {
source = "cloudposse/lambda-function/aws"
version = "0.5.1"
function_name = "${module.lambda_label.id}-test"
attributes = concat(module.lambda_label.attributes, ["test"])
description = "Yay lambdas"
s3_bucket = var.responses_lambda_s3_bucket
s3_key = var.responses_lambda_s3_key
runtime = var.responses_lambda_runtime
handler = var.responses_lambda_handler
architectures = ["x86_64"]
context = module.lambda_label.context
}
Then ran terraform apply from the root module shown above.
The Lambda and related resources were created just fine, but the Terraform run ended with the "ignore_changes" warning.
Environment
Versions:
- Terraform v1.5.6
- module cloudposse/lambda-function/aws 0.5.1
- provider registry.terraform.io/hashicorp/aws v5.19.0
- provider registry.terraform.io/hashicorp/time v0.9.1
Additional Context
Root cause and the reason for the lifecycle block in the first place: https://github.com/hashicorp/terraform-provider-aws/issues/29085
- 主要言語
- HCL
- スター
- 36
- フォーク
- 44
- PR マージ指標
- 30日以内にマージされた PR はありません
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
cloudposse/terraform-aws-lambda-function のほかの issue
-
bug
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
-
Warning: Deprecated attribute対応中かも @arnoldasbrazys が 402 日前に担当しました。 オープンbug
難易度 1/5 1時間未満 初心者へのやさしさ 55/100
cloudposse/terraform-aws-lambda-function#89 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 45/100
cloudposse/terraform-aws-lambda-function#84 · リアクション 3 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cloudposse/terraform-aws-lambda-function#72 · コメント 1 件 · リアクション 2 件 ·
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
cloudposse/terraform-aws-lambda-function#62 · コメント 1 件 ·
cloudposse/terraform-aws-lambda-function の issue をすべて見る
似ている issue
-
No native support for REDIS_USER enviroment var対応中かも @jholmes802 が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
-
enhancement service/recovery-services v/5.x
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
hashicorp/terraform-provider-azurerm#33587 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
ovh/terraform-provider-ovh#1473 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
jenkinsci/ec2-plugin#2041 ·