Skip to content

Module always detect change even if src code doesn't change #339

@Cesarsk

Description

@Cesarsk

Hello everyone.

The problem is simple. I have a configuration with this module, but at every 'terraform plan' it detect changes even though the src code hasn't changed at all.

Is there a way to fix the issue?

An example of my setup:

module "build" {
  source          = "terraform-aws-modules/lambda/aws"
  version         = "3.3.1"
  providers       = { aws = aws.account1 }
  create          = true
  create_package  = true
  create_function = false
  create_layer    = false
  create_role     = false
  store_on_s3     = true

  runtime       = "nodejs13.x"
  package_type  = "Zip"
  artifacts_dir = "."
  source_path   = [
    {
      path     = "../terraform/sg-reset-lambda/src"
      commands = [
        "npm install",
        ":zip ."
      ]
    }
  ]

  s3_object_storage_class = "STANDARD_IA"
  s3_bucket               = "RESERVED"
  s3_prefix               = "lambda-functions/"
  tags                    = var.common_tags
}


module "deploy" {
  source        = "terraform-aws-modules/lambda/aws"
  version       = "3.3.1"
  providers     = { aws = aws.account2 }
  function_name = "sg-reset"
  handler       = "index.handler"
  runtime       = "nodejs14.x"
  publish       = true
 

  create_package      = false
  s3_existing_package = {
    bucket     = RESERVED
    key        = RESERVED
    version_id = RESERVED
  }

  depends_on = [
    module.build
  ]
  tags = var.common_tags
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions