patrickchugh / terravision

Terravision creates Professional Cloud Architecture Diagrams from your Terraform code automatically. Supports AWS, Google and Azure.
Mozilla Public License 2.0
679 stars 66 forks source link

ERROR: Unable to call Git to clone repository #118

Open soldera opened 2 months ago

soldera commented 2 months ago

Hi! I am having an issue with the drawing process.

Steps to reproduce:

mkdir test
cd test
touch main.tf

main.tf:

terraform {
  required_providers {
    aws = {
      source  = "hashicorp/aws"
      version = "~> 5.0"
    }
  }

  required_version = ">= 1.7.2"
}

provider "aws" {
  region = "us-east-1"
}

module "eks_prometheus" {
  # Locked to v2.2.3
  source = "github.com/terraform-aws-modules/terraform-aws-managed-service-prometheus?ref=ce8c537c5ecae79a693ed819c1e958e24a4b3083"

  workspace_alias = "alias-dev"
}

terravision draw --source test/ --debug

Preflight check..
  dot command detected: /opt/homebrew/bin/dot
  gvpr command detected: /opt/homebrew/bin/gvpr
  git command detected: /usr/bin/git
  terraform command detected: /usr/local/bin/terraform

Checking Terraform Version...

Terraform v1.7.2

Initializing the backend...
Initializing modules...
Downloading git::https://github.com/terraform-aws-modules/terraform-aws-managed-service-prometheus.git?ref=ce8c537c5ecae79a693ed819c1e958e24a4b3083 for eks_prometheus...
- eks_prometheus in /var/folders/q7/z4xm9hbx44x81mm5jw5hr7rw0000gn/T/tmpr88u4c34/modules/eks_prometheus

Initializing provider plugins...
- Finding hashicorp/aws versions matching ">= 4.35.0, ~> 5.0"...
- Installing hashicorp/aws v5.47.0...
- Installed hashicorp/aws v5.47.0 (signed by HashiCorp)

Terraform has created a lock file .terraform.lock.hcl to record the provider
selections it made above. Include this file in your version control repository
so that Terraform can guarantee to make the same selections by default when
you run "terraform init" in the future.

Terraform has been successfully initialized!

You may now begin working with Terraform. Try running "terraform plan" to see
any changes that are required for your infrastructure. All Terraform commands
should now work.

If you ever set or change modules or backend configuration for Terraform,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.

Initalising workspace: default

Generating Terraform Plan..

Terraform used the selected providers to generate the following execution plan. Resource actions are
indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.eks_prometheus.aws_prometheus_alert_manager_definition.this[0] will be created
  + resource "aws_prometheus_alert_manager_definition" "this" {
      + definition   = <<-EOT
            alertmanager_config: |
              route:
                receiver: 'default'
              receivers:
                - name: 'default'
        EOT
      + id           = (known after apply)
      + workspace_id = (known after apply)
    }

  # module.eks_prometheus.aws_prometheus_workspace.this[0] will be created
  + resource "aws_prometheus_workspace" "this" {
      + alias               = "alias-dev"
      + arn                 = (known after apply)
      + id                  = (known after apply)
      + prometheus_endpoint = (known after apply)
      + tags_all            = (known after apply)
    }

Plan: 2 to add, 0 to change, 0 to destroy.

─────────────────────────────────────────────────────────────────────────────────────────────────────────

Saved the plan to: /var/folders/q7/z4xm9hbx44x81mm5jw5hr7rw0000gn/T/tfplan.bin

To perform exactly these actions, run the following command to apply:
    terraform apply "/var/folders/q7/z4xm9hbx44x81mm5jw5hr7rw0000gn/T/tfplan.bin"

Analysing plan..

Unprocessed terraform graph dictionary:

{
    "aws_prometheus_alert_manager_definition.this~1": [],
    "aws_prometheus_workspace.this~1": [
        "aws_prometheus_alert_manager_definition.this~1"
    ]
}

Parsing Terraform Source Files..
  Added Source Location: test/
  Parsing test/prometheus.tf
    Found 1 module stanza(s)

Loading Sources..
  Processing External Module: github.com/terraform-aws-modules/terraform-aws-managed-service-prometheus?ref=ce8c537c5ecae79a693ed819c1e958e24a4b3083
    Assuming code from Terraform registry source: https://github.com/terraform-aws-modules/terraform-aws-managed-service-prometheus
0it [00:00, ?it/s]
ERROR: Unable to call Git to clone repository! Check git and SSH fingerprints and keys are correct and ensure the URL https://github.com/terraform-aws-modules/terraform-aws-managed-service-prometheus is reachable via CLI.
patrickchugh commented 1 month ago

Can you try if it works without pointing to a particular ?ref= in the terraform?

f0rkth1s commented 1 month ago

We have this same issue cloning a repo from Azure devops where the git URL is incorrect with a / where a : should be