How to import to module using terragrunt?

Viewed 2015

So I'm having a hard time trying to import into module when using a third-party module via terragrunt.

My terragrunt.hcl file is as follows

locals {
  environment_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
  env = local.environment_vars.locals.environment
}

terraform {
  source = "git::git@github.com:cloudposse//terraform-aws-elasticsearch.git//?ref=0.26.0"
}

include {
  path = find_in_parent_folders()
}

I was trying to import by using

terragrunt import module.terraform-aws-elasticsearch.aws_elasticsearch_domain.default elasticsearch

But I keep getting this error

Error: Import to non-existent module

module.terraform-aws-elasticsearch is not defined in the configuration. Please add configuration for this module before importing into it.

[terragrunt] 2021/01/25 15:23:26 Hit multiple errors:
exit status 1

So I'm wondering what's the proper module name or if that's even possible to do with Terragrunt. Any help will be greatly appreciated! Thanks in advance.

0 Answers
Related