'semantic-search-v2.aws.magna.china.' 遇到 DomainLabelEmpty(域标签为空)
DomainLabelEmpty (Domain label is empty) encountered with 'semantic-search-v2.aws.magna.china.'
我可以在 Route53 中创建 A 记录:
但是当我使用cdk代码做同样的事情时。它失败了。
这是代码:
// 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"
});
当我运行这个typescript cdk代码时,出现了这个错误:
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' 是什么意思。
顺便说一句,我帐户的所有子网都是私有的,无法访问 public 网络。
在此先感谢您对我的帮助!
尝试将 r53 托管区域名称附加到 ARecord 的 recordName
属性。
我可以在 Route53 中创建 A 记录:
但是当我使用cdk代码做同样的事情时。它失败了。 这是代码:
// 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"
});
当我运行这个typescript cdk代码时,出现了这个错误:
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' 是什么意思。
顺便说一句,我帐户的所有子网都是私有的,无法访问 public 网络。
在此先感谢您对我的帮助!
尝试将 r53 托管区域名称附加到 ARecord 的 recordName
属性。