首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >DomainLabelEmpty (域名标签为空)遇到了“语义搜索-v2.aws.maga.China”。

DomainLabelEmpty (域名标签为空)遇到了“语义搜索-v2.aws.maga.China”。
EN

Stack Overflow用户
提问于 2020-11-22 16:34:23
回答 1查看 1.4K关注 0票数 0

我可以在Route53中创建一个记录:

但是当我用cdk代码做同样的事情时。失败了。这是“守则”:

代码语言:javascript
复制
    // ALB names are limited to 32 characters...workaround
    let lbNameLength = 28 
    let truncatedServiceName = props.serviceName.substring(0, lbNameLength)

    // Creating an internet facing ALB
    const loadBalancer = new elbv2.ApplicationLoadBalancer(this, "alb", {
      vpc: props.cluster.vpc,
      vpcSubnets: {
        subnets: props.cluster.vpc.privateSubnets
      },
      loadBalancerName: `${truncatedServiceName}-lb`,
      idleTimeout: Duration.seconds(3600)
    });

    // Allowing incoming connections 
    loadBalancer.connections.allowFromAnyIpv4(ec2.Port.tcp(props.lbPort), "Allow inbound HTTP");

    // Creating a listener and listen to incoming requests
    const listener = loadBalancer.addListener("listener", {
      port: props.lbPort,
      protocol: elbv2.ApplicationProtocol.HTTP
    });

    // Creating a target group that points to the application container (e.g. port 8080)
    listener.addTargets("targets", {
      port: props.containerPort,
      protocol: elbv2.ApplicationProtocol.HTTP,
      targets: [service],
      healthCheck: {
        path: '/health'
      }
    });

    const dnsParams= dnsParameters(this, id)

    const magnaHostedZone = route53.HostedZone.fromHostedZoneAttributes(this, 'hostedZone', {
      hostedZoneId: dnsParams.hostedZoneId,
      zoneName: dnsParams.zoneName
    })

    // Using alias because load balancer is an AWS resource
    new route53.ARecord(this, 'aRecord', {
      zone: magnaHostedZone,
      target: route53.AddressRecordTarget.fromAlias(new targets.LoadBalancerTarget(loadBalancer)),
      recordName: "semantic-search-v2"
    });

当我运行这个类型记录cdk代码时,它会发生以下错误:

代码语言:javascript
复制
DomainLabelEmpty (Domain label is empty) encountered with 'semantic-search-v2.aws.magna.china.' (Service: AmazonRoute53; Status Code: 400; Error Code: InvalidInput; Request ID: 9f643150-262c-43fc-87ff-800dca172171; Proxy: null)

我不知道“DomainLabelEmpty”是什么意思。

顺便说一句,我帐户的所有子网都是私有的,不能访问公共网络。

提前谢谢你帮我!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-11-22 16:43:17

尝试将r53承载的区域名追加到ARecord的recordName属性。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64956686

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档