Zend framework 无法使用Zend Framework列出Amazon Web服务中拥有的图像和正在运行的实例

Zend framework 无法使用Zend Framework列出Amazon Web服务中拥有的图像和正在运行的实例,zend-framework,amazon-web-services,Zend Framework,Amazon Web Services,我正在使用Zend Framework的库来管理EC2实例和AMI。但是,我不能列出我拥有的AMI,也不能列出现有的EC2实例 $ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey); $instances = $ec2Instance ->describe(); $ec2Instance->describe()应该列出所有实例,但它不返回任何实例,即使此时我有三个实例正在运行 $

我正在使用Zend Framework的库来管理EC2实例和AMI。但是,我不能列出我拥有的AMI,也不能列出现有的EC2实例

$ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey);
$instances = $ec2Instance ->describe();
$ec2Instance->describe()应该列出所有实例,但它不返回任何实例,即使此时我有三个实例正在运行

$ami = new Zend_Service_Amazon_Ec2_Image($awsAccessKey, $awsSecretKey);
$images = $ami->describe();
$ami->descripe()返回所有公共图像,但没有一个是我创建的,即使我有两个ami


有人知道我在这里遗漏了什么吗?

问题是您必须为实例显式设置区域

$ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey);
$instances = $ec2Instance ->describe();
从Zend Framework的1.10.3版开始,以下内容将不起作用,因为它将在内部设置不同的变量:

$ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey);
$ec2Instance->setRegion('us-west-1');
此外,使用Zend Framework的1.10.3版,us-west-1被视为无效区域

相反,在构造函数中设置区域将使其工作:

$ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey, 'us-west-1');
然后我可以使用$ec2Instance->descripe()列出我的所有实例

$ec2Instance = new Zend_Service_Amazon_Ec2_Instance($awsAccessKey, $awsSecretKey);
$instances = $ec2Instance ->describe();