Redundant ignore_changes element: in resource "aws_lambda_function" "this"
還沒有人認領這個 Issue。
評估
- 難度
- 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 檔案
- 有 Pull Request 範本
- 閱讀貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
cloudposse/terraform-aws-lambda-function 的其他 Issue
-
Lambda functions created will only send logs to the cloudwatch group created by the cloudwatch_log_group module if var.function_name is lowercase.可能已有人在做 @sarankumar1325 於 3 天前認領。 未關閉bug
難度 3/5 1-2 天 新手友好度 58/100
-
Warning: Deprecated attribute可能已有人在做 @arnoldasbrazys 於 427 天前認領。 未關閉bug
難度 1/5 1 小時以內 新手友好度 55/100
cloudposse/terraform-aws-lambda-function#89 · 1 個 reaction ·
-
難度 3/5 1-2 天 新手友好度 45/100
cloudposse/terraform-aws-lambda-function#84 · 3 個 reaction ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
cloudposse/terraform-aws-lambda-function#72 · 1 則留言 · 2 個 reaction ·
-
bug
難度 4/5 3-5 天 新手友好度 35/100
cloudposse/terraform-aws-lambda-function#62 · 1 則留言 ·
查看 cloudposse/terraform-aws-lambda-function 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 68/100
-
難度 2/5 1-3 小時 新手友好度 62/100
Azure/azure-storage-azcopy#3674 ·
維護者通常 1 天內回覆
-
needs-triage
難度 2/5 1-3 小時 新手友好度 62/100
manaflow-ai/cmux#31375 ·
維護者通常 1 天內回覆
-
E3601: Step Functions Task Resource ARNs are only accepted from the aws partition可能已有人在做 @hoganbr-amzn 於 1 天前認領。 未關閉
難度 2/5 1-3 小時 新手友好度 75/100
aws-cloudformation/cfn-lint#4977 ·
維護者通常 2 天內回覆