以下是示例代码:
创建私有DNS服务器: aws ec2 create-resolver-endpoint --name my-private-dns --direction INGRESS --ip-addresses SubnetId=subnet-12345678 --security-group-ids sg-12345678
添加DNS服务器:
aws ec2 modify-client-vpn-endpoint --client-vpn-endpoint-id
添加RDS私有DNS A记录: aws route53 change-resource-record-sets --hosted-zone-id Z1234567890ABC --change-batch '{ "Changes": [ { "Action": "CREATE", "ResourceRecordSet": { "Name": "my-db.mycorp.com", "Type": "A", "TTL": 300, "ResourceRecords": [ { "Value": "10.0.0.100" } ] } } ] }'
配置路由表:
aws ec2 create-route --route-table-id rtb-12345678 --destination-cidr-block