forked from p15670423/monkey
Fixed usage of aws instance
This commit is contained in:
parent
30972d926a
commit
66b90f6bfe
|
@ -5,6 +5,9 @@ __author__ = 'itay.mizeretz'
|
||||||
|
|
||||||
|
|
||||||
class AwsInstance(object):
|
class AwsInstance(object):
|
||||||
|
"""
|
||||||
|
Class which gives useful information about the current instance you're on.
|
||||||
|
"""
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
try:
|
try:
|
||||||
self.instance_id = urllib2.urlopen('http://169.254.169.254/latest/meta-data/instance-id', timeout=2).read()
|
self.instance_id = urllib2.urlopen('http://169.254.169.254/latest/meta-data/instance-id', timeout=2).read()
|
||||||
|
|
|
@ -59,7 +59,8 @@ class AwsService(object):
|
||||||
:return:
|
:return:
|
||||||
"""
|
"""
|
||||||
# local_ssm_client = boto3.client("ssm", region_name=AwsService.region)
|
# 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:
|
try:
|
||||||
response = local_ssm_client.describe_instance_information()
|
response = local_ssm_client.describe_instance_information()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue