# Issue with importing 'aws\_route53\_health\_check' module

**URL:** <https://discuss.hashicorp.com/t/issue-with-importing-aws-route53-health-check-module/66293>\
**Category:** Terraform\
**Created:** [April 23, 2024, 1:15pm UTC](https://discuss.hashicorp.com/t/issue-with-importing-aws-route53-health-check-module/66293 "2024-04-23T13:15:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![h2oearth](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/h2oearth/32/34963_2.png) [@h2oearth](https://discuss.hashicorp.com/u/h2oearth)\
**Post date:** [April 23, 2024, 1:15pm UTC](https://discuss.hashicorp.com/t/issue-with-importing-aws-route53-health-check-module/66293/1 "2024-04-23T13:15:09Z")

</div>

Hi Terraform Gurus!

Although the ids are correct, the plan shows that two resources are going to be created instead of imported.

Any idea what could be wrong?

This is my current file structure

**/app.tf**  
**/module/r53/r53.tf**

**app.tf**

```auto
locals {
  healthchecks = [
    {
      distribution = "dist1"
      id = "XXXXf534-4f69-43cf-XXXXXXXX"
    },
    {
      distribution = "dist2"
      id = "XXXX213-52a9-435f-XXXXXXX"
    },
  ]
}

import {
  for_each = { for i, obj in local.healthchecks : obj.distribution => obj }
  to = module.r53.aws_route53_health_check.this[each.value.distribution]
  id = each.value.id
}

```

**r53.tf**

```auto
locals {
  healthchecks = [
    {
      distribution = "dist1"
      id = "XXXXf534-4f69-43cf-XXXXXXXX"
    },
    {
      distribution = "dist2"
      id = "XXXX213-52a9-435f-XXXXXXX"
    },
  ]
}

resource "aws_route53_health_check" "this" {
  for_each = { for i, obj in local.healthchecks : obj.distribution => obj }
  reference_name = each.value.distribution
  fqdn = each.value.distribution
  port = 443
  type = "HTTPS"
  resource_path = "/status/health"
  failure_threshold = 1
  request_interval = 30
}

```

---

<div class="post-metadata">

**Author:** ![jbardin](https://sea2.discourse-cdn.com/hashicorp/user_avatar/discuss.hashicorp.com/jbardin/32/3325_2.png) [@jbardin](https://discuss.hashicorp.com/u/jbardin)\
**Post date:** [April 24, 2024, 7:41pm UTC](https://discuss.hashicorp.com/t/issue-with-importing-aws-route53-health-check-module/66293/2 "2024-04-24T19:41:37Z")

</div>

Hi @h2oearth,

Aside from the XXXX replacements, is this the exact configuration you are using? If so it should work to import both of the `aws_route53_health_check` resources. Can you show the actual plan output?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/hashicorp/original/1X/79bf76adfd92a75631996933098f9ce29d37abf3.svg) [@system](https://discuss.hashicorp.com/u/system)\
**Post date:** [October 21, 2024, 7:42pm UTC](https://discuss.hashicorp.com/t/issue-with-importing-aws-route53-health-check-module/66293/3 "2024-10-21T19:42:30Z")

</div>

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
