现在,我想使用AWS CDK实现这一点。
我尝试了以下操作:
const zone = route53.HostedZone.fromHostedZoneId(this, 'ZenithWebFoundryZone', 'ZXXXXXX04V8134');
new route53.AliasRecord(this, 'BlogAPIRecord', {
zone: zone,
recordName: 'xxxxxx.zenxxxxxxfoundry.com',
target: {
bind: (): route53.AliasRecordTargetProps => ({
dnsName: 'd-xxxxxxy00g.execute-api.ap-southeast-2.amazonaws.com',
hostedZoneId: 'ZXXXXXX04V8134'
})
}
});
在执行命令npm run build
时一切正常,但是当我运行cdk synth
命令时,出现了一个相当晦涩的错误:
$ cdk synth
HostedZone.fromHostedZoneId doesn't support "zoneName"
Subprocess exited with error 1
打开--trace
并没有起到太大的帮助作用:附加信息如下:
Error: Subprocess exited with error 1
at ChildProcess.proc.on.code (/Users/mikecoxon/.npm-packages/lib/node_modules/aws-cdk/lib/api/cxapp/exec.ts:108:23)
at ChildProcess.emit (events.js:189:13)
at ChildProcess.EventEmitter.emit (domain.js:441:20)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
我已经查看了整个堆栈脚本,没有任何关于zoneName
的引用。有人知道这个错误是从哪里来的吗?
hostedZoneId
.... 但是没有关于id
参数的解释。 - Chetan