我可以成功获取EC2实例列表。
使用以下代码
$conf_aws = array();
$conf_aws['credentials']= array(
'key' => $config['AWS']['configkey'],
'secret' => $config['AWS']['configsecret'],
);
$conf_aws['region'] = 'ap-southeast-1';
$conf_aws['version']='latest';
$ec2Client = \Aws\Ec2\Ec2Client::factory($conf_aws);
$list = $ec2Client->DescribeInstances();
任何人都可以建议如何获取保留实例的列表。
答案 0 :(得分:1)
使用此编辑后的代码即可使用。
$conf_aws = array();
$conf_aws['credentials']= array(
'key' => $config['AWS']['configkey'],
'secret' => $config['AWS']['configsecret'],
);
$conf_aws['region'] = 'ap-southeast-1';
$conf_aws['version']='latest';
$ec2Client = \Aws\Ec2\Ec2Client::factory($conf_aws);
$list = $ec2->describe_reserved_instances_listing();