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
-
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 个 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
-
test: gcloud CLI suites clobber ~/.config/gcloud, breaking local gcloud/gcloud-backed juju workflows未关闭needs-kind needs-triage
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
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 ·