如何通过 terraform 在 route53 上获取现有域名
How to get existing domain name on route53 by terraform
我想在route53 上的现有dns 名称中做一个记录。我如何在 terraform 中执行此操作?
您可以使用“aws_route53_record”
将 DNS 记录添加到现有区域
resource "aws_route53_record" "www" {
zone_id = aws_route53_zone.primary.zone_id
name = "www.example.com"
type = "A"
ttl = "300"
records = [aws_eip.lb.public_ip]
}
官方参考:https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record
我想在route53 上的现有dns 名称中做一个记录。我如何在 terraform 中执行此操作?
您可以使用“aws_route53_record”
将 DNS 记录添加到现有区域resource "aws_route53_record" "www" {
zone_id = aws_route53_zone.primary.zone_id
name = "www.example.com"
type = "A"
ttl = "300"
records = [aws_eip.lb.public_ip]
}
官方参考:https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/route53_record