由于域已经存在,我将该区域导入到我的配置中:
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