Giter Site home page Giter Site logo

Terraform backend setup issues about pants HOT 6 OPEN

kuza55 avatar kuza55 commented on May 24, 2024
Terraform backend setup issues

from pants.

Comments (6)

lilatomic avatar lilatomic commented on May 24, 2024

what's the "source" of module "dashboard_cert"? Any chance it's a transitively-included module?

from pants.

kuza55 avatar kuza55 commented on May 24, 2024

It's a public module:

module "dashboard_cert" {
  source  = "terraform-aws-modules/acm/aws"
  version = "~> 4.0"

from pants.

lilatomic avatar lilatomic commented on May 24, 2024

Oh, seems we're swallowing errors during init:

╷
│ Error: Failed to download module
│ 
│ Could not download module "dashboard_cert" (../mod1/main.tf:8) source code
│ from
│ "git::https://github.com/terraform-aws-modules/terraform-aws-acm?ref=v4.5.0":
│ error downloading
│ 'https://github.com/terraform-aws-modules/terraform-aws-acm?ref=v4.5.0':
│ git must be available and on the PATH.
╵

fair enough, we don't have git on the path. I think this would affect all public modules.

from pants.

lilatomic avatar lilatomic commented on May 24, 2024

a quick workaround is to passthrough your path. In pants.toml:

[download-terraform]
extra_env_vars = [
  "PATH"
]

I know it's not ideal.

from pants.

kuza55 avatar kuza55 commented on May 24, 2024

That resolved the issue with git modules, now I'm seeing local (non-transitive) modules fail too:

$ pants check terraform::
14:36:57.33 [ERROR] Completed: pants.backend.terraform.goals.check.terraform_check - terraform-validate failed (exit code 1).
╷
│ Error: Module not installed
│
│   on api.tf line 120:
│  120: module api_task {
│
│ This module's local cache directory  could not be read. Run "terraform
│ init" to install all modules required by this configuration

from api.tf:

module api_task {
  source = "./api_task"

from pants.

lilatomic avatar lilatomic commented on May 24, 2024

I think that was fixed with #20241 . Can you try with one of the releases since then (like version 2.18.2rc2)? If not, you should be able to add the local module as a dependency manually. eg:

terraform_module(
  name="mod",
  dependencies=["./api_task:mod"],
)

from pants.

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.