terraform-ibm-modules/terraform-ibm-cis

[CIS] terraform init fails with the provided example

Closed this issue · 4 comments

Affected modules

  • CIS

Terraform CLI and Terraform provider versions

  • Terraform version:
  • Provider version:
    Terraform v1.4.4
    on darwin_amd64

Terraform output

Debug output

Expected behavior

CIS module to be instantiated

Actual behavior

 Error: Failed to read module directory
│
│ Module directory .terraform/modules/cis_dns_records/dns does not exist or cannot be read.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory .terraform/modules/cis_glb/glb does not exist or cannot be read.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory .terraform/modules/cis_dns_records/dns does not exist or cannot be read.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory .terraform/modules/cis_glb/glb does not exist or cannot be read.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory .terraform/modules/cis_dns_records/dns does not exist or cannot be read.
╵

╷
│ Error: Failed to read module directory
│
│ Module directory .terraform/modules/cis_glb/glb does not exist or cannot be read.

Steps to reproduce (including links and screen captures)

  1. Add the CIS example
  2. Run terraform init

Anything else


By submitting this issue, you agree to follow our Code of Conduct

What worked for me

module "cis_dns_records" {
  source          = "git::https://github.com/terraform-ibm-modules/terraform-ibm-cis.git//modules/dns"
  cis_instance_id = module.cis_instance.cis_instance_id
  domain_id       = module.cis_instance.cis_domain.domain_id
  dns_record_set      = [
    {
      type    = "A"
      name    = "test-example"
      content = "1.2.3.4"
      ttl     = 900
    }
  ]
}

module "cis_glb" {
  source             = "git::https://github.com/terraform-ibm-modules/terraform-ibm-cis.git//modules/glb"
  cis_instance_id    = module.cis_instance.cis_instance_id
  domain_id          = module.cis_instance.cis_domain.domain_id
  glb_name           = "cis_glb"
  fallback_pool_name = "cis_fpn"
  glb_enabled        = true
  origin_pools       = [
    {
      name = "glb1"
      origins = [{
        name    = "o-1"
        address = "1.1.1.0"
        enabled = true
        }]
      enabled           = true
      description       = "Test GLB"
      check_regions     = ["WEU"]
      health_check_name = "hc1"
    }
  ]
  health_checks       = [
    {
      expected_body  = "alive"
      expected_codes = "200"
      method         = "GET"
      timeout        = 7
      path           = "/health"
      interval       = 60
      retries        = 3
      name           = "hc1"
    }
  ]
}

@VidyasagarMSC
I cloned the repo and did terraform init in examples/complete dir, it worked fine for me. How did you run example?

Also, please make sure you are working on latest release.

@VidyasagarMSC Can you confirm its working now? Can we close this issue?

@VidyasagarMSC Hope it worked for you.
Feel free to reopen if you still face any issue. Thanks.