我正在尝试使用 Route53 和 aws-php-sdk 创建一个子域。
但我一次又一次地收到这个错误:
[2017-06-16 12:17:00] local.ERROR:Aws\Exception\CredentialsException:从实例配置文件元数据服务器检索凭据时出错。
(cURL 错误 7:无法连接到 169.254.169.254 端口 80:没有到主机的路由(参见http://curl.haxx.se/libcurl/c/libcurl-errors.html))在 /var/www/html/测试/供应商/aws/aws-sdk-php/src/Credentials/InstanceProfileProvider.php:79
我正在使用 aws-sdk-php 版本:3.29 "aws/aws-sdk-php": "^3.29"
这是我的书面代码
use Aws\Route53\Route53Client;
$client = Route53Client::factory(array(
'region' => 'us-east-1',
'version' => '2013-04-01',
'credentials ' => array('key'=>'AWS_KEY',
'secret'=>'AWS_SECRET_KEY')
));
$result = $client->changeResourceRecordSets(array(
// HostedZoneId is required
'HostedZoneId' => 'ROUTER_53_HOSTED_ZONE_ID',
// ChangeBatch is required
'ChangeBatch' => array(
// Changes is required
'Changes' => array(
array(
// Action is required
'Action' => 'CREATE',
// ResourceRecordSet is required
'ResourceRecordSet' => array(
// Name is required
'Name' => 'test2.xyz.co.in.',
// Type is required
'Type' => 'A',
'TTL' => 600,
"AliasTarget"=> array(
"HostedZoneId"=> "LOAD_BALANCER_ZONE_ID",
"DNSName"=> "LOAD_BALANCER_DOMAIN_NAME",
"EvaluateTargetHealth"=> false
),
),
),
),
),
));
帮助将是可观的。提前致谢。