From 825d563d9901686a93260cb9536d0fdb45daf423 Mon Sep 17 00:00:00 2001 From: skyuecx0630 <48788794+skyuecx0630@users.noreply.github.com> Date: Wed, 7 Aug 2024 21:39:20 +0900 Subject: [PATCH] Fix launch template check --- services/ec2.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/ec2.py b/services/ec2.py index 41b1820..b6abaa9 100644 --- a/services/ec2.py +++ b/services/ec2.py @@ -13,10 +13,10 @@ def autoscaling_launch_template(): asgs = autoscaling_client.describe_auto_scaling_groups()["AutoScalingGroups"] for asg in asgs: - if "LaunchTemplate" in asg["MixedInstancesPolicy"]: - compliant_resources.append(asg["AutoScalingGroupARN"]) - else: + if "LaunchConfigurationName" in asg: non_compliant_resources.append(asg["AutoScalingGroupARN"]) + else: + compliant_resources.append(asg["AutoScalingGroupARN"]) return RuleCheckResult( passed=not non_compliant_resources,