From cb511d22d0920e075910d62c890e15a9e42e7b7f Mon Sep 17 00:00:00 2001 From: syedimranhassan Date: Tue, 12 Dec 2023 12:22:55 +0500 Subject: [PATCH] chore: Update check primray key job to run for whitelisted regions --- devops/jobs/CheckPrimaryKeys.groovy | 7 ++++++- devops/resources/check_primary_keys.sh | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/devops/jobs/CheckPrimaryKeys.groovy b/devops/jobs/CheckPrimaryKeys.groovy index 653c1e998..91937f1db 100644 --- a/devops/jobs/CheckPrimaryKeys.groovy +++ b/devops/jobs/CheckPrimaryKeys.groovy @@ -38,12 +38,17 @@ class CheckPrimaryKeys { rdsignore = "${rdsignore}-i ${ignore} " } + def whitelistregions = "" + configuration.REGION_LIST.each { include -> + whitelistregions = "${whitelistregions}-r ${include} " + } + environmentVariables { env('ENVIRONMENT', environment) env('DEPLOYMENT', deployment) env('AWS_DEFAULT_REGION', extraVars.get('REGION')) env('RDSIGNORE', rdsignore) - + env('WHITELISTREGIONS', whitelistregions) } multiscm { diff --git a/devops/resources/check_primary_keys.sh b/devops/resources/check_primary_keys.sh index b516426e9..18fe05b2b 100644 --- a/devops/resources/check_primary_keys.sh +++ b/devops/resources/check_primary_keys.sh @@ -22,5 +22,8 @@ set -x if [[ ! -v RDSIGNORE ]]; then RDSIGNORE="" fi +if [[ ! -v WHITELISTREGIONS ]]; then + WHITELISTREGIONS="" +fi -python ./check_primary_keys.py --environment ${ENVIRONMENT} --deploy ${DEPLOYMENT} --region $AWS_DEFAULT_REGION --recipient $TO_ADDRESS --sender $FROM_ADDRESS ${RDSIGNORE} +python ./check_primary_keys.py --environment ${ENVIRONMENT} --deploy ${DEPLOYMENT} --region $AWS_DEFAULT_REGION --recipient $TO_ADDRESS --sender $FROM_ADDRESS ${RDSIGNORE} ${WHITELISTREGIONS}