lib/aws_ec2/template/helper/ami_helper.rb in aws-ec2-1.1.0 vs lib/aws_ec2/template/helper/ami_helper.rb in aws-ec2-1.2.0
- old
+ new
@@ -1,7 +1,7 @@
module AwsEc2::Template::Helper::AmiHelper
- include AwsEc2::AwsServices
+ include AwsEc2::AwsService
# Example:
#
# latest_ami("ruby-2.5.0_*") => ami-122
#
@@ -23,10 +23,11 @@
def search_ami(query, owners=["self"])
ec2.describe_images(
owners: owners,
filters: [
- {name: "name", values: [query]}
+ {name: "name", values: [query]},
+ {name: "state", values: ["available"]}
]
).images
end
end