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.
2 parents dc75191 + 2866f00 commit 8d70169Copy full SHA for 8d70169
functions/lambda.py
@@ -59,11 +59,16 @@ class InstanceRefreshInProgress(LambdaError):
59
60
def get_current_image_id():
61
"""Returns current AMI from SSM"""
62
+ param_value = None
63
param = ssm.get_parameter(Name=SSM_PARAMETER_NAME)
- param_value = json.loads(param['Parameter']['Value'])
64
- image_id = param_value['image_id']
+ value = param['Parameter']['Value']
65
+ if value.startswith('ami-'):
66
+ image_id = value
67
+ else:
68
+ param_value = json.loads(value)
69
+ image_id = param_value['image_id']
70
logger.info('Newest image_id is "%s"', image_id)
- return param_value['image_id']
71
+ return image_id
72
73
74
def get_launch_template_name_and_auto_scaling_group():
0 commit comments