File tree 2 files changed +12
-1
lines changed
2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change 1
1
install-requirements :
2
2
pip install -r requirements.txt
3
3
4
- cloudformation-validate : install-requirements
4
+ check-env-setup :
5
+ python -c ' from utils import check_environment_variables; check_environment_variables()' ;
6
+
7
+ cloudformation-validate : install-requirements check-env-setup
5
8
python -c ' from deploy_cloudformation import validate_templates; validate_templates()' ;
6
9
7
10
infra-deploy : cloudformation-validate
Original file line number Diff line number Diff line change @@ -60,3 +60,11 @@ def get_aws_account_id():
60
60
61
61
def generate_hash (n ):
62
62
return str (uuid4 ().hex [:n ])
63
+
64
+
65
+ def check_environment_variables ():
66
+ for env_var in ['AWS_REGION' , 'ENVIRONMENT' ]:
67
+ try :
68
+ env_var_value = os .environ [env_var ]
69
+ except KeyError :
70
+ raise KeyError (f'Environment variable { env_var } not found. Please set it up before starting.' )
You can’t perform that action at this time.
0 commit comments