Skip to content

Commit

Permalink
AIRSHIP-3913 - fix asg script
Browse files Browse the repository at this point in the history
  • Loading branch information
Giorgia Amici committed Jul 10, 2024
1 parent ef120c0 commit 23f228d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions config/plugin/launch_config_drift.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ then
fi

instance="$(echo "${instances}" | jq '.AutoScalingInstances[0]')"
instance_launch_config="$(echo "${instance}" | jq -r .LaunchConfigurationName)"
instance_launch_config="$(echo "${instance}" | jq -r .LaunchTemplate.LaunchTemplateName)"
instance_asg="$(echo "${instance}" | jq -r .AutoScalingGroupName)"

asgs="$(aws autoscaling describe-auto-scaling-groups --auto-scaling-group-names ${instance_asg})"
Expand All @@ -26,11 +26,11 @@ then
exit $UNKNOWN
fi

asg_launch_config="$(echo "${asgs}" | jq -r '.AutoScalingGroups[0].LaunchConfigurationName')"
asg_launch_config="$(echo "${asgs}" | jq -r '.AutoScalingGroups[0].MixedInstancesPolicy.LaunchTemplate.LaunchTemplateSpecification.LaunchTemplateName')"

if [ "${instance_launch_config}" = "${asg_launch_config}" ]
then
exit $OK
else
exit $NONOK
fi
fi

0 comments on commit 23f228d

Please sign in to comment.