diff --git a/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py b/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py index e10e5ada7..001a77f24 100644 --- a/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py +++ b/cloud_governance/policy/policy_operations/aws/zombie_cluster/zombie_cluster_common_methods.py @@ -129,13 +129,19 @@ def _get_tags_of_zombie_resources(self, resources: list, resource_id_name: str, cluster_delete_days = self.get_tag_name_from_tags(tags=tags, tag_name='ClusterDeleteDays') if cluster_delete_days: if resource_id in zombies: - tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', - tag_value=str(int(cluster_delete_days) + 1)) + if self.dry_run == 'no': + tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', + tag_value=str(int(cluster_delete_days) + 1)) + else: + tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(0)) else: tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(0)) else: if resource_id in zombies: - tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(1)) + if self.dry_run == 'no': + tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(1)) + else: + tags = self.update_resource_tags(tags=tags, tag_name='ClusterDeleteDays', tag_value=str(0)) if old_tags != tags: try: if aws_service == 'ec2':