From b2675035e5ae595ca2869724a83e2996c40163bc Mon Sep 17 00:00:00 2001 From: Thirumalesh Aaraveti Date: Tue, 2 Jan 2024 17:17:21 +0530 Subject: [PATCH] removed ec2 run in GHA --- .github/workflows/Build.yml | 2 +- jenkins/clouds/aws/daily/policies/run_policies.py | 2 +- .../cloud_governance/aws/zombie_non_cluster/test_ebs_in_use.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/Build.yml b/.github/workflows/Build.yml index 8ba2e23f..80da72e7 100644 --- a/.github/workflows/Build.yml +++ b/.github/workflows/Build.yml @@ -358,7 +358,7 @@ jobs: strategy: matrix: region: ['us-east-1', 'us-east-2', 'us-west-1', 'us-west-2', 'eu-central-1', 'ap-south-1', 'eu-north-1', 'ap-northeast-1', 'ap-southeast-1', 'ap-southeast-2', 'eu-south-1', 'eu-west-3', 'sa-east-1'] - policy: ['ec2_idle', 'ec2_run', 'ebs_unattached', 'ebs_in_use'] + policy: ['ec2_idle', 'instance_run', 'ebs_unattached', 'ebs_in_use'] # we don't run zombie_cluster_resource due to long run steps: - uses: actions/checkout@v3 diff --git a/jenkins/clouds/aws/daily/policies/run_policies.py b/jenkins/clouds/aws/daily/policies/run_policies.py index ed62fb90..91e163ed 100644 --- a/jenkins/clouds/aws/daily/policies/run_policies.py +++ b/jenkins/clouds/aws/daily/policies/run_policies.py @@ -112,7 +112,7 @@ def get_policies(type: str = None): {'account': 'PSAP', 'AWS_ACCESS_KEY_ID': AWS_ACCESS_KEY_ID_DELETE_PSAP, 'AWS_SECRET_ACCESS_KEY': AWS_SECRET_ACCESS_KEY_DELETE_PSAP, 'BUCKET_NAME': BUCKET_PSAP}] policies.remove('ebs_in_use') -remove_polices = ['ec2_run', 'ebs_in_use', 'zombie_cluster_resource', 'ec2_idle', 'skipped_resources', 'ec2_stop'] # policies that will not aggregate +remove_polices = ['instance_run', 'ebs_in_use', 'zombie_cluster_resource', 'ec2_idle', 'skipped_resources', 'ec2_stop'] # policies that will not aggregate policies = [policy.replace('_', '-') for policy in policies if policy not in remove_polices] common_input_vars = {'PUBLIC_CLOUD_NAME': 'AWS', 'BUCKET_KEY': 'logs', 'KERBEROS_USERS': f"{special_user_mails}", 'LDAP_HOST_NAME': f"{LDAP_HOST_NAME}", 'log_level': "INFO", 'MAIL_ALERT_DAYS': "[4, 6, 7]", 'POLICY_ACTIONS_DAYS': "[7]", 'POLICIES_TO_ALERT': policies, 'es_host': ES_HOST, 'es_port': ES_PORT} combine_vars = lambda item: f'{item[0]}="{item[1]}"' diff --git a/tests/unittest/cloud_governance/aws/zombie_non_cluster/test_ebs_in_use.py b/tests/unittest/cloud_governance/aws/zombie_non_cluster/test_ebs_in_use.py index e5f5c20f..6e35ebd8 100644 --- a/tests/unittest/cloud_governance/aws/zombie_non_cluster/test_ebs_in_use.py +++ b/tests/unittest/cloud_governance/aws/zombie_non_cluster/test_ebs_in_use.py @@ -45,4 +45,4 @@ def test_ebs_in_use_s3_upload(): policy_output = 's3://test-upload-data/test' s3operations = S3Operations(region_name='us-east-1') ebs_in_use = EbsInUse() - assert s3operations.save_results_to_s3(policy='ec2_run', policy_output=policy_output, policy_result=ebs_in_use.run()) is None + assert s3operations.save_results_to_s3(policy='ebs_in_use', policy_output=policy_output, policy_result=ebs_in_use.run()) is None