Terragrunt + Terraform with modules + GITLab

I'm using my infrastructure (IAC) at aws with terragrunt + terraform.

I already added the ssh key, GPG key to the git lab and left the repository unprotected in the branch, to do a test, but it didn't work

This would be the module call, coming to be equal to the main.tf of terraform.

# ---------------------------------------------------------------------------------------------------------------------
# Configuração do Terragrunt
# ---------------------------------------------------------------------------------------------------------------------

terragrunt = {
  terraform {
     source = "git::ssh://[email protected]:2222/x/terraform-blueprints.git//route53?ref=0.3.12"
 }

  include = {
    path = "${find_in_parent_folders()}"
  } 
}

# ---------------------------------------------------------------------------------------------------------------------
# Parâmetros da Blueprint
#


zone_id       = "ZDU54ADSD8R7PIX"
name          = "k8s"
type          = "CNAME"
ttl           = "5"
records       = ["tmp-elb.com"]

The point is that when I give an init terragrunt, in one of the modules I have the following error: ssh: connect to host gitlab.company.com.br port 2222: Connection timed out fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

[terragrunt] 2020/02/05 15:23:18 Hit multiple errors:
exit status 1

I took the test

ssh -vvvv -T gitlab.companyx.com.br -p 2222

I also got timed out

Upvotes: 0

Views: 2035

Answers (2)

Martin
Martin

Reputation: 1

The prefix for your source doesn't seem right, change it to:

source = "[email protected]:2222/x/terraform-blueprints.git//route53?ref=0.3.12"

Upvotes: 0

Matt Calhoun
Matt Calhoun

Reputation: 120

This doesn't appear to be a terragrunt or terraform issue at all, but rather, an issue with SSH access to the server.

If you are getting a timeout, it seems like it's most likely a connectivity issue (i.e., a firewall/network ACL is blocking access on that port from where you are attempting to access it).

If it were an SSH key issue, you'd get an "access denied" or similar issue, but the timeout definitely leads me to believe it's connectivity.

Upvotes: 1

Related Questions