From 0d3a7b2197f9808b5d916529d392f8e74b963689 Mon Sep 17 00:00:00 2001 From: Simon Kok Date: Fri, 17 May 2024 00:17:16 +0200 Subject: [PATCH] Fix parameter lookups to be compatible with v3.2 **Why?** In the next v4 release, the parameters automatically add the required prefixes. With v3.2, this was not the case yet. Since we are porting changes back into a new release of v3.2 we need to make sure they are compatible. **What?** Fixing the lookup and put path references as required to install and bootstrap ADF. --- src/lambda_codebase/event.py | 6 +++--- .../initial_commit/bootstrap_repository/adf-build/main.py | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/lambda_codebase/event.py b/src/lambda_codebase/event.py index bcba13141..93a039a1f 100644 --- a/src/lambda_codebase/event.py +++ b/src/lambda_codebase/event.py @@ -128,7 +128,7 @@ def create_output_object(self, account_path): 'full_path': "ROOT" if self.moved_to_root else account_path, 'destination_ou_id': self.destination_ou_id, 'source_ou_id': self.source_ou_id, - 'deployment_account_parameters' : { + 'deployment_account_parameters': { 'organization_id': organization_information.get( "organization_id" ), @@ -142,9 +142,9 @@ def create_output_object(self, account_path): 'deployment_account_bucket': DEPLOYMENT_ACCOUNT_S3_BUCKET, 'adf_version': ADF_VERSION, 'adf_log_level': ADF_LOG_LEVEL, - 'extensions/terraform/enabled': ( + '/adf/extensions/terraform/enabled': ( self._read_parameter( - 'extensions/terraform/enabled', + '/adf/extensions/terraform/enabled', 'False', ) ), 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 4d0009c9a..db7aeba67 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 @@ -201,6 +201,7 @@ def _store_extension_parameters(parameter_store, config): def worker_thread( account_id, + deployment_account_id, sts, config, s3, @@ -248,6 +249,10 @@ def worker_thread( 'bucket_name', updated_kms_bucket_dict[region]['s3_regional_bucket'], ) + parameter_store.put_parameter( + 'deployment_account_id', + deployment_account_id, + ) cloudformation = CloudFormation( region=region, deployment_account_region=config.deployment_account_region, @@ -483,6 +488,7 @@ def main(): # pylint: disable=R0915 for account_id in non_deployment_account_ids: thread = PropagatingThread(target=worker_thread, args=( account_id, + deployment_account_id, sts, config, s3,