Skip to content

archive_file doesn't re-create the archive upon content changeΒ #161

@parabolic

Description

@parabolic

Terraform CLI and Provider Versions

$ terraform version
Terraform v1.2.8
on darwin_arm64
+ provider registry.terraform.io/hashicorp/archive v2.2.0

Terraform Configuration

main.tf:

data "archive_file" "zip" {

  type        = "zip"
  output_path = "test.zip"

  source {
    content = templatefile("${path.module}/src/test.txt.tftpl", {
      # endpoint = "some_end_point"
      endpoint = "zome_end_point"
    })
    filename = "test.txt"
  }
}

./src/test.txt.tftpl:

${endpoint}

Expected Behavior

When changing the endpoint input parameter for the templatefile function, a new archive should be created since the content changed.

Actual Behavior

Terraform reported no changes:

$ terraform apply
data.archive_file.zip: Reading...
data.archive_file.zip: Read complete after 0s [id=6c897a5d6969f7679076dc66222409881d5c19d1]

No changes. Your infrastructure matches the configuration.

Terraform has compared your real infrastructure against your configuration and found no differences, so no changes are needed.

Apply complete! Resources: 0 added, 0 changed, 0 destroyed.

Steps to Reproduce

  1. terraform apply
  2. change the value of the endpoint input parameter
  3. terraform apply

How much impact is this issue causing?

Low

Logs

https://gist.github.com/parabolic/fe54b2864a9c4bde64bcaaeeb879dd42

Additional Information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions