DEV Community

Atsushi Miyamoto
Atsushi Miyamoto

Posted on

Terraform import block to import AWS route53

Write import block

Define import block to import exist route53 resource.

// import.tf
import {
  to = aws_route53_record.example
  id = "{hostedZoneId}_{recordName}_{Type}"
}
Enter fullscreen mode Exit fullscreen mode

Run command

Run tf command to output config to generated_resources.tf

terraform plan -generate-config-out=generated_resources.tf
Enter fullscreen mode Exit fullscreen mode

reference:

Terraform generating-configuration

Top comments (0)