Skip to content

S3 sources for modules takes precedence over local modules #168

@hangrybear666

Description

@hangrybear666

when you define terraform modules with a remote source in e.g. an s3 bucket such as:

module "waf" {
  source = "https://company-domain.s3-eu-west-1.amazonaws.com/terraform-repository/aws-factories/aws-waf-factory/snapshot/aws-waf-factory.tgz"
  }

then no matter what way I call terravision, it attempts to download this remote module, even if called without AWS and Terraform access using planfile & graphfile.

Meanwhile the module has already been downloaded locally by terraform init and is available in .terraform/modules.

This breaks my CI CD pipelines that create graph and planfiles in one step, then call terravision without internet access for security and isolation in another step

I fixed this by calling
sed -i 's|https://company-domain.s3-eu-west-1.amazonaws.com/terraform-repository/aws-factories/aws-waf-factory/snapshot/aws-waf-factory.tgz|./.terraform/modules/waf|g' main.tf prior to terravision calls but it requires manual checking all terraform code for remote sources.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions