We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7e299cf commit 2601832Copy full SHA for 2601832
functions/lambda.py
@@ -59,11 +59,15 @@ class InstanceRefreshInProgress(LambdaError):
59
60
def get_current_image_id():
61
"""Returns current AMI from SSM"""
62
+ param_value = ""
63
param = ssm.get_parameter(Name=SSM_PARAMETER_NAME)
- param_value = json.loads(param['Parameter']['Value'])
64
- image_id = param_value['image_id']
+ if param['Parameter']['Value'].startswith('ami-'):
65
+ image_id = param['Parameter']['Value']
66
+ else:
67
+ param_value = json.loads(param['Parameter']['Value'])
68
+ image_id = param_value['image_id']
69
logger.info('Newest image_id is "%s"', image_id)
- return param_value['image_id']
70
+ return image_id
71
72
73
def get_launch_template_name_and_auto_scaling_group():
0 commit comments