Resolve valid image value error

和自甴很熟 提交于 2019-12-25 07:00:12

问题


I'm trying to create and deploy a PostgreSQL server to AWS using the knife-ec2 gem and chef. In my .chef repository of my project I have the knife.rb file. Here are the contents of that file.

cookbook_path [ 'Users/Petesta/Git/ringbase/chef/cookbooks' ]

knife[:aws_access_key_id] = "randomString"

knife[:aws_secret_access_key] = "randomString"

knife[:aws_ssh_key_id] = "default"

knife[:flavor] = "t1.micro"

knife[:image] = "ami-6aad335a"

knife[:region] = "us-west-1"

knife[:availability_zone] = "us-west-1a"

Let's say my .pem file is named default.pem. I've put the value for the key aws_ssh_key_id as default and default.pem. I was looking around and a post mentioned excluding the .pem extension. But it still produced the same error.

And then when I run the command knife ec2 server create "role[postgresql::server]" I get the error.

Error: You have not provided a valid image (AMI) value. Please note that the short option for this value recently changed from '-i' to '-I'.

I'm not sure what to do. Anyone have any ideas?

I've also tried manually specifying it on the command line.


回答1:


So the issue was that the AMI I was using is not in the same region. The AMI was not in us-west-1 but in us-west-2 and didn't match the value for key region.



来源:https://stackoverflow.com/questions/21638676/resolve-valid-image-value-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!