Skip to content

Terraform downloads module from git source for every usage #11435

@mattlqx

Description

@mattlqx

Terraform Version

0.8.4

Affected Resource(s)

  • core

Terraform Configuration Files

module "ui" {
  source = "git::ssh://git@bitbucket.foo.io:7999/repo/project//aws_instance"
  ...
}

module "db" {
  source = "git::ssh://git@bitbucket.foo.io:7999/repo/project//aws_instance"
  ...
}

module "api" {
  source = "git::ssh://git@bitbucket.foo.io:7999/repo/project//aws_instance"
  ...
}

Expected Behavior

I would think that TF would be able to identify that the module source is the same on all these resources and be able to download the module source once and apply it to each usage rather than downloading it N times.

Actual Behavior

Output appears to show the module is downloaded N times instead of once.

Get: git::ssh://git@bitbucket.foo.io:7999/repo/project (update)
Get: git::ssh://git@bitbucket.foo.io:7999/repo/project (update)
Get: git::ssh://git@bitbucket.foo.io:7999/repo/project (update)

Steps to Reproduce

Create several modules that use the same source and run a TF plan or apply operation.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions