aleksanderaleksic / tgmigrate

7 stars 1 forks source link

Use datasource to import resources #3

Open aleksanderaleksic opened 3 years ago

aleksanderaleksic commented 3 years ago

There should be possible to import resources using data sources. This way we can import i.e route53 zone by name.

data "aws_route53_zone" "test_com" {
  name = "test.com"
}

migrate "import" test_com" {
   state = "dns"
   name = "module.test_com.aws_route53_zone.test_com"
   resource = data.aws_route53_zone.test_com.id
}
aleksanderaleksic commented 3 years ago

Have started looking into how to get the providers that terraform uses, but currently, there is no project that solves this. I will probably create a separate project for this and use it in this project instead.