diff --git a/Makefile.tox b/Makefile.tox index 1cffe0b6f..0c8d8521a 100644 --- a/Makefile.tox +++ b/Makefile.tox @@ -11,10 +11,8 @@ all: test lint test: # Run unit tests - ( \ - for config in $(TEST_CONFIGS); do \ - pytest $$(dirname $$config) -vvv -s -c $$config; \ - done \ + @ $(foreach config,$(TEST_CONFIGS), \ + pytest $$(dirname $(config)) -vvv -s -c $(config) || exit 1; \ ) lint: diff --git a/src/lambda_codebase/event.py b/src/lambda_codebase/event.py index cb31afff7..0b7595fc5 100644 --- a/src/lambda_codebase/event.py +++ b/src/lambda_codebase/event.py @@ -135,6 +135,7 @@ def create_output_object(self, account_path): 'master_account_id': organization_information.get( "organization_master_account_id" ), + 'deployment_account_id': self.deployment_account_id, 'notification_endpoint': self.main_notification_endpoint, 'notification_type': self.notification_type, 'cross_account_access_role': self.cross_account_access_role, diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py index 61a3ff3bf..918b30cac 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/main.py @@ -146,6 +146,10 @@ def prepare_deployment_account(sts, deployment_account_id, config): deployment_account_parameter_store.put_parameter( 'deployment_account_bucket', DEPLOYMENT_ACCOUNT_S3_BUCKET_NAME ) + deployment_account_parameter_store.put_parameter( + 'deployment_account_id', + deployment_account_id, + ) deployment_account_parameter_store.put_parameter( 'default_scm_branch', config.config.get('scm', {}).get( diff --git a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py index c7aaac85f..821dba1a5 100644 --- a/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py +++ b/src/lambda_codebase/initial_commit/bootstrap_repository/adf-build/tests/test_main.py @@ -133,7 +133,7 @@ def test_prepare_deployment_account_defaults(param_store_cls, cls, sts): ) for param_store in parameter_store_list: assert param_store.put_parameter.call_count == ( - 12 if param_store == deploy_param_store else 2 + 13 if param_store == deploy_param_store else 2 ) param_store.put_parameter.assert_has_calls( [ @@ -147,6 +147,7 @@ def test_prepare_deployment_account_defaults(param_store_cls, cls, sts): call('adf_version', '1.0.0'), call('adf_log_level', 'CRITICAL'), call('deployment_account_bucket', 'some_deployment_account_bucket'), + call('deployment_account_id', deployment_account_id), call('default_scm_branch', 'master'), call('/adf/org/stage', 'none'), call('cross_account_access_role', 'some_role'), @@ -225,7 +226,7 @@ def test_prepare_deployment_account_specific_config(param_store_cls, cls, sts): ) for param_store in parameter_store_list: assert param_store.put_parameter.call_count == ( - 14 if param_store == deploy_param_store else 2 + 15 if param_store == deploy_param_store else 2 ) param_store.put_parameter.assert_has_calls( [ @@ -239,6 +240,7 @@ def test_prepare_deployment_account_specific_config(param_store_cls, cls, sts): call('adf_version', '1.0.0'), call('adf_log_level', 'CRITICAL'), call('deployment_account_bucket', 'some_deployment_account_bucket'), + call('deployment_account_id', deployment_account_id), call('default_scm_branch', 'main'), call('/adf/org/stage', 'test-stage'), call('auto_create_repositories', 'disabled'), diff --git a/src/lambda_codebase/initial_commit/initial_commit.py b/src/lambda_codebase/initial_commit/initial_commit.py index ba25254cc..0a426c26d 100644 --- a/src/lambda_codebase/initial_commit/initial_commit.py +++ b/src/lambda_codebase/initial_commit/initial_commit.py @@ -33,6 +33,9 @@ "bootstrap_repository/adf-bootstrap/example-global-iam.yml": ( "adf-bootstrap/global-iam.yml" ), + "bootstrap_repository/adf-bootstrap/deployment/example-global-iam.yml": ( + "adf-bootstrap/deployment/global-iam.yml" + ), "adf.yml.j2": "adf-accounts/adf.yml", "adfconfig.yml.j2": "adfconfig.yml", }