diff --git a/monkey/common/cloud/aws_instance.py b/monkey/common/cloud/aws_instance.py index f80b44474..b8405b189 100644 --- a/monkey/common/cloud/aws_instance.py +++ b/monkey/common/cloud/aws_instance.py @@ -5,6 +5,9 @@ __author__ = 'itay.mizeretz' class AwsInstance(object): + """ + Class which gives useful information about the current instance you're on. + """ def __init__(self): try: self.instance_id = urllib2.urlopen('http://169.254.169.254/latest/meta-data/instance-id', timeout=2).read() diff --git a/monkey/common/cloud/aws_service.py b/monkey/common/cloud/aws_service.py index a35bdf6b8..735c4e976 100644 --- a/monkey/common/cloud/aws_service.py +++ b/monkey/common/cloud/aws_service.py @@ -59,7 +59,8 @@ class AwsService(object): :return: """ # local_ssm_client = boto3.client("ssm", region_name=AwsService.region) - local_ssm_client = boto3.client("ssm", region_name=AwsInstance.get_region()) + current_instance = AwsInstance() + local_ssm_client = boto3.client("ssm", region_name=current_instance.get_region()) try: response = local_ssm_client.describe_instance_information()