Skip to content

Commit

Permalink
Fix the instance_idle issue (#761)
Browse files Browse the repository at this point in the history
  • Loading branch information
athiruma authored Apr 26, 2024
1 parent acb1506 commit cbc876f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions cloud_governance/policy/helpers/aws/aws_policy_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')

Expand Down

0 comments on commit cbc876f

Please sign in to comment.