小编ish*_*ish的帖子

尝试创建 aws_route53_record 以指向负载均衡器,但使用 terraform 时不断收到错误

由于域已经存在,我将该区域导入到我的配置中:

resource "aws_route53_zone" "example_hosted_zone" {
  name = "example.club"
}
Run Code Online (Sandbox Code Playgroud)

53号公路记录:

resource "aws_route53_record" "us-battasks" {
  zone_id = aws_route53_zone.example_hosted_zone.zone_id
  name    = "us-battasks"
  type    = "CNAME"
  ttl     = "60"
  records = [aws_lb.restricted_access_lb.id]
}

resource "aws_route53_record" "us-battasksapi" {
  zone_id = aws_route53_zone.example_hosted_zone.zone_id
  name    = "us-battasksapi"
  type    = "CNAME"
  ttl     = "60"
  records = [aws_lb.restricted_access_lb.id]
}
Run Code Online (Sandbox Code Playgroud)

Terraform 计划显示它将创建资源,但当我应用时,我收到以下错误:

Error: [ERR]: Error building changeset: InvalidChangeBatch: [Invalid Resource Record: FATAL problem: DomainLabelTooLong (Domain label is too long) encountered with 'arn:aws:elasticloadbalancing:us-east-1:221124075124:loadbalancer', Unparseable CNAME encountered]
    status code: 400, request id: …
Run Code Online (Sandbox Code Playgroud)

amazon-web-services amazon-route53 terraform terraform-provider-aws

5
推荐指数
1
解决办法
6150
查看次数