-
-
Couldn't load subscription status.
- Fork 739
Open
Description
Description
Hi
I was looking for a solution for this but i failed unfortunately. I'm creating a lambda function and lambda layer using this module. It seems that there is no way to decouple lambda layer changes that are applied in lambda function. The issue i have is exactly as described here #188 but the replies were about source code of layer/lambda and not direct layer reference in lambda function itself
- [ x] ✋ I have searched the open/closed issues and my issue is not listed.
⚠️ Note
Before you submit an issue, please perform the following first:
- Remove the local
.terraformdirectory (! ONLY if state is stored remotely, which hopefully you are following that best practice!):rm -rf .terraform/ - Re-initialize the project root to pull down modules:
terraform init - Re-attempt your terraform plan or apply and check if the issue still persists
Versions
-
Module version [Required]:
8.1.0 -
Terraform version:
1.13.3 -
Provider version(s):
6.11.0
Reproduction Code [Required]
`module "lambda" {
source = "terraform-aws-modules/lambda/aws"
function_name = var.function_name
description = var.description
handler = var.handler
runtime = "nodejs22.x"
memory_size = var.memory_size
kms_key_arn = var.kms_key_arn
publish = true
timeout = var.timeout
tracing_mode = var.tracing_mode
layers = var.layers_arns #here is the issue - cannot put ignore changes on it
create_package = false
local_existing_package = "${path.module}/lambda-init-code/init.zip"
ignore_source_code_hash = true
create_layer = false
cloudwatch_logs_retention_in_days = var.logs_retention_in_days
attach_dead_letter_policy = false
environment_variables = var.environment_variables
attach_policy_statements = false
attach_policies = true
number_of_policies = var.number_of_policies
policies = var.policies
create_unqualified_alias_lambda_function_url = false
create_unqualified_alias_allowed_triggers = false
tags = var.tags
}
// =============================================================================
module "lambda_alias" {
source = "terraform-aws-modules/lambda/aws//modules/alias"
refresh_alias = false
name = "LIVE"
function_name = module.lambda.lambda_function_name
function_version = module.lambda.lambda_function_version
create_version_allowed_triggers = false
allowed_triggers = var.allowed_triggers
}
module "lambda_layer" {
source = "terraform-aws-modules/lambda/aws"
create_layer = true
create_package = false
layer_name = "${local.prefix_name}-packages"
description = "Lambda layer for my packages"
compatible_architectures = ["x86_64"]
local_existing_package = "${path.module}/files/shared-libs.zip"
ignore_source_code_hash = true
}
`
Steps to reproduce the behavior:
No YesExpected behavior
should be possible to set ignore changes on lambda function in argument layersActual behavior
terraform wants to update lambda every time i deploy new version via CI/CDTerminal Output Screenshot(s)
Additional context
Metadata
Metadata
Assignees
Labels
No labels