Skip to content

The files are recreated during the plan while using resources #451

@rissanypro

Description

@rissanypro

Terraform CLI and Provider Versions

Terraform v1.12.1
registry.terraform.io/hashicorp/archive v2.7.1

Terraform Configuration

resource "archive_file" "init" {
  type        = "zip"
  source_dir  = "${path.module}/script"
  output_path = "${path.module}/file.zip"
}

Expected Behavior

The file have to be recreated during terraform apply

Actual Behavior

The file is recreated during terraform plan.

Steps to Reproduce

resource "archive_file" "init" {
  type        = "zip"
  source_dir  = "${path.module}/script"
  output_path = "${path.module}/file.zip"
}
terraform plan
terraform apply

At first execution, all is fine. The file is created when terraform apply is executed.

Remove the file.zip and execute terraform plan: The file is recreated during terraform plan instead of terraform apply.

How much impact is this issue causing?

High

Logs

No response

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
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions