【发布时间】:2021-12-27 03:31:37
【问题描述】:
我正在使用@aws-cdk/aws-ec2 创建ClientVpnEndpoint
const clientVpnEndpoint = new ClientVpnEndpoint(stack, "vpn-enpoint", {
vpc: vpc,
cidr: "10.16.0.0/22",
clientCertificateArn: config.clientCertificateArn,
serverCertificateArn: config.serverCertificateArn,
dnsServers: ["8.8.8.8", "4.4.4.4"],
logging: false,
})
我想阅读我在控制台的摘要部分看到的属性 DnsName,我也可以在运行 cli 命令aws ec2 describe-client-vpn-endpoints 时看到它。
我的最佳尝试,但不起作用:
const cfnVpnEndpoint = vpnEndpoint.node.defaultChild as CfnClientVpnEndpoint;
new CfnOutput(stack, "vpn-enpoint-output", {
value: cfnVpnEndpoint.getAtt("DnsName").toString(),
});
我收到错误:
.../Value/Fn::GetAtt: Resource type AWS::EC2::ClientVpnEndpoint does not support attribute {DnsName}
我实际上无法让getAtt 为我使用任何其他道具。怎么用?
你能帮我找出读取 ClientVpnEndpoint 的 DnsName 的道具吗
【问题讨论】:
标签: amazon-web-services amazon-ec2 amazon-cloudformation aws-cdk