Skip to content

Regression due to #31237: Local paths not valid return values any more #31404

@dr-yd

Description

@dr-yd

Terraform Version

Working: v1.2.2
Broken:

Terraform v1.2.3
on darwin_arm64
+ provider registry.terraform.io/hashicorp/archive v2.2.0
+ provider registry.terraform.io/hashicorp/aws v4.21.0
+ provider registry.terraform.io/hashicorp/random v3.3.2

Your version of Terraform is out of date! The latest version
is 1.2.4. You can update by downloading from https://www.terraform.io/downloads.html

Same behavior in v1.2.4.

Terraform Configuration Files

n/a

Debug Output

Debug output available upon request directly to maintainers but should be easy to reproduce.

Expected Behavior

Returning a local path from an HTTP module source should be possible.

Actual Behavior

Behavior as expected in v1.2.2. In v1.2.3, sample output:

│ Could not download module "website_cloudfront_redirection" (cloudfront.website.tf:44) source code from
│ "https://example.com/cloudfront": error downloading 'https://example.com/cloudfront': invalid source
│ string: /Users/me/src/infra/terraform/aws/modules

Steps to Reproduce

Return a local path as a module location from an HTTP module source.

Additional Context

We're using a service that pins Terraform module versions depending on the repository and branch. When run locally for testing, local module paths are returned as the location. (To pipelines, git locations are returned, this works.) Pull #31237 makes this impossible. If there's a syntax to reference local paths currently, we're unaware of it.

Furthermore, the documentation is now incorrect as it states "In either case, the result is interpreted as another module source address using one of the forms documented elsewhere on this page." The local path location is documented on the same page.

https://www.terraform.io/language/modules/sources

References

#31237

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions