From b0941c2a05c2231c1e08fc6336382f0d2f93e534 Mon Sep 17 00:00:00 2001 From: Alexey Chuprikov Date: Mon, 11 May 2020 18:49:48 +0300 Subject: [PATCH] Update amiinfo lambda Set `Owners` parameter to `aws-marketplace`. This gets the latest official CentOS 7 image instead of using latest CentOS 7 image accessible in the account that can be amended private image. Using such an image can result in some undesirable side effects. --- hammer/identification/lambdas/ami-info/amiinfo.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hammer/identification/lambdas/ami-info/amiinfo.py b/hammer/identification/lambdas/ami-info/amiinfo.py index e9cb1c27..e45d31d4 100755 --- a/hammer/identification/lambdas/ami-info/amiinfo.py +++ b/hammer/identification/lambdas/ami-info/amiinfo.py @@ -54,10 +54,11 @@ def lambda_handler(event, context): config=botocore.config.Config(retries={'max_attempts': 3}) ) images = ec2.describe_images( - Filters = [{ + Filters=[{ "Name": "product-code", "Values": [PRODUCT_CODE] - }] + }], + Owners=['aws-marketplace'] )['Images'] except Exception: logging.exception("Failed to describe images")