Skip to content

Provider produced inconsistent final plan for source_code_hash #663

Open
@djakielski

Description

@djakielski

Description

I had an issue with changes and deployment of lambda function when using auto build. Maybe this is more a provoder bug?

Versions

  • Module version: 7.20.1

  • Terraform version:

Terraform v1.10.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/aws v5.84.0
+ provider registry.terraform.io/hashicorp/external v2.3.4
+ provider registry.terraform.io/hashicorp/http v3.4.0
+ provider registry.terraform.io/hashicorp/local v2.5.2
+ provider registry.terraform.io/hashicorp/null v3.2.3
+ provider registry.terraform.io/hashicorp/random v3.6.0
+ provider registry.terraform.io/hashicorp/tls v4.0.4
+ provider registry.terraform.io/jianyuan/sentry v0.13.1
  • Provider version(s):
    Providers required by configuration:
.
├── provider[registry.terraform.io/hashicorp/random] 3.6.0
├── provider[registry.terraform.io/hashicorp/http] 3.4.0
├── provider[registry.terraform.io/hashicorp/tls] 4.0.4
├── provider[registry.terraform.io/jianyuan/sentry] 0.13.1
├── provider[registry.terraform.io/hashicorp/aws] ~> 5.0

Reproduction Code

module "cdn_function_reisemagazin_rewrite" {
  source  = "terraform-aws-modules/lambda/aws"
  version = "7.20.1"

  function_name                = "cdn-reisemagazin-rewrite"
  description                  = "Rewrite headers"
  handler                      = "dist/main.handler"
  runtime                      = "nodejs22.x"
  trigger_on_package_timestamp = false
  recreate_missing_package     = false

  publish        = true
  lambda_at_edge = true
  source_path = [
    {
      path = "cdn-functions/reisemagazin-rewrite"
      commands = [
        "npm ci",
        "npm run build",
        "npm prune --production",
        ":zip"
      ]
      prefix_in_zip = "dist"
    }
  ]

  providers = {
    aws = aws.us-east-1
  }
  tags = local.holidayguruAllTags
}

Steps to reproduce the behavior:

terraform apply

Expected behavior

Should be deployed.

Actual behavior

Deployment fails. After two retries, it works fine.

Terminal Output Screenshot(s)

│ Error: Provider produced inconsistent final plan

│ When expanding the plan for
│ module.cdn_function_reisemagazin_rewrite.aws_lambda_function.this[0] to include new
│ values learned so far during apply, provider
│ "registry.terraform.io/hashicorp/aws" produced an invalid new value for
│ .source_code_hash: was
│ cty.StringVal("pL+RtsVm8jioo3I9uYiR4yPfc0hfbKtBz1zkSqbuMWk="), but now
│ cty.StringVal("Gli5ygJZc6siVv3F42MWnJnROrQcNfTgVgzScmsw2CY=").

│ This is a bug in the provider, which should be reported in the provider's own
│ issue tracker.

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