From 0c01c7f495154d6206a6eadbc5e246280ae873b7 Mon Sep 17 00:00:00 2001 From: Enis Afgan Date: Wed, 6 Dec 2017 05:14:56 -0500 Subject: [PATCH] Allow AMIs to be read from a custom file path (#1379) --- moto/ec2/models.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moto/ec2/models.py b/moto/ec2/models.py index e6a1d0be..a50125b0 100755 --- a/moto/ec2/models.py +++ b/moto/ec2/models.py @@ -4,6 +4,7 @@ import copy import itertools import ipaddress import json +import os import re import six import warnings @@ -117,7 +118,8 @@ INSTANCE_TYPES = json.load( open(resource_filename(__name__, 'resources/instance_types.json'), 'r') ) AMIS = json.load( - open(resource_filename(__name__, 'resources/amis.json'), 'r') + open(os.environ.get('MOTO_AMIS_PATH') or resource_filename( + __name__, 'resources/amis.json'), 'r') )