Skip to content

Upgrading to 7.16 or later causes unexpected resource add/change/destroy #689

Open
@johnjeffers

Description

@johnjeffers

Description

I am currently on version 7.2.2. Attempting to upgrade to 7.16 or later causes the tf plan to report several adds, changes, and deletes.

It seems to be related to the new module.site_origin_request_handler.local_file.archive_plan[0] resource being created, which is changing the filename of the module.site_origin_request_handler.null_resource.archive[0] resource, which cascades down to changing the cache behaviors in the cloudfront distribution that uses the lambda.

Is there are parameter I can set to avoid these changes, that will allow me to upgrade without having these unexpected updates?

If your request is for a new feature, please use the Feature request template.

  • ✋ I have searched the open/closed issues and my issue is not listed.

⚠️ Note

Before you submit an issue, please perform the following first:

  1. Remove the local .terraform directory (! ONLY if state is stored remotely, which hopefully you are following that best practice!): rm -rf .terraform/
  2. Re-initialize the project root to pull down modules: terraform init
  3. Re-attempt your terraform plan or apply and check if the issue still persists

Versions

  • Module version [Required]: 7.16.0 or later

  • Terraform version:
    1.12.2

  • Provider version(s):

Reproduction Code [Required]

module "site_origin_request_handler" {
  source  = "terraform-aws-modules/lambda/aws"
  version = "7.16.0"

  lambda_at_edge = true

  function_name = "site-origin-request-handler"
  description   = "origin-request handler for cloudfront behaviors"
  handler       = "index.handler"
  runtime       = "nodejs18.x"
  architectures = ["x86_64"]
  source_path   = "../lambdas/site-origin-request-handler/src/index.mjs"
  timeout       = 10

  recreate_missing_package     = true
  trigger_on_package_timestamp = false

  attach_policy = true
  policy        = aws_iam_policy.site_origin_request_handler.arn
}

Steps to reproduce the behavior:

Expected behavior

Actual behavior

Terminal Output Screenshot(s)

Additional context

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