From cbc876fb40d1812fd18ae157fc1e36665f73847c Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti <97395760+athiruma@users.noreply.github.com> Date: Fri, 26 Apr 2024 12:36:32 +0530 Subject: [PATCH] Fix the instance_idle issue (#761) --- cloud_governance/policy/helpers/aws/aws_policy_operations.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cloud_governance/policy/helpers/aws/aws_policy_operations.py b/cloud_governance/policy/helpers/aws/aws_policy_operations.py index 38ae3b66..4c67f81c 100644 --- a/cloud_governance/policy/helpers/aws/aws_policy_operations.py +++ b/cloud_governance/policy/helpers/aws/aws_policy_operations.py @@ -132,10 +132,8 @@ def update_resource_day_count_tag(self, resource_id: str, cleanup_days: int, tag elif self._policy == 'empty_roles': self._iam_client.tag_role(RoleName=resource_id, Tags=tags) elif self._policy in ('ip_unattached', 'unused_nat_gateway', 'zombie_snapshots', 'unattached_volume', - 'instance_run'): + 'instance_run', 'instance_idle'): self._ec2_client.create_tags(Resources=[resource_id], Tags=tags) - elif self._policy == 'instance_idle': - self._ec2_client.stop_instances(InstanceIds=[resource_id]) except Exception as err: logger.info(f'Exception raised: {err}: {resource_id}')