Giter Site home page Giter Site logo

Comments (9)

PurrBiscuit avatar PurrBiscuit commented on July 24, 2024 11

Currently using Terraform version 0.11.9.

This is still an issue for us; We're running Terraform in different containers for the terraform plan and terraform apply portions of our Terraform pipeline in Jenkins. I believe this is causing the archive_file to get produced during the terraform plan portion of the pipeline due to it being a data source. We aren't persisting data between the plan and apply containers either so we end up with errors during the terraform apply that look like:

Error: Error applying plan:

1 error(s) occurred:

* aws_lambda_function.scheduler: 1 error(s) occurred:

* aws_lambda_function.scheduler: Unable to load "/opt/jenkins/storage/example/notify/master/131/us-east-1/notify/terraform/files/scheduler.zip": open /opt/jenkins/storage/example/notify/master/131/us-east-1/notify/terraform/files/scheduler.zip: no such file or directory

from terraform-provider-archive.

stevehorsfield avatar stevehorsfield commented on July 24, 2024 1

@kelchm:

We're slowly stopping using this now as the underlying issue has been solved in a later release of Terraform Enterprise. However, our approach was largely like this:

resource "random_id" "id" {
  keepers {
    timestamp = "${timestamp()}" # force change on every execution
  }
}

data "archive_file" "example" { # shamelessly copied example from the docs
  type        = "zip"
  source_file = "${path.module}/init.tpl"
  output_path = "${path.module}/files/init.${resource.random_id.id.dec}.zip" # with a minor edit!
}

This forces the archive_file output_path to vary on every execution, both plan and apply, forcing a new instance and thereby forcing the recreation of the archive file.

from terraform-provider-archive.

stevehorsfield avatar stevehorsfield commented on July 24, 2024

We've seen this in more recent versions of Terraform. Our approach so far has been to use the random provider to workaround this issue, but it is far from ideal.

from terraform-provider-archive.

kelchm avatar kelchm commented on July 24, 2024

Also seeing this issue, currently using v0.9.5.

@stevehorsfield, can you explain how you are using the random provider to solve the issue?

from terraform-provider-archive.

paultyng avatar paultyng commented on July 24, 2024

@blalor is this still an issue? Was it a file attribute problem? If so, it should now be addressed.

from terraform-provider-archive.

blalor avatar blalor commented on July 24, 2024

I'm sorry, I don't have the ability to reproduce this under the conditions it was happening under before.

from terraform-provider-archive.

paultyng avatar paultyng commented on July 24, 2024

Closing for now, but if this is still an issue for anyone and you have a config that can reproduce it, please open a new issue with the details!

from terraform-provider-archive.

agamenonam avatar agamenonam commented on July 24, 2024

I solved it, adding on filename "folder/filename.zip"

image

from terraform-provider-archive.

github-actions avatar github-actions commented on July 24, 2024

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

from terraform-provider-archive.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.